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

sile-typesetter / sile / 14335207249

08 Apr 2025 01:46PM UTC coverage: 60.462% (+0.9%) from 59.535%
14335207249

push

github

web-flow
Merge pull request #2257 from alerque/lintery

98 of 147 new or added lines in 46 files covered. (66.67%)

1 existing line in 1 file now uncovered.

13061 of 21602 relevant lines covered (60.46%)

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

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
×
25
      SILE.languageSupport.languages["x-spaces-are-nodes"] = true
×
26
   end
27
   if SILE.shaper and not SILE.shaper.noncomplex_SpaceNode then
×
28
      SILE.shaper.noncomplex_SpaceNode = SILE.shaper.makeSpaceNode
×
NEW
29
      SILE.shaper.makeSpaceNode = makeSpaceNode
×
30
   end
31
end
32

NEW
33
function package:declareSettings ()
×
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

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