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

sile-typesetter / sile / 9400953783

06 Jun 2024 12:32PM UTC coverage: 62.819% (-11.3%) from 74.124%
9400953783

push

github

alerque
Merge branch 'develop'

1752 of 2644 new or added lines in 109 files covered. (66.26%)

2019 existing lines in 84 files now uncovered.

10830 of 17240 relevant lines covered (62.82%)

3306.33 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
function package:_init ()
×
7
   base._init(self)
×
8
   if not SILE.languageSupport.languages["x-spaces-are-nodes"] then
×
9
      local xsan = pl.class(SILE.nodeMakers.unicode)
×
10
      function xsan.makeGlue (node, item)
×
11
         node:addToken(" ", item)
×
12
         node:makeToken()
×
13
      end
14
      SILE.nodeMakers["x-spaces-are-nodes"] = xsan
×
15
      SILE.languageSupport.languages["x-spaces-are-nodes"] = true
×
16
   end
17
   if SILE.shaper and not SILE.shaper.noncomplex_SpaceNode then
×
18
      SILE.shaper.noncomplex_SpaceNode = SILE.shaper.makeSpaceNode
×
19
      SILE.shaper.makeSpaceNode = function (_, options, item)
×
20
         if SILE.settings:get("shaper.complexspaces") then
×
21
            local myoptions = pl.tablex.deepcopy(options)
×
22
            myoptions.language = "x-spaces-are-nodes"
×
23
            local nnodes = SILE.shaper:createNnodes(" ", myoptions)
×
NEW
24
            return SILE.types.node.discretionary({ replacement = nnodes })
×
25
         end
26
         return SILE.shaper.noncomplex_SpaceNode(_, options, item)
×
27
      end
28
   end
29
end
30

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

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

49
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