Changeset 219422 in webkit


Ignore:
Timestamp:
Jul 12, 2017 1:44:41 PM (7 years ago)
Author:
commit-queue@webkit.org
Message:

[FreeType] Enable BCI on webfonts
https://bugs.webkit.org/show_bug.cgi?id=174403

Patch by Alicia Boya García <aboya@igalia.com> on 2017-07-12
Reviewed by Michael Catanzaro.

The FreeType BCI hinter used to be disabled on webfonts in favor of
the autohinter.

FreeType BCI hinter has improved considerably in the past and now most
other browsers enable it too. Given the old reasons no longer apply,
the BCI has now been enabled in order to get better text rendering when
embedded hints are available.

  • platform/graphics/freetype/FontCustomPlatformDataFreeType.cpp:

(WebCore::FontCustomPlatformData::FontCustomPlatformData):

Location:
trunk/Source/WebCore
Files:
2 edited

Legend:

Unmodified
Added
Removed
  • trunk/Source/WebCore/ChangeLog

    r219421 r219422  
     12017-07-12  Alicia Boya García  <aboya@igalia.com>
     2
     3        [FreeType] Enable BCI on webfonts
     4        https://bugs.webkit.org/show_bug.cgi?id=174403
     5
     6        Reviewed by Michael Catanzaro.
     7
     8        The FreeType BCI hinter used to be disabled on webfonts in favor of
     9        the autohinter.
     10
     11        FreeType BCI hinter has improved considerably in the past and now most
     12        other browsers enable it too. Given the old reasons no longer apply,
     13        the BCI has now been enabled in order to get better text rendering when
     14        embedded hints are available.
     15
     16        * platform/graphics/freetype/FontCustomPlatformDataFreeType.cpp:
     17        (WebCore::FontCustomPlatformData::FontCustomPlatformData):
     18
    1192017-07-12  Commit Queue  <commit-queue@webkit.org>
    220
  • trunk/Source/WebCore/platform/graphics/freetype/FontCustomPlatformDataFreeType.cpp

    r206433 r219422  
    3636
    3737FontCustomPlatformData::FontCustomPlatformData(FT_Face freeTypeFace, SharedBuffer& buffer)
    38     : m_fontFace(cairo_ft_font_face_create_for_ft_face(freeTypeFace, FT_LOAD_FORCE_AUTOHINT))
     38    : m_fontFace(cairo_ft_font_face_create_for_ft_face(freeTypeFace, FT_LOAD_DEFAULT))
    3939{
    40     // FT_LOAD_FORCE_AUTOHINT prohibits use of the font's native hinting. This
    41     // is a safe option for custom fonts because (a) some such fonts may have
    42     // broken hinting, which site admins may not notice if other browsers do not
    43     // use the native hints, and (b) allowing native hints exposes the FreeType
    44     // bytecode interpreter to potentially-malicious input. Treating web fonts
    45     // differently than system fonts is non-ideal, but the result of autohinting
    46     // is always decent, whereas native hints sometimes look terrible, and
    47     // unlike system fonts where Fontconfig may change the hinting settings on a
    48     // per-font basis, the same settings are used for all web fonts. Note that
    49     // Chrome is considering switching from autohinting to native hinting in
    50     // https://code.google.com/p/chromium/issues/detail?id=173207 but this is
    51     // more risk than we want to assume for now. See
    52     // https://bugs.webkit.org/show_bug.cgi?id=140994 before changing this, and
    53     // also consider that (a) the fonts' native hints will all be designed to
    54     // work on Windows, and might not look good at all with FreeType, whereas
    55     // automatic hints will always look decent, and (b) Fontconfig is not
    56     // capable of providing any per-font hinting settings for web fonts, unlike
    57     // for system fonts, so it seems acceptable to treat them differently.
    58 
    5940    buffer.ref(); // This is balanced by the buffer->deref() in releaseCustomFontData.
    6041    static cairo_user_data_key_t bufferKey;
Note: See TracChangeset for help on using the changeset viewer.