question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

[ttx] cmap format 13 not merged correctly

See original GitHub issue

Cf. https://twitter.com/fr_brennan/status/1560057391684763649 Related commit https://github.com/MFEK/Mienai.ttf/commit/e1d99216b75274deaa58cea0ae610d07446c4f39

I fixed it by temporarily overwriting the _IsInSameRun function:

class cmap_format_13(cmap_format_12_or_13):

    _format_step = 0

    def __init__(self, format=13):
        cmap_format_12_or_13.__init__(self, format)

    def _computeGIDs(self, startingGlyph, numberOfGlyphs):
        return [startingGlyph] * numberOfGlyphs

    def _IsInSameRun(self, glyphID, lastGlyphID, charCode, lastCharCode):
        return (glyphID == lastGlyphID)

I don’t know if this is the right fix in general, or just for Mienai. Please advise.

Thanks @kenlunde for his help.

Issue Analytics

  • State:open
  • Created a year ago
  • Comments:10 (10 by maintainers)

github_iconTop GitHub Comments

1reaction
anthrotypecommented, Aug 22, 2022

feel free to propose a PR to support that – but which doesn’t break backward compat

1reaction
behdadcommented, Aug 18, 2022

If you want format13 to cover everything you need to list everything in ttx. That’s inconvenient, I know.

That is, you need to have all one million different entries in your ttx file.

Read more comments on GitHub >

github_iconTop Results From Across the Web

cmap table that maps a code point to GID 0 #2031 - GitHub
The font cmunrm.otf has a format 4 cmap subtable that map U+0000 to GID 0, and this seems to cause hb_face_collect_unicodes() to include...
Read more >
OpenType Specification Change Log - Microsoft Learn
Changed spellings of field names of ConditionFormat1 table. cmap. For platform ID 0, encoding ID 3, removed suggestion of using format 0 ...
Read more >
fonttools · PyPI
fontTools is a library for manipulating fonts, written in Python. The project includes the TTX tool, that can convert TrueType and OpenType fonts...
Read more >
Diff - platform/external/fonttools - Google Git
+- TTX is now the name of the XML-based *format* for TT fonts, and not just ... +- added cmap format 6 support...
Read more >
ttx — fontTools Documentation - Read the Docs
Once installed you can use the ttx command to convert binary font files (.otf, .ttf, etc) to the TTX XML format, edit them,...
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found