• Dominik Röttsches's avatar
    Fix incorrect font used in prefix of run ending in fallback grapheme · 83821ae6
    Dominik Röttsches authored
    When a run ended in a grapheme cluster consisting of a least two
    characters, and this grapheme resulted in not being shaped with the
    current font and needed fallback, then the full run from the beginning
    was incorrectly rendered in the fallback font. This is because one state
    transition between shaped and not shaped was not recognized, as the
    last_change_position had been advanced too far.
    
    To fix this, I clarified the shaping loop and moved the logic for
    commiting glyphs and queueing characters for reshaping into separate
    functions. When reaching the end of the glyph run, transitions between
    shaped or unshaped are detected for the last grapheme cluster and added
    to the ShapeResult or the reshaping queue accordingly.
    
           inspector-protocol/layout-fonts/prefix-fallback-multi-character-grapheme.js
           svg/text/combining-character-queries-expected.svg
    
    Bug: 758380
    Tests: EmojiZWJSequence in HarfBuzzShaperTest.cpp,
    Change-Id: I95d536c488ac602cb4bdfd4e1ac4a729f92b1462
    Reviewed-on: https://chromium-review.googlesource.com/657977
    Commit-Queue: Dominik Röttsches <drott@chromium.org>
    Reviewed-by: default avatarEmil A Eklund <eae@chromium.org>
    Cr-Commit-Position: refs/heads/master@{#504327}
    83821ae6
prefix-fallback-multi-character-grapheme.js 786 Bytes