Skip to content

"Overeager" glyph search for certain characters breaks fallback in Blink #152

@drott

Description

@drott

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.

  1. The first situation is using the ASCII parentheses instead of a .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.
  2. The second example that showed in Blink tests: ./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's svg/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.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions