• Home
  • Features
  • Pricing
  • Docs
  • Announcements
  • Sign In

sile-typesetter / sile / 14860011647

06 May 2025 12:44PM UTC coverage: 67.057% (+32.5%) from 34.559%
14860011647

push

github

alerque
chore(typesetters): Fixup access to class from typesetter functions

7 of 7 new or added lines in 2 files covered. (100.0%)

1344 existing lines in 103 files now uncovered.

14880 of 22190 relevant lines covered (67.06%)

11549.16 hits per line

Source File
Press 'n' to go to next uncovered line, 'b' for previous

0.0
/packages/complex-spaces/init.lua
1
local base = require("packages.base")
×
2

3
local orig_makeGlue, orig_makeSpaceNode
4

5
local function xsan_makeGlue (node, item)
UNCOV
6
   node:addToken(" ", item)
×
7
   node:makeToken()
×
8
end
9

10
local function xsan_makeSpaceNode (shaper, options, _)
11
   orig_makeGlue = SILE.typesetters.language.nodemaker.makeGlue
×
UNCOV
12
   SILE.typesetters.language.nodemaker.makeGlue = xsan_makeGlue
×
13
   local nnodes = shaper:createNnodes(" ", options)
×
UNCOV
14
   local node = SILE.types.node.discretionary({ replacement = nnodes })
×
UNCOV
15
   SILE.typesetters.language.nodemaker.makeGlue = orig_makeGlue
×
16
   return node
×
17
end
18

19
local function toggle_complexspace_modifications (enable)
20
   if enable then
×
21
      orig_makeSpaceNode = SILE.shaper.makeSpaceNode
×
22
      SILE.shaper.makeSpaceNode = xsan_makeSpaceNode
×
23
   else
24
      SILE.shaper.makeSpaceNode = orig_makeSpaceNode
×
25
   end
26
end
27

28
local package = pl.class(base)
×
29
package._name = "complex-spaces"
×
30

UNCOV
31
function package:declareSettings ()
×
UNCOV
32
   self.settings:declare({
×
33
      parameter = "shaper.complexspaces",
34
      default = true,
35
      type = "boolean",
36
      hook = toggle_complexspace_modifications,
37
      help = "Whether the font's space glyph should be emitted, rather than a glue",
38
   })
39
end
40

41
package.documentation = [[
42
\begin{document}
43
SILE normally assumes that the "space" character in a font is empty, and that it can be replaced with a stretchable and shrinkable space.
44
In some fonts (particularly color fonts), this is not a reliable assumption, and the space character may actually contain ink.
45
Loading this package will allow such space glyphs to be correctly rendered.
46
(At some point in the future, SILE will detect fonts with complex spaces and load this package automatically, but for now it needs to be manually loaded.)
47
\end{document}
UNCOV
48
]]
×
49

UNCOV
50
return package
×
STATUS · Troubleshooting · Open an Issue · Sales · Support · CAREERS · ENTERPRISE · START FREE · SCHEDULE DEMO
ANNOUNCEMENTS · TWITTER · TOS & SLA · Supported CI Services · What's a CI service? · Automated Testing

© 2025 Coveralls, Inc