Changeset 62121 in webkit


Ignore:
Timestamp:
Jun 29, 2010 8:01:23 AM (14 years ago)
Author:
agl@chromium.org
Message:

2010-06-29 Adam Langley <agl@chromium.org>

Reviewed by Kent Tamura.

[chromium] Support forced autohinting.

https://bugs.webkit.org/show_bug.cgi?id=40493

Freetype (the typical font rendering on Linux) includes an 'autohinter':
an algorithm for hinting glyph shapes without using the embedded hinting
bytecode in a font.

Some people prefer the autohinter's results, so we support forcing its
use.

This change also fixes a bug where two FontPlatformData structures would
compare equal, even if their rendering styles were different.

  • platform/graphics/chromium/FontPlatformDataLinux.cpp: (WebCore::FontPlatformData::setupPaint): In order to compare FontPlatformData structures we need to make sure that they are initialised. (WebCore::FontPlatformData::operator==):
  • platform/graphics/chromium/FontRenderStyle.h: (WebCore::FontRenderStyle::FontRenderStyle): (WebCore::FontRenderStyle::operator==): This fixes the case where two FontPlatformData structures, differing only by rendering style, would compare equal.
Location:
trunk
Files:
8 edited

Legend:

Unmodified
Added
Removed
  • trunk/LayoutTests/ChangeLog

    r62117 r62121  
     12010-06-29  Adam Langley  <agl@chromium.org>
     2
     3        Reviewed by Kent Tamura.
     4
     5        [chromium] Support forced autohinting.
     6
     7        https://bugs.webkit.org/show_bug.cgi?id=40493
     8
     9        Freetype (the typical font rendering on Linux) includes an 'autohinter':
     10        an algorithm for hinting glyph shapes without using the embedded hinting
     11        bytecode in a font.
     12
     13        This amends the existing tests for fontconfig settings to test that
     14        setting autohinting works, and that it works in the face of also
     15        setting 'hintfull'.
     16
     17        * platform/chromium-linux/platform/chromium/fast/text/chromium-linux-fontconfig-renderstyle-expected.checksum:
     18        * platform/chromium-linux/platform/chromium/fast/text/chromium-linux-fontconfig-renderstyle-expected.png:
     19        * platform/chromium-linux/platform/chromium/fast/text/chromium-linux-fontconfig-renderstyle-expected.txt:
     20        * platform/chromium/fast/text/chromium-linux-fontconfig-renderstyle.html:
     21
    1222010-06-29  Mikhail Naganov  <mnaganov@chromium.org>
    223
  • trunk/LayoutTests/platform/chromium-linux/platform/chromium/fast/text/chromium-linux-fontconfig-renderstyle-expected.checksum

    r61948 r62121  
    1 0724a0d048b168716737edd97826266f
     15a3c29af0d1c8b8ddc95b91673e2e007
  • trunk/LayoutTests/platform/chromium-linux/platform/chromium/fast/text/chromium-linux-fontconfig-renderstyle-expected.txt

    r56800 r62121  
    1919          text run at (718,0) width 32: "in the"
    2020          text run at (0,20) width 89: "following tests."
    21       RenderBlock {OL} at (0,56) size 784x235
     21      RenderBlock {OL} at (0,56) size 784x399
    2222        RenderListItem {LI} at (40,0) size 744x55
    2323          RenderBlock {P} at (0,0) size 744x20
     
    2626              text run at (0,0) width 318: "The following text should render without anti-aliasing:"
    2727          RenderBlock {P} at (0,36) size 744x19
    28             RenderText {#text} at (0,0) size 154x18
    29               text run at (0,0) width 154: "Non anti-aliased sans."
     28            RenderText {#text} at (0,0) size 158x18
     29              text run at (0,0) width 158: "Non anti-aliased sans."
    3030        RenderListItem {LI} at (40,71) size 744x74
    3131          RenderBlock {P} at (0,0) size 744x40
     
    5151              text run at (0,0) width 444: "Here is Tigger doing what tiggers do best \x{2026} operating "
    5252              text run at (444,0) width 188: "hydraulic exoskeletons."
     53        RenderListItem {LI} at (40,251) size 744x56
     54          RenderBlock {P} at (0,0) size 744x20
     55            RenderListMarker at (-21,0) size 16x19: "4"
     56            RenderText {#text} at (0,0) size 595x19
     57              text run at (0,0) width 374: "The following text should show a difference caused by forcing "
     58              text run at (374,0) width 221: "autohinting. Note: the effect is subtle."
     59          RenderBlock {P} at (0,36) size 744x20
     60            RenderInline {SPAN} at (0,0) size 48x13
     61              RenderText {#text} at (0,5) size 48x13
     62                text run at (0,5) width 48: "autohinted"
     63            RenderText {#text} at (48,0) size 4x19
     64              text run at (48,0) width 4: " "
     65            RenderInline {I} at (0,0) size 14x19
     66              RenderText {#text} at (52,0) size 14x19
     67                text run at (52,0) width 14: "vs"
     68            RenderText {#text} at (66,0) size 4x19
     69              text run at (66,0) width 4: " "
     70            RenderInline {SPAN} at (0,0) size 69x13
     71              RenderText {#text} at (70,5) size 69x13
     72                text run at (70,5) width 69: "not-autohinted"
     73        RenderListItem {LI} at (40,323) size 744x76
     74          RenderBlock {P} at (0,0) size 744x40
     75            RenderListMarker at (-21,0) size 16x19: "5"
     76            RenderText {#text} at (0,0) size 512x19
     77              text run at (0,0) width 512: "The following text should be the same. It verifies that, given the contradictory settings "
     78            RenderInline {TT} at (0,0) size 64x16
     79              RenderText {#text} at (512,3) size 64x16
     80                text run at (512,3) width 64: "hintfull"
     81            RenderText {#text} at (576,0) size 30x19
     82              text run at (576,0) width 30: " and "
     83            RenderInline {TT} at (0,0) size 64x16
     84              RenderText {#text} at (606,3) size 64x16
     85                text run at (606,3) width 64: "autohint"
     86            RenderText {#text} at (670,0) size 730x39
     87              text run at (670,0) width 60: ", the latter"
     88              text run at (0,20) width 53: "wins out:"
     89          RenderBlock {P} at (0,56) size 744x20
     90            RenderInline {SPAN} at (0,0) size 48x13
     91              RenderText {#text} at (0,5) size 48x13
     92                text run at (0,5) width 48: "autohinted"
     93            RenderText {#text} at (48,0) size 4x19
     94              text run at (48,0) width 4: " "
     95            RenderInline {I} at (0,0) size 14x19
     96              RenderText {#text} at (52,0) size 14x19
     97                text run at (52,0) width 14: "vs"
     98            RenderText {#text} at (66,0) size 4x19
     99              text run at (66,0) width 4: " "
     100            RenderInline {SPAN} at (0,0) size 92x13
     101              RenderText {#text} at (70,5) size 92x13
     102                text run at (70,5) width 92: "hopefully autohinted"
  • trunk/LayoutTests/platform/chromium/fast/text/chromium-linux-fontconfig-renderstyle.html

    r56800 r62121  
    3030        </p>
    3131      </li>
     32
     33      <li>
     34        <p>The following text should show a difference caused by forcing
     35        autohinting. Note: the effect is subtle.</p>
     36
     37        <p><span style="font-family:AutohintedSerif; font-size:0.6em;">autohinted</span> <i>vs</i> <span style="font-family:HintedSerif; font-size:0.6em;">not-autohinted</span></p>
     38      </li>
     39
     40      <li>
     41        <p>The following text should be the same. It verifies that, given the contradictory settings <tt>hintfull</tt> and <tt>autohint</tt>, the latter wins out:</p>
     42
     43        <p><span style="font-family:AutohintedSerif; font-size:0.6em;">autohinted</span> <i>vs</i> <span style="font-family:FullAndAutoHintedSerif; font-size:0.6em;">hopefully autohinted</span></p>
     44      </li>
    3245    </ol>
    3346  </body>
  • trunk/WebCore/ChangeLog

    r62120 r62121  
     12010-06-29  Adam Langley  <agl@chromium.org>
     2
     3        Reviewed by Kent Tamura.
     4
     5        [chromium] Support forced autohinting.
     6
     7        https://bugs.webkit.org/show_bug.cgi?id=40493
     8
     9        Freetype (the typical font rendering on Linux) includes an 'autohinter':
     10        an algorithm for hinting glyph shapes without using the embedded hinting
     11        bytecode in a font.
     12
     13        Some people prefer the autohinter's results, so we support forcing its
     14        use.
     15
     16        This change also fixes a bug where two FontPlatformData structures would
     17        compare equal, even if their rendering styles were different.
     18
     19        * platform/graphics/chromium/FontPlatformDataLinux.cpp:
     20        (WebCore::FontPlatformData::setupPaint):
     21          In order to compare FontPlatformData structures we need to make sure
     22          that they are initialised.
     23        (WebCore::FontPlatformData::operator==):
     24        * platform/graphics/chromium/FontRenderStyle.h:
     25        (WebCore::FontRenderStyle::FontRenderStyle):
     26        (WebCore::FontRenderStyle::operator==):
     27          This fixes the case where two FontPlatformData structures, differing
     28          only by rendering style, would compare equal.
     29
    1302010-06-29  Laszlo Gombos  <laszlo.1.gombos@nokia.com>
    231
  • trunk/WebCore/platform/graphics/chromium/FontPlatformDataLinux.cpp

    r60477 r62121  
    149149    paint->setFakeBoldText(m_fakeBold);
    150150    paint->setTextSkewX(m_fakeItalic ? -SK_Scalar1 / 4 : 0);
     151    paint->setAutohinting(m_style.useAutoHint);
    151152
    152153    if (m_style.useAntiAlias == 1 || (m_style.useAntiAlias == FontRenderStyle::NoPreference && isSkiaAntiAlias))
     
    176177        && m_textSize == a.m_textSize
    177178        && m_fakeBold == a.m_fakeBold
    178         && m_fakeItalic == a.m_fakeItalic;
     179        && m_fakeItalic == a.m_fakeItalic
     180        && m_style == a.m_style;
    179181}
    180182
  • trunk/WebCore/platform/graphics/chromium/FontRenderStyle.h

    r55089 r62121  
    4040    };
    4141
     42    FontRenderStyle()
     43        : useBitmaps(0),
     44          useAutoHint(0),
     45          useHinting(0),
     46          hintStyle(0),
     47          useAntiAlias(0),
     48          useSubpixel(0) { }
     49
     50    bool operator==(const FontRenderStyle& a) const
     51    {
     52        return useBitmaps == a.useBitmaps
     53            && useAutoHint == a.useAutoHint
     54            && useHinting == a.useHinting
     55            && hintStyle == a.hintStyle
     56            && useAntiAlias == a.useAntiAlias
     57            && useSubpixel == a.useSubpixel;
     58    }
     59
    4260    // Each of the use* members below can take one of three values:
    4361    //   0: off
Note: See TracChangeset for help on using the changeset viewer.