You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Fix negative token width for glyphs wrapped after a diacritic (#192) (#246)
A word break at a line wrap was suppressed when the preceding glyph was a combining mark, gluing the wrapped glyph onto the previous line's word and giving that token a negative WIDTH. Overriding the suppression on a baseline shift alone proved too broad — accents are drawn raised above their letter, so they shift the baseline on the same line, and ordinary words were split apart ("Álvarez" → "´" + "lvarez"); over the 5,927-PDF GROBID corpus that changed 1,209 files when only 297 had anything to fix. Baseline shift can't separate the two cases (0.24 vs 0.21 median relative to font size), but the horizontal gap can: a combining mark never starts more than 0.79 font sizes left of the word's end, while a wrapped glyph restarts at the left margin and reaches −67. The suppression is now overridden only when both hold — baseline shifted and sp < -fontSize. This PR also merges the duplicated classifyChar tables, which had drifted so that U+00B0 DEGREE SIGN counted as a combining mark in one live call site but not the other, running axis labels together as "0°0", "°20°4" instead of "0°", "20°". Result across the full corpus: negative widths 536 → 37, 394 files changed (vs 1,209), +905 tokens (vs +12,591), no crashes or unparseable output.
0 commit comments