Repository navigation
More robust overhang - #8131
More robust overhang#8131
Conversation
This should be tested, but current test runner has specific version of Noto Serif SC without such substituion. Code for future test is under the spoiler below (adapted from original issue). See typst/typst-dev-assets#18. Test case |
|
@sicikh Since there is still an unresolved review comment: Do you still plan to work on this? |
# Conflicts: # tests/ref/pdf/hashes.txt # tests/ref/svg/hashes.txt
|
Sorry for the delay! I've answered to the review comment: #8131 (comment). In short, we really need to compute overhang table with data from the glyph's font, so obvious optimization is to memoize it, which is done in d39d1aa. |
ac2fe22 to
eb4ff25
Compare
There is not need to check the advance width since trimmed glyphs are excluded in `Deref for Glyphs`
|
Thanks! |
This comment was marked as resolved.
This comment was marked as resolved.
93 commits novos desde v0.15.1 (tag 9dfd3a0) até upstream/main (a51e028). 397 ficheiros alterados, 5782 inserções, 2831 remoções. Destaques do upstream: - Store required features in bindings (typst#8599) - Support raw serialization format for typst eval (typst#8295) - Add diagnostics-format environment variable (typst#8438) - More robust overhang (typst#8131) - Fix logical indices of hyphens with respect to surrounding tags (typst#8714) - Bump krilla and hayro (typst#8716) - Fix line breaking for hosts starting with a digit (typst#8039) - Fix auto hanging-indent for heading numbering (typst#7247) Build vanilla verificado: cargo build ok (3m02s).
93 commits novos desde v0.15.1 (tag 9dfd3a0) até upstream/main (a51e028). 397 ficheiros alterados, 5782 inserções, 2831 remoções. Destaques do upstream: - Store required features in bindings (typst#8599) - Support raw serialization format for typst eval (typst#8295) - Add diagnostics-format environment variable (typst#8438) - More robust overhang (typst#8131) - Fix logical indices of hyphens with respect to surrounding tags (typst#8714) - Bump krilla and hayro (typst#8716) - Fix line breaking for hosts starting with a digit (typst#8039) - Fix auto hanging-indent for heading numbering (typst#7247) Build vanilla verificado: cargo build ok (3m02s).
Continues work of #7376.
Closes #7219, closes #8130. Also closes #6735 (see below).
For more info, see #7376 (comment).
New change, not included in the #7376 and what is resolving #6735:
When a glyph is shaped, its first character (
glyph.c) may differ from the expected character (for example,sym.wj + sym.dash.emresults in a glyph in whichglyph.cis equal to\u{2060}). In this example, the old function-based implementation, which checks only theglyph.c, cannot verify that a particular character is a em-dash, and thus disables overhang for it. And vice versa, with font that substitutes multiple characters with different glyph,glyph.ccan be misleading — two em-dashes in Noto Serif SC are substituted with U+2E3A, which should not be overhang, whileglyph.cis the first em-dash, which causes the whole glyph to overhang (even with the wrong ratio!).To solve this problem, each character in the overhang table is mapped to a glyph id in the glyph font, and only then are these ids compared to check if we should enable overhang.