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

sile-typesetter / sile / 8288578143

14 Mar 2024 09:39PM UTC coverage: 64.155% (-10.6%) from 74.718%
8288578143

Pull #1904

github

alerque
chore(core): Fixup ec6ed657 which didn't shim old pack styles properly
Pull Request #1904: Merge develop into master (commit to next release being breaking)

1648 of 2421 new or added lines in 107 files covered. (68.07%)

1843 existing lines in 77 files now uncovered.

10515 of 16390 relevant lines covered (64.15%)

3306.56 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