• Etienne Bergeron's avatar
    Fix GetFallbackFont(...) when the primary font has styles · f481cbe2
    Etienne Bergeron authored
    The default system font can be changed by the user to has
    styles. If so, the GetFontFallback should try the
    unstyled version.
    
    The primary font was initially tried and failed to Shape
    the runs. The unstyled version returned by
    GetFallbackFont(...) was not tried since the primary font
    has the same name. GetFallbackFonts(...) was able to find
    a candidate, but with an higher cost.
    
    To fix the issue, we keep track of the raw SkTypeface
    that are tried. ShapeRunWithFonts is using the typeface
    to determine the coverage of a run.
    
    This issue was found by adding a DCHECK(false) when
    GetFontFallbacks(...) succeed to find a font. It is also
    observed in the field in the slow-reports.
    
    bug: 995789
    R=robliao@chromium.org
    
    Change-Id: I5b6b7eada35b11306edf0820e5635d5159efdcaf
    Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/1994443Reviewed-by: default avatarRobert Liao <robliao@chromium.org>
    Commit-Queue: Etienne Bergeron <etienneb@chromium.org>
    Cr-Commit-Position: refs/heads/master@{#741491}
    f481cbe2
render_text_harfbuzz.cc 88 KB