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

sile-typesetter / sile / 9507147410

13 Jun 2024 09:40PM UTC coverage: 50.521% (-18.7%) from 69.177%
9507147410

push

github

web-flow
Merge pull request #2062 from alerque/plug-fluent-leak

Link document.language setting more closely with Fluent locale

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

3244 existing lines in 65 files now uncovered.

8586 of 16995 relevant lines covered (50.52%)

4659.09 hits per line

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

0.0
/packages/unichar/init.lua
UNCOV
1
local base = require("packages.base")
×
2

UNCOV
3
local package = pl.class(base)
×
UNCOV
4
package._name = "unichar"
×
5

UNCOV
6
function package:registerCommands ()
×
UNCOV
7
   self:registerCommand("unichar", function (_, content)
×
UNCOV
8
      local cp = content[1]
×
UNCOV
9
      if type(cp) ~= "string" then
×
10
         SU.error("Bad argument to \\unicode")
×
11
      end
UNCOV
12
      local hlist = SILE.typesetter.state.nodes
×
UNCOV
13
      local char = SU.utf8charfromcodepoint(cp)
×
14
      if
UNCOV
15
         #hlist > 1
×
UNCOV
16
         and hlist[#hlist].is_unshaped
×
UNCOV
17
         and pl.tablex.deepcompare(hlist[#hlist].options, SILE.font.loadDefaults({}))
×
18
      then
19
         -- Stack character with a preceeding unshaped node if its font is the
20
         -- same as the current one, so that combining characters (e.g. diacritics)
21
         -- and kerning works with \unichar'ed code points too.
UNCOV
22
         hlist[#hlist].text = hlist[#hlist].text .. char
×
23
      else
UNCOV
24
         SILE.typesetter:typeset(char)
×
25
      end
26
   end)
27
end
28

29
package.documentation = [[
30
\begin{document}
31
\use[module=packages.unichar]
32
SILE is Unicode compatible, and expects its input files to be in the UTF-8 encoding.
33
(The actual range of Unicode characters supported will depend on the supported ranges of the fonts that SILE is using to typeset.)
34
Some Unicode characters are hard to locate on a standard keyboard, and so are difficult to enter into SILE documents.
35

36
The \autodoc:package{unichar} package helps with this problem by providing the \autodoc:command{\unichar} command to enter Unicode codepoints.
37

38
\begin[type=autodoc:codeblock]{raw}
39
\unichar{U+263A}
40
\end{raw}
41

42
This produces: \font[family=Symbola]{\unichar{U+263A}}
43

44
If the argument to \autodoc:command{\unichar} begins with \code{U+}, \code{u+}, \code{0x}, or \code{0X}, then it is assumed to be a hexadecimal value.
45
Otherwise it is assumed to be a decimal codepoint.
46
\end{document}
UNCOV
47
]]
×
48

UNCOV
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