Skip to content

Map narrow no-break space and non-breaking hyphen in standard fonts - #1848

Merged
blikblum merged 2 commits into
foliojs:masterfrom
kroplabeskidu:standard-font-spaces-hyphens
Nov 1, 2026
Merged

blikblum merged 2 commits into
foliojs:masterfrom
kroplabeskidu:standard-font-spaces-hyphens

Conversation

@kroplabeskidu

Copy link
Copy Markdown
Contributor

What kind of change does this PR introduce?

Bug fix. Fixes #1071, fixes #1040

Standard fonts write each character code as hex, and a code above 255 turns into two bytes. So U+202F came out as 20 2F, drawn as /, which is what toLocaleString('fr-fr') runs into, and U+2011 as 20 11, drawn as a double space. WinAnsi has no such characters, so they now map to the no-break space and the hyphen. I added U+2010 as well, since it is the same hyphen.

Other characters outside WinAnsi are unchanged. Dropping them would be a separate change, because the Helvetica Bold visual snapshot includes them.

Checklist:

  • Unit Tests
  • Update CHANGELOG.md
  • Ready to be merged

@kroplabeskidu
kroplabeskidu force-pushed the standard-font-spaces-hyphens branch from 82c3e3a to eb94323 Compare November 1, 2026 15:42
@blikblum
blikblum merged commit ca7029a into foliojs:master Nov 1, 2026
3 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Rendering Narrow Non-Breaking Space Problems with unicode non-breaking hyphen

2 participants