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

sile-typesetter / sile / 9307175333

30 May 2024 06:08PM UTC coverage: 70.644% (-3.5%) from 74.124%
9307175333

push

github

web-flow
Merge b18390e74 into 70ff5c335

1910 of 2592 new or added lines in 108 files covered. (73.69%)

901 existing lines in 52 files now uncovered.

12203 of 17274 relevant lines covered (70.64%)

6112.16 hits per line

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

20.0
/typesetters/firstfit.lua
1
local base = require("typesetters.base")
1✔
2

3
local typesetter = pl.class(base)
1✔
4
typesetter._name = "firstfit"
1✔
5

6
function typesetter:breakIntoLines (nl, breakWidth)
1✔
7
   local breaks = {}
×
NEW
8
   local length = SILE.types.length()
×
9
   for i = 1, #nl do
×
10
      local n = nl[i]
×
11
      if n.is_box then
×
NEW
12
         SU.debug("break", n, function ()
×
NEW
13
            return n:lineContribution()
×
14
         end)
15
         length = length + n:lineContribution()
×
NEW
16
         SU.debug("break", " Length now ", length, "breakwidth", breakWidth)
×
17
      end
18
      if not n.is_box or n.isHangable then
×
19
         SU.debug("break", n)
×
20
         if n.is_glue then
×
21
            length = length + n.width:absolute()
×
22
         end
NEW
23
         SU.debug("break", " Length now ", length, " breakwidth ", breakWidth)
×
24
         -- Can we break?
25
         if length:tonumber() >= breakWidth:tonumber() then
×
26
            SU.debug("break", "Breaking!")
×
27
            breaks[#breaks + 1] = { position = i, width = breakWidth }
×
NEW
28
            length = SILE.types.length()
×
29
         end
30
      end
31
   end
32
   breaks[#breaks + 1] = { position = #nl, width = breakWidth }
×
33
   return self:breakpointsToLines(breaks)
×
34
end
35

36
return typesetter
1✔
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