-
Notifications
You must be signed in to change notification settings - Fork 608
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
"Overeager" glyph search for certain characters breaks fallback in Blink #152
Comments
Sounds like you're allowing harfbuzz to use compatibility decompositions. IMO, that's generally not desirable for text shaping; it will lead to a lot of undesirable substitutions. I'd recommend setting up unicode callbacks that provide ONLY canonical (de)compositions. |
You need to disable the compatibility decomposition Unicode function. |
I had argued that HarfBuzz shouldn’t even try to do compatibility decomposition in the first place, it almost always results in the wrong glyph, but it is hidden in most big clients as they do fallback before shaping. |
Thanks @khaledhosny for taking a look so quickly. Would you perhaps have some more instructions on how I would do that? Blink's Or do I need to change compile time options to prevent HarfBuzz from doing that? |
Blink does not seem to call |
Great, yes - I just started browsing HarfBuzz' code and was getting somewhere near. Thanks for the pointers, I'll try that in Blink. Closing the issue for now. Thanks for your help. |
Sorry about this. Yes, I need to disable the compat stuff... Will do this time. |
When working on shaper driven run segmentation in Blink I am observing a few situations in which the shaper seems to be a bit overeager in finding a renderable character.
.notdef
for the fullwidth parentheses:./hb-shape --shapers=ot /Library/Fonts/Times\ New\ Roman.ttf``../test/shaping/hb-unicode-encode U+FF08
results in[parenleft=0+682]
. In CJK texts that leads to slightly broken spacing, since for example the fallback chain has Times first, then a CJK font. HarfBuzz will render the parentheses with Times, then the CJK text with the fallback font, leading to uneven spacing and a suboptimal mix of fonts. If HarfBuzz would just give up here and return.notdef
, the fonts would not be mixed, leading to a more pleasant appearance../hb-shape --shapers=ot /Library/Fonts/Arial.ttf 𝒞
results in[C=0+1479]
- so the mathematical script C is converted to a Latin capital C. In Blink'ssvg/text/non-bmp-positioning-lists.svg
layout test however, the mathematical script is expected and was previously shown due to functioning system fallback for such symbols.The text was updated successfully, but these errors were encountered: