Changeset 172504 in webkit


Ignore:
Timestamp:
Aug 12, 2014 4:13:18 PM (10 years ago)
Author:
mmaxfield@apple.com
Message:

Fonts forced to use non synthetic italics might be laid out with the incorrect baseline
https://bugs.webkit.org/show_bug.cgi?id=135403

Reviewed by Darin Adler.

Source/WebCore:

When italics is specified on a font, and the font isn't coming from the cache, we ask
the SimpleFontData to provide a non-synthetic-italic version of itself. Our current
implementation doesn't preserve whether or not the SimpleFontData includes vertical
glyphs (glyphs that are not rotated when drawn in the vertical writing mode), which
determines which baseline we use to lay out the text. By passing "false" to
the isTextOrientationFallback argument to SimpleFontData::create(), we preserve this
hasVerticalGlyphs flag.

Test: fast/text/international/synthesized-italic-vertical-latin-double.html

  • platform/graphics/SimpleFontData.cpp:

(WebCore::SimpleFontData::nonSyntheticItalicFontData):

  • testing/Internals.cpp:

(WebCore::Internals::invalidateFontCache): Add "invalidateFontCache" to window.internals.

  • testing/Internals.h: Ditto.
  • testing/Internals.idl: Ditto.

LayoutTests:

Laying out the same string twice (where there is a cache collision) should be rendered
the same as laying out similar strings (where there is no cache collision).

  • fast/text/international/synthesized-italic-vertical-latin-double-expected.html: Added.
  • fast/text/international/synthesized-italic-vertical-latin-double.html: Added.
Location:
trunk
Files:
2 added
6 edited

Legend:

Unmodified
Added
Removed
  • trunk/LayoutTests/ChangeLog

    r172496 r172504  
     12014-08-12  Myles C. Maxfield  <mmaxfield@apple.com>
     2
     3        Fonts forced to use non synthetic italics might be laid out with the incorrect baseline
     4        https://bugs.webkit.org/show_bug.cgi?id=135403
     5
     6        Reviewed by Darin Adler.
     7
     8        Laying out the same string twice (where there is a cache collision) should be rendered
     9        the same as laying out similar strings (where there is no cache collision).
     10
     11        * fast/text/international/synthesized-italic-vertical-latin-double-expected.html: Added.
     12        * fast/text/international/synthesized-italic-vertical-latin-double.html: Added.
     13
    1142014-08-12  Renata Hodovan  <rhodovan.u-szeged@partner.samsung.com>
    215
  • trunk/Source/WebCore/ChangeLog

    r172503 r172504  
     12014-08-12  Myles C. Maxfield  <mmaxfield@apple.com>
     2
     3        Fonts forced to use non synthetic italics might be laid out with the incorrect baseline
     4        https://bugs.webkit.org/show_bug.cgi?id=135403
     5
     6        Reviewed by Darin Adler.
     7
     8        When italics is specified on a font, and the font isn't coming from the cache, we ask
     9        the SimpleFontData to provide a non-synthetic-italic version of itself. Our current
     10        implementation doesn't preserve whether or not the SimpleFontData includes vertical
     11        glyphs (glyphs that are not rotated when drawn in the vertical writing mode), which
     12        determines which baseline we use to lay out the text. By passing "false" to
     13        the isTextOrientationFallback argument to SimpleFontData::create(), we preserve this
     14        hasVerticalGlyphs flag.
     15
     16        Test: fast/text/international/synthesized-italic-vertical-latin-double.html
     17
     18        * platform/graphics/SimpleFontData.cpp:
     19        (WebCore::SimpleFontData::nonSyntheticItalicFontData):
     20        * testing/Internals.cpp:
     21        (WebCore::Internals::invalidateFontCache): Add "invalidateFontCache" to window.internals.
     22        * testing/Internals.h: Ditto.
     23        * testing/Internals.idl: Ditto.
     24
    1252014-08-12  Peyton Randolph  <prandolph@apple.com>
    226
  • trunk/Source/WebCore/platform/graphics/SimpleFontData.cpp

    r170774 r172504  
    243243        nonSyntheticItalicFontPlatformData.m_syntheticOblique = false;
    244244#endif
    245         m_derivedFontData->nonSyntheticItalic = create(nonSyntheticItalicFontPlatformData, isCustomFont(), false, true);
     245        m_derivedFontData->nonSyntheticItalic = create(nonSyntheticItalicFontPlatformData, isCustomFont());
    246246    }
    247247    return m_derivedFontData->nonSyntheticItalic;
  • trunk/Source/WebCore/testing/Internals.cpp

    r171660 r172504  
    4848#include "EventHandler.h"
    4949#include "ExceptionCode.h"
     50#include "FontCache.h"
    5051#include "FormController.h"
    5152#include "FrameLoader.h"
     
    819820}
    820821
     822void Internals::invalidateFontCache()
     823{
     824    fontCache().invalidate();
     825}
     826
    821827void Internals::setScrollViewPosition(long x, long y, ExceptionCode& ec)
    822828{
  • trunk/Source/WebCore/testing/Internals.h

    r171660 r172504  
    135135    void setMarkedTextMatchesAreHighlighted(bool, ExceptionCode&);
    136136
     137    void invalidateFontCache();
     138
    137139    void setScrollViewPosition(long x, long y, ExceptionCode&);
    138140    void setPagination(const String& mode, int gap, ExceptionCode& ec) { setPagination(mode, gap, 0, ec); }
  • trunk/Source/WebCore/testing/Internals.idl

    r171660 r172504  
    8585    [RaisesException] void setMarkedTextMatchesAreHighlighted(boolean flag);
    8686
     87    void invalidateFontCache();
     88
    8789    [RaisesException] void setScrollViewPosition(long x, long y);
    8890
Note: See TracChangeset for help on using the changeset viewer.