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.

Noto Sans CJK support

See original GitHub issue

I notice a few bugs (#188, #139) citing Chinese is not supported. Fair enough, but do you know of any JS libraries supporting CJK? (I came across https://github.com/kekee000/fonteditor-core some time ago, but found it a bit buggy… and writing a new ttf very difficult to achieve without understanding everything about ttf).

This fault raises how all the otf fonts generated for the CJK project (https://github.com/googlei18n/noto-cjk) all seem to have glyph issues, particularly reporting ‘unknown operator’ errors, eg:

Glyph 14336: unknown operator 2 Glyph 15196: unknown operator 0 Glyph 15254: unknown operator 16

when reading the glyph’s CFF path.

The error’s source seems to be in parseCFFCharstring line 4258.

This is a sample otf that is failing: https://github.com/googlei18n/noto-cjk/blob/master/NotoSansTC-Light.otf

As I was trying to assist in generating this report, I looked up the referenced link in the source (https://www.microsoft.com/typography/OTSPEC/charstr2.htm), to find information about these operators… but all 3 are listed as --Reserved–, which I realise is very unhelpful indeed, although https://www.microsoft.com/typography/otspec/cff2.htm#section13 does hint at operator#16 being a ‘blend’ operator:

D5. CharString Data

Type 2 CharStrings must not contain a value for width: a CFF2 table does not contain any CharString width data.

The CharString operator set is extended in the CFF 2 format to include the vsindex and blend operators. These work as described above in section 13. OpenType Font Variations Extensions, but have different operator codes. The CharString operator code for blend is 16, and 15 for vsindex.

For CFF2 tables, the fill rule for CharStrings must always be the nonzero winding number rule, rather than the even-odd rule. This is required for Font Variations support, as CFF 2 variable fonts will have glyphs with paths that overlap. Even for Western fonts, it is difficult to design source master fonts that are blend-compatible without overlap; for ideographic fonts, this is prohibitively difficult.

(I’m not sure how helpful at all this last information is)

Issue Analytics

  • State:open
  • Created 7 years ago
  • Reactions:3
  • Comments:7 (3 by maintainers)

github_iconTop GitHub Comments

7reactions
fdbcommented, Apr 25, 2017

I’ve added support for CID-keyed fonts in 0.7.0 and I don’t get the parsing bugs anymore for NotoSansTC-Light.otf.

screen shot 2017-04-25 at 14 34 36

@edouard-lopez perhaps you want to do some additional testing and let me know if we can close this issue? The previewer at opentype.js.org is updated to the latest version.

2reactions
fdbcommented, Apr 26, 2017

Thanks, though the credit mostly goes to @tshinnic who did the bulk of the work. 😄

Read more comments on GitHub >

github_iconTop Results From Across the Web

Use Noto fonts - Google Fonts
Noto supports more than 77,000 characters — nearly all non-CJK characters included in the Unicode ... The Noto Sans fonts are best suitable...
Read more >
Noto Sans CJK JP - Adobe Fonts
Fonts in the Adobe Fonts library include support for many different languages, OpenType features, and typographic styles. Learn more about language support.
Read more >
Does "noto sans" font support Chinese language? #53 - GitHub
Google fonts and the Noto fonts project are not the same. 'Noto Sans' is the latin (and greek and cyrillic) noto font. The...
Read more >
Noto: A CJK Font That is Complete, Beautiful and Right for ...
In addition to ideographic characters, Noto Sans CJK also supports Japanese kana and Korean Hangeul—both contemporary and archaic. Google and ...
Read more >
Looking for Noto? It's now on the Google Fonts website and API
The previously-supported scripts of Looped Thai, Rashi Hebrew, Traditional Nushu, and Serif Tamil Slanted all have new designs. Noto Sans CJK is ...
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