• Etienne Bergeron's avatar
    Implement the GetFontList using DWrite instead of GDI API. · 326e11b2
    Etienne Bergeron authored
    This CL is modifying the font-settings API on Windows.
    
    The goal of this CL is to remove the
    gfx::PlatformFontWin::GetLocalizedFontName(...) calls since
    the gfx::PlatformFontWin will be replaced by
    gfx::PlatformFontSkia.
    
    The GDI API was listing the system fonts by using the system
    locale which means the font-name was the localized name.
    The DWrite API allows the caller to specify the locale and is
    not forced to be the system one.
    
    The font-settings API is shipping a list of pair of string to
    extensions when the GetList is called
    (e.g fontId and displayName).
    
    The fontId is used as an identifier for other font-settings API.
    The DisplayName is the name that is displayed to the user.
    
    On windows, both string were used to be the Localized name since
    the GDI API was returning the localized name. A extra conversion
    was needed when an other windows API returns a non-localized name
    to be sure it will be the same FontID.
    
    By enforcing fontId to be non-localized, these extra conversion
    are now useless. And only the displayName is localized.
    
    Bug: 944227
    
    Change-Id: Iab1bff832504fbf9abc8860ece31357148c01cee
    Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/1606661
    Commit-Queue: Etienne Bergeron <etienneb@chromium.org>
    Reviewed-by: default avatarEtienne Bergeron <etienneb@chromium.org>
    Reviewed-by: default avatarRobert Liao <robliao@chromium.org>
    Reviewed-by: default avatarAvi Drissman <avi@chromium.org>
    Reviewed-by: default avatarAlexei Svitkine <asvitkine@chromium.org>
    Reviewed-by: default avatarKoji Ishii <kojii@chromium.org>
    Reviewed-by: default avatarMatt Falkenhagen <falken@chromium.org>
    Cr-Commit-Position: refs/heads/master@{#662886}
    326e11b2
font_list_win.cc 2.36 KB