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

sile-typesetter / sile / 15507594683

07 Jun 2025 11:54AM UTC coverage: 30.951% (-30.4%) from 61.309%
15507594683

push

github

alerque
chore(tooling): Add post-checkout hook to clear makedeps on branch switch

6363 of 20558 relevant lines covered (30.95%)

3445.44 hits per line

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

0.0
/languages/fr/init.lua
1
--- French language rules
2
-- @submodule languages
3
local unicode = require("languages.unicode")
×
4

5
local language = pl.class(unicode)
×
6
language._name = "fr"
×
7

8
function language:setupNodeMaker ()
×
9
   self.nodemaker = require("languages.fr.nodemaker")
×
10
end
11

12
function language:declareSettings ()
×
13
   local function computeSpaces ()
14
      -- Computes:
15
      --  -  regular inter-word space,
16
      --  -  half inter-word fixed space,
17
      --  -  "guillemet space", as defined in LaTeX's babel-french which is based
18
      --     on Thierry Bouche's recommendations,
19
      --  These should be usual for France and Canada. The Swiss may prefer a thin
20
      --  space for guillemets, that's why we are having settings hereafter.
21
      local enlargement = self.settings:get("shaper.spaceenlargementfactor")
×
22
      local stretch = self.settings:get("shaper.spacestretchfactor")
×
23
      local shrink = self.settings:get("shaper.spaceshrinkfactor")
×
24
      return {
×
25
         colonspace = SILE.types.length(enlargement .. "spc plus " .. stretch .. "spc minus " .. shrink .. "spc"),
26
         thinspace = SILE.types.length((0.5 * enlargement) .. "spc"),
27
         guillspace = SILE.types.length(
×
28
            (0.8 * enlargement) .. "spc plus " .. (0.3 * stretch) .. "spc minus " .. (0.8 * shrink) .. "spc"
×
29
         ),
×
30
      }
31
   end
32

33
   -- TODO add hooks tot he relevant settings computed here to update these values
34
   local spaces = computeSpaces()
×
35
   -- NOTE: We are only doing it at load time. We don't expect the shaper settings to be often
36
   -- changed arbitrarily _after_ having selected a language...
37
   self.settings:declare({
×
38
      parameter = "languages.fr.colonspace",
39
      type = "kern",
40
      default = SILE.types.node.kern(spaces.colonspace),
41
      help = "The amount of space before a colon, theoretically a non-breakable, shrinkable, stretchable inter-word space",
42
   })
43

44
   self.settings:declare({
×
45
      parameter = "languages.fr.thinspace",
46
      type = "kern",
47
      default = SILE.types.node.kern(spaces.thinspace),
48
      help = "The amount of space before high punctuations, theoretically a fixed, non-breakable space, around half the inter-word space",
49
   })
50

51
   self.settings:declare({
×
52
      parameter = "languages.fr.guillspace",
53
      type = "kern",
54
      default = SILE.types.node.kern(spaces.guillspace),
55
      help = "The amount of space applying to guillemets, theoretically smaller than a non-breakable inter-word space, with reduced stretchability",
56
   })
57

58
   self.settings:declare({
×
59
      parameter = "languages.fr.debugspace",
60
      type = "boolean",
61
      default = false,
62
      help = "If switched to true, uses large spaces instead of the regular punctuation ones",
63
   })
64
end
65

66
return language
×
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