• Etienne Bergeron's avatar
    Allow multiple GetFallbackFont(...) calls for different runs · b2775899
    Etienne Bergeron authored
    This CL has main goal to remove calls to the FontLink (GDI) fallback
    fonts.
    
    ShapeRuns is trying to find fonts to shape runs. There are cases where
    the runs are grouped together but they can be rendered with different
    fonts.
    
    Previously, we were trying to determine the fallback font based on the
    text of the first run, which is arbitrary. We observed cases where this
    is not true.
    
    As an example:
      // The following text will be split in 3 runs:
      //   1) u+1F3F3 u+FE0F u+FE0F  (Segoe UI Emoji)
      //   2) u+0020                 (Segoe UI)
      //   3) u+1F308 u+20E0 u+20E0  (Segoe UI Symbol)
    
    The current CL is adding a loop around GetFallback(...) to find the
    corresponding fallback font for each run using the fast fallback
    mechanism. We believe this may deprecate the usage of the FontLink code.
    
    R=robliao@chromium.org,asvitkine@chromium.org
    CC=​drott@chromium.org
    
    Bug: 995789
    Change-Id: Iced98fa37f20832d7c86c107472e9fb84ec9d277
    Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/1789844Reviewed-by: default avatarAlexei Svitkine <asvitkine@chromium.org>
    Reviewed-by: default avatarDominik Röttsches <drott@chromium.org>
    Reviewed-by: default avatarRobert Liao <robliao@chromium.org>
    Commit-Queue: Etienne Bergeron <etienneb@chromium.org>
    Cr-Commit-Position: refs/heads/master@{#697243}
    b2775899
render_text_harfbuzz.cc 87 KB