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

sile-typesetter / sile / 14390735465

10 Apr 2025 09:30PM UTC coverage: 34.559% (-31.7%) from 66.23%
14390735465

push

github

alerque
Merge tag 'v0.15.12' into develop

4 of 4 new or added lines in 3 files covered. (100.0%)

4064 existing lines in 73 files now uncovered.

6918 of 20018 relevant lines covered (34.56%)

2597.26 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 package = pl.class(base)
×
4
package._name = "complex-spaces"
×
5

6
local makeSpaceNode = function (self, options, item)
7
   if SILE.settings:get("shaper.complexspaces") then
×
8
      local myoptions = pl.tablex.deepcopy(options)
×
9
      myoptions.language = "x-spaces-are-nodes"
×
10
      local nnodes = self:createNnodes(" ", myoptions)
×
11
      return SILE.types.node.discretionary({ replacement = nnodes })
×
12
   end
UNCOV
13
   return self:noncomplex_SpaceNode(options, item)
×
14
end
15

UNCOV
16
function package:_init ()
×
17
   base._init(self)
×
18
   if not SILE.languageSupport.languages["x-spaces-are-nodes"] then
×
19
      local xsan = pl.class(SILE.nodeMakers.unicode)
×
20
      function xsan.makeGlue (node, item)
×
21
         node:addToken(" ", item)
×
22
         node:makeToken()
×
23
      end
24
      SILE.nodeMakers["x-spaces-are-nodes"] = xsan
×
UNCOV
25
      SILE.languageSupport.languages["x-spaces-are-nodes"] = true
×
26
   end
UNCOV
27
   if SILE.shaper and not SILE.shaper.noncomplex_SpaceNode then
×
UNCOV
28
      SILE.shaper.noncomplex_SpaceNode = SILE.shaper.makeSpaceNode
×
UNCOV
29
      SILE.shaper.makeSpaceNode = makeSpaceNode
×
30
   end
31
end
32

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

42
package.documentation = [[
43
\begin{document}
44
SILE normally assumes that the "space" character in a font is empty, and that it can be replaced with a stretchable and shrinkable space.
45
In some fonts (particularly color fonts), this is not a reliable assumption, and the space character may actually contain ink.
46
Loading this package will allow such space glyphs to be correctly rendered.
47
(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.)
48
\end{document}
49
]]
×
50

UNCOV
51
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

© 2026 Coveralls, Inc