Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Scrambled rendering with NotoSansTC-Regular.otf #273

Closed
edouard-lopez opened this issue Mar 31, 2017 · 7 comments
Closed

Scrambled rendering with NotoSansTC-Regular.otf #273

edouard-lopez opened this issue Mar 31, 2017 · 7 comments
Labels

Comments

@edouard-lopez
Copy link

edouard-lopez commented Mar 31, 2017

related: #243, notofonts/noto-cjk#81
block: parlr/ruby-font-creator#29

I met rendering problems when using text-to-svg (shrhdk/text-to-svg#22, shrhdk/text-to-svg#23) with the NotoSansTC-Regular.otf.
Drilling down it appears text-to-svg is based on opentype.js.

Expected

This is for reference, I find that DroidSansFallbackFull.ttf worked fine.

key value
font DroidSansFallbackFull.ttf
text 㐅㐆丰wǔyǐnfēng

DroidSansFallbackFull.ttf using opentype.js

Actual (with NotoSans)

I tested on opentype.js online demo and the result is scramble too (see below):

key value
font NotoSansTC-Regular.otf
text 㐅㐆丰wǔyǐnfēng

NotoSansTC-Regular.otf using opentype.js

@edouard-lopez edouard-lopez changed the title Scrambled renderind with NotoSansTC-Regular.otf Scrambled rendering with NotoSansTC-Regular.otf Mar 31, 2017
@brawer
Copy link
Collaborator

brawer commented Apr 10, 2017

The same font renders fine with FontView so this looks like a problem of OpenType.js.

@edouard-lopez
Copy link
Author

Noto Serif has been released on April 2017 but still has the issue. From googlei18n/noto-cjk#81 the issue come from OpenType.js.

Could you give some feedback?

@brawer
Copy link
Collaborator

brawer commented Apr 10, 2017

Same for Noto Serif — the font renders fine with FontView (which is just a GUI wrapper around HarfBuzz and FreeType), so this looks like a bug in OpenType.js. If someone figures out what exactly is triggering this bug, would you mind contributing a test font (with just 2 glyphs) to Unicode? If you send a pull request to Unicode’s text rendering test suite and accept Unicode’s contributor license agreement, I’ll gladly add a test case that uses your font. By doing this, you will help to make all OpenType implementations towards more compliant with the spec.

image

@fdb
Copy link
Contributor

fdb commented Apr 10, 2017

It seems the advanceWidth values are messed up. I'll try to figure out why.

@fdb
Copy link
Contributor

fdb commented Apr 10, 2017

It seems like this is a CID-keyed font, which we do not yet have support for. I'll see what I can do.

@brawer
Copy link
Collaborator

brawer commented Apr 10, 2017

Indeed, OpenType.js runs into the same problem with this test font:

image

Instead, it should look like this.

@fdb
Copy link
Contributor

fdb commented Apr 25, 2017

We now parse CID-keyed fonts correctly!

screen shot 2017-04-25 at 14 29 07

The new version 0.7.0 includes the fix (with a big thanks to @tshinnic for the initial implementation).

@fdb fdb closed this as completed Apr 25, 2017
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

4 participants