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
{{ message }}
Repository navigation
Multiface fonts supported in load but not range #125
Fonts with multiple faces are supported by looping over each face and accessing the number of faces once a valid FT_Face object is available. Like we do here:
We've never properly supported multiface fonts, IIRC because we couldn't find a suitable test fixture when originally writing this. There's a catch in the fontmachine downstream implementation to prevent calling RangeAsync so I don't think we would ever hit this case in production.
That said, yes, this is likely a copy/paste error for an edge case we haven't properly tested/supported. I'm not clear on why it would infinite loop inside RenderSDF though, is there anything else different about this test fixture aside from multiple faces? Can you tell where inside RenderSDF its looping?
There's a catch in the fontmachine downstream implementation to prevent calling RangeAsync so I don't think we would ever hit this case in production.
Great. If downstream users have been throwing on multiface fonts then we've been isolated from the bug (of not reading them all) in RangeAsync.
Testing with a multiface font (ttc): current node-fontnik master goes into an infinite loop in RenderSDF in RangeAsync.
False alarm. Further profiling shows that it is actually not an infinite loop, but rather just extremely slow execution. I was running in debug mode. Processing this ttc takes over 3 minutes with bin/build-glyphs, which is crazy. This font seems to have more data, but such slow processing is still worrysome.
Activity
springmeyer commentedon Nov 22, 2016
Testing with a multiface font (ttc): current node-fontnik
mastergoes into an infinite loop inRenderSDFinRangeAsync.mikemorris commentedon Nov 22, 2016
We've never properly supported multiface fonts, IIRC because we couldn't find a suitable test fixture when originally writing this. There's a catch in the
fontmachinedownstream implementation to prevent callingRangeAsyncso I don't think we would ever hit this case in production.That said, yes, this is likely a copy/paste error for an edge case we haven't properly tested/supported. I'm not clear on why it would infinite loop inside
RenderSDFthough, is there anything else different about this test fixture aside from multiple faces? Can you tell where insideRenderSDFits looping?springmeyer commentedon Nov 22, 2016
Great. If downstream users have been throwing on multiface fonts then we've been isolated from the bug (of not reading them all) in RangeAsync.
False alarm. Further profiling shows that it is actually not an infinite loop, but rather just extremely slow execution. I was running in debug mode. Processing this ttc takes over 3 minutes with
bin/build-glyphs, which is crazy. This font seems to have more data, but such slow processing is still worrysome.I good, freely available, ttc testcase is https://github.com/googlei18n/noto-fonts/blob/master/hinted/NotoSans-Regular.ttc which just takes 5s to process (still in Debug mode).
solve #123, #124, and #125
jcary741 commentedon Oct 13, 2026
Closing as stale.