sile-typesetter / sile

The SILE Typesetter — Simon’s Improved Layout Engine
https://sile-typesetter.org
MIT License
1.66k stars 98 forks source link

Something in break.lua broken #1227

Open alerque opened 3 years ago

alerque commented 3 years ago

While overhauling the examples for the SILE site, the gutenberg.sil example does not build. It looks like it might be something in core, not in the example:

SILE v0.11.1 (Lua 5.2)
<examples/gutenberg.sil>
/nix/store/j3v13kmaby3w18sb4g8xdz2qpmarvv66-lua-5.2.4/bin/lua: ...sa5b3l1vsyf3fap678-sile-0.11.1/share/sile/core/break.lua:207: attempt to index field 'length' (a nil value)
stack traceback:
        ...sa5b3l1vsyf3fap678-sile-0.11.1/share/sile/core/break.lua:207: in function 'tryAlternatives'
        ...sa5b3l1vsyf3fap678-sile-0.11.1/share/sile/core/break.lua:228: in function 'considerDemerits'
        ...sa5b3l1vsyf3fap678-sile-0.11.1/share/sile/core/break.lua:144: in function 'tryBreak'
        ...sa5b3l1vsyf3fap678-sile-0.11.1/share/sile/core/break.lua:456: in function 'checkForLegalBreak'
        ...sa5b3l1vsyf3fap678-sile-0.11.1/share/sile/core/break.lua:545: in function 'doBreak'
        ...l1vsyf3fap678-sile-0.11.1/share/sile/core/typesetter.lua:275: in function 'breakIntoLines'
        ...l1vsyf3fap678-sile-0.11.1/share/sile/core/typesetter.lua:317: in function 'boxUpNodes'
        ...b3l1vsyf3fap678-sile-0.11.1/share/sile/packages/bidi.lua:239: in function 'boxUpNodes'
        ...l1vsyf3fap678-sile-0.11.1/share/sile/core/typesetter.lua:566: in function 'leaveHmode'
        ...b3l1vsyf3fap678-sile-0.11.1/share/sile/classes/plain.lua:95: in function '?'
        ...msa5b3l1vsyf3fap678-sile-0.11.1/share/sile/core/sile.lua:309: in function 'call'
        ...3l1vsyf3fap678-sile-0.11.1/share/sile/core/baseclass.lua:279: in function 'finish'
        ...msa5b3l1vsyf3fap678-sile-0.11.1/share/sile/core/sile.lua:319: in function 'finish'
        ...re/rvg4f8m72m3qpmsa5b3l1vsyf3fap678-sile-0.11.1/bin/sile:69: in main chunk
        [C]: in ?
I/O Error: Couldn't open file 'public/examples/gutenberg.pdf': No such file or directory.
Omikhleia commented 2 years ago

N.B. Related to alternatives, which also had other justification issues (#724)

simoncozens commented 2 years ago

In hindsight I think we should probably strip out the alternates code and just have a "pure" Knuth-Plass implementation, with plugins providing alternate breaking implementations (for alternates and variable fonts, newbreak).

alerque commented 2 years ago

Do the 'alternatives' being discussed here have any relation to handling of discressionaries? c.f. #355

simoncozens commented 2 years ago

Nope. Discretionaries are part of the original Knuth-Plass, alternatives was an experiment I was trying to pave the way for variable font support, but I've found a better way to do it.

alerque commented 2 years ago

Roger that. In that case yes, lets just work on making it easy to drop in replacements.