From 16618634c1e3f6f048f9fed92c99cb253a2cd8dd Mon Sep 17 00:00:00 2001 From: Omikhleia Date: Tue, 28 Jan 2025 20:09:36 +0100 Subject: [PATCH 1/2] fix: Rough graphics path rounding error --- packages/framebox/graphics/renderer.lua | 9 ++++----- 1 file changed, 4 insertions(+), 5 deletions(-) diff --git a/packages/framebox/graphics/renderer.lua b/packages/framebox/graphics/renderer.lua index 32bd79a..1aeefd4 100644 --- a/packages/framebox/graphics/renderer.lua +++ b/packages/framebox/graphics/renderer.lua @@ -1,7 +1,7 @@ -- -- Some classes to build PDF graphics drawings (path strings) -- License: MIT --- 2022, 2023 Didier Willis +-- 2022, 2023, 2025 Didier Willis -- -- Public API consists in: -- - a PathRenderer class that provides basic drawing methods, using a default @@ -16,14 +16,14 @@ local PRNG = require("prng-prigarin") -- HELPERS ---- Round number +--- Round number to string for output. -- -- @tparam number number number value --- @return rounded value for output +-- @treturn string rounded value as string local function _r (number) -- Lua 5.3+ formats floats as 1.0 and integers as 1 -- Also some PDF readers do not like double precision. - return math.floor(number) == number and math.floor(number) or tonumber(string.format("%.5f", number)) + return math.floor(number) == number and tostring(math.floor(number)) or string.format("%.5f", number) end --- Builds a PDF graphics color (stroke or fill) from a SILE parsed color. @@ -488,4 +488,3 @@ return { PathRenderer = PathRenderer, RoughPainter = RoughPainter, } - From 4187bc4a6be760710eeba44e93ee00e97f86d5b4 Mon Sep 17 00:00:00 2001 From: Omikhleia Date: Tue, 28 Jan 2025 20:12:57 +0100 Subject: [PATCH 2/2] chore: Add rockspec for 3.1.1 distribution --- rockspecs/ptable.sile-3.1.1-1.rockspec | 51 ++++++++++++++++++++++++++ 1 file changed, 51 insertions(+) create mode 100644 rockspecs/ptable.sile-3.1.1-1.rockspec diff --git a/rockspecs/ptable.sile-3.1.1-1.rockspec b/rockspecs/ptable.sile-3.1.1-1.rockspec new file mode 100644 index 0000000..af92102 --- /dev/null +++ b/rockspecs/ptable.sile-3.1.1-1.rockspec @@ -0,0 +1,51 @@ +rockspec_format = "3.0" +package = "ptable.sile" +version = "3.1.1-1" +source = { + url = "git+https://github.com/Omikhleia/ptable.sile.git", + tag = "v3.1.1", +} +description = { + summary = "Paragraph boxes, framed boxes and table packages for the SILE typesetting system.", + detailed = [[ + This package for the SILE typesetter provides struts, paragraph boxes + (parbox), framed boxes (framebox) and tables (ptable). + ]], + homepage = "https://github.com/Omikhleia/ptable.sile", + license = "MIT", +} +dependencies = { + "lua >= 5.1", + "silex.sile >= 0.6.0, < 1.0", +} +build = { + type = "builtin", + modules = { + ["sile.packages.struts"] = "packages/struts/init.lua", + ["sile.packages.parbox"] = "packages/parbox/init.lua", + ["sile.packages.ptable"] = "packages/ptable/init.lua", + ["sile.packages.framebox"] = "packages/framebox/init.lua", + ["sile.packages.framebox.graphics.renderer"] = "packages/framebox/graphics/renderer.lua", + ["sile.packages.framebox.graphics.rough"] = "packages/framebox/graphics/rough.lua", + ["prng-prigarin"] = "prng-prigarin/init.lua", + ["rough-lua.rough.jsshims"] = "rough-lua/rough/jsshims.lua", + ["rough-lua.rough.generator"] = "rough-lua/rough/generator.lua", + ["rough-lua.rough.renderer"] = "rough-lua/rough/renderer.lua", + ["rough-lua.rough.fillers.hachure-filler"] = "rough-lua/rough/fillers/hachure-filler.lua", + ["rough-lua.rough.fillers.zigzag-filler"] = "rough-lua/rough/fillers/zigzag-filler.lua", + ["rough-lua.rough.fillers.zigzag-line-filler"] = "rough-lua/rough/fillers/zigzag-line-filler.lua", + ["rough-lua.rough.fillers.dot-filler"] = "rough-lua/rough/fillers/dot-filler.lua", + ["rough-lua.rough.fillers.dashed-filler"] = "rough-lua/rough/fillers/dashed-filler.lua", + ["rough-lua.rough.fillers.scan-line-hachure"] = "rough-lua/rough/fillers/scan-line-hachure.lua", + ["rough-lua.rough.fillers.hatch-filler"] = "rough-lua/rough/fillers/hatch-filler.lua", + ["rough-lua.rough.fillers.hachure-fill"] = "rough-lua/rough/fillers/hachure-fill.lua", + ["rough-lua.rough.fillers.filler"] = "rough-lua/rough/fillers/filler.lua", + ["rough-lua.rough.geometry"] = "rough-lua/rough/geometry.lua", + ["rough-lua.untested.path-data-parser"] = "rough-lua/untested/path-data-parser/init.lua", + ["rough-lua.untested.path-data-parser.parser"] = "rough-lua/untested/path-data-parser/parser.lua", + ["rough-lua.untested.path-data-parser.normalize"] = "rough-lua/untested/path-data-parser/normalize.lua", + ["rough-lua.untested.path-data-parser.absolutize"] = "rough-lua/untested/path-data-parser/absolutize.lua", + ["rough-lua.untested.points-on-curve"] = "rough-lua/untested/points-on-curve/init.lua", + ["rough-lua.untested.points-on-curve.curve-to-bezier"] = "rough-lua/untested/points-on-curve/curve-to-bezier.lua", + } +}