2010-10-21 takano takumi <takano1@asia.apple.com>
authormitz@apple.com <mitz@apple.com@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Thu, 21 Oct 2010 18:03:47 +0000 (18:03 +0000)
committermitz@apple.com <mitz@apple.com@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Thu, 21 Oct 2010 18:03:47 +0000 (18:03 +0000)
commitc75adc9f5ba872aff04f96c857561c4241711be4
treef764e9c2942847acf9dacca354706d8db0fc94cb
parent051caff996a98b09fa56d4a0e5436b292935bf01
2010-10-21  takano takumi  <takano1@asia.apple.com>

        Reviewed by Dan Bernstein.

        Need to swap glyphs for vertical writing
        https://bugs.webkit.org/show_bug.cgi?id=46973

        Made changes to pass the writing-mode orientation flag in RenderStyle down to FontPlatformData,
        and ultimately to CoreText APIs in both font complex path and fast path.

        Tests: fast/text/international/vertical-text-glyph-test.html
               fast/text/international/vertical-text-metrics-test.html

        * WebCore.exp.in:
        * WebCore.xcodeproj/project.pbxproj: Added platform/graphics/FontOrientation.h.
        * css/CSSFontFaceSource.cpp:
        (WebCore::CSSFontFaceSource::getFontData): Added font orientation parameter to SimpleFontData.
        * css/CSSStyleSelector.cpp:
        (WebCore::CSSStyleSelector::applyProperty): Set appropriate font orientation to the font description
        when writing-mode is being specified.
        * loader/CachedFont.cpp:
        (WebCore::CachedFont::platformDataFromCustomData): Made to pass font orientation to FontPlatformData.
        * loader/CachedFont.h:
        * platform/graphics/FontCache.cpp: Added font orientation to FontPlatformDataCacheKey
        (WebCore::FontPlatformDataCacheKey::FontPlatformDataCacheKey):
        (WebCore::FontPlatformDataCacheKey::operator==):
        (WebCore::computeHash):
        (WebCore::FontCache::getCachedFontPlatformData):
        * platform/graphics/FontDescription.h: Added font orientation support to FontDescription class
        (WebCore::FontDescription::FontDescription):
        (WebCore::FontDescription::orientation):
        (WebCore::FontDescription::setOrientation):
        (WebCore::FontDescription::operator==):
        * platform/graphics/FontOrientation.h: Added.
        * platform/graphics/SimpleFontData.h:
        * platform/graphics/cairo/FontCustomPlatformData.cpp: Changed to pass font orientation to fontPlatformData()
        (WebCore::FontCustomPlatformData::fontPlatformData):
        * platform/graphics/cairo/FontCustomPlatformData.h: Changed to pass font orientation to fontPlatformData()
        * platform/graphics/cocoa/FontPlatformData.h: Added font orientation support to FontPlatformData class
        (WebCore::FontPlatformData::FontPlatformData):
        (WebCore::FontPlatformData::orientation):
        (WebCore::FontPlatformData::hash):
        (WebCore::FontPlatformData::operator==):
        * platform/graphics/cocoa/FontPlatformDataCocoa.mm: Added font orientation support
        (WebCore::FontPlatformData::FontPlatformData):
        (WebCore::FontPlatformData::operator=):
        (WebCore::FontPlatformData::allowsLigatures): Don't allow ligatures when the font is vertical orientation.
        (WebCore::FontPlatformData::description):
        * platform/graphics/gtk/FontCustomPlatformDataPango.cpp: Changed to pass font orientation to fontPlatformData()
        (WebCore::FontCustomPlatformData::fontPlatformData):
        * platform/graphics/haiku/FontCustomPlatformData.cpp: Changed to pass font orientation to fontPlatformData()
        (WebCore::FontCustomPlatformData::fontPlatformData):
        * platform/graphics/haiku/FontCustomPlatformData.h: Changed to pass font orientation to fontPlatformData()
        * platform/graphics/mac/FontCacheMac.mm: Added font orientation parameter when creating FontPlatformData object.
        (WebCore::FontCache::getFontDataForCharacters):
        (WebCore::FontCache::createFontPlatformData):
        * platform/graphics/mac/FontCustomPlatformData.cpp: Added font orientation parameter when creating FontPlatformData object.
        (WebCore::FontCustomPlatformData::fontPlatformData):
        * platform/graphics/mac/FontCustomPlatformData.h: Changed to pass font orientation parameter to fontPlatformData()
        * platform/graphics/mac/GlyphPageTreeNodeMac.cpp:
        (WebCore::GlyphPage::fill): Changed to use CoreText to extract glyphs when the current font is vertical orientation.
        CoreText automatically swaps glyphs with vertical variants when the font orientation is vertical.
        * platform/graphics/mac/SimpleFontDataCoreText.cpp: Added vertical form attribute to the attribute dictionary for a CTLine.
        (WebCore::SimpleFontData::getCFStringAttributes):
        * platform/graphics/mac/SimpleFontDataMac.mm:
        (WebCore::SimpleFontData::platformBoundsForGlyph): Changed to use CoreText (from CG) to support vertical metrics.
        (WebCore::SimpleFontData::platformWidthForGlyph): Made to use CoreText, instead of wkGetGlyphTransformedAdvances,
        to get vertical metrics when the font orientation is vertical.
        * platform/graphics/qt/FontCustomPlatformData.h: Changed to pass font orientation to fontPlatformData()
        * platform/graphics/qt/FontCustomPlatformDataQt.cpp: Changed to pass font orientation to fontPlatformData()
        (WebCore::FontCustomPlatformData::fontPlatformData):
        * platform/graphics/skia/FontCustomPlatformData.cpp: Changed to pass font orientation to fontPlatformData()
        (WebCore::FontCustomPlatformData::fontPlatformData):
        * platform/graphics/skia/FontCustomPlatformData.h: Changed to pass font orientation to fontPlatformData()
        * platform/graphics/win/FontCustomPlatformData.cpp: Changed to pass font orientation to fontPlatformData()
        (WebCore::FontCustomPlatformData::fontPlatformData):
        * platform/graphics/win/FontCustomPlatformData.h: Changed to pass font orientation to fontPlatformData()
        * platform/graphics/win/FontCustomPlatformDataCairo.cpp: Changed to pass font orientation to fontPlatformData()
        (WebCore::FontCustomPlatformData::fontPlatformData):
        * platform/graphics/win/FontCustomPlatformDataCairo.h: Changed to pass font orientation to fontPlatformData()
        * platform/graphics/wince/FontCustomPlatformData.cpp: Changed to pass font orientation to fontPlatformData()
        (WebCore::FontCustomPlatformData::fontPlatformData):
        * platform/graphics/wince/FontCustomPlatformData.h: Changed to pass font orientation to fontPlatformData()
        * platform/graphics/wx/FontCustomPlatformData.cpp: Changed to pass font orientation to fontPlatformData()
        (WebCore::FontCustomPlatformData::fontPlatformData):
        * platform/graphics/wx/FontCustomPlatformData.h: Changed to pass font orientation to fontPlatformData()

git-svn-id: https://svn.webkit.org/repository/webkit/trunk@70250 268f45cc-cd09-0410-ab3c-d52691b4dbfc
45 files changed:
LayoutTests/ChangeLog
LayoutTests/fast/text/international/vertical-text-glyph-test.html [new file with mode: 0644]
LayoutTests/fast/text/international/vertical-text-metrics-test.html [new file with mode: 0644]
LayoutTests/platform/mac-leopard/fast/text/international/vertical-text-glyph-test-expected.txt [new file with mode: 0644]
LayoutTests/platform/mac-leopard/fast/text/international/vertical-text-metrics-test-expected.txt [new file with mode: 0644]
LayoutTests/platform/mac/fast/text/international/vertical-text-glyph-test-expected.checksum [new file with mode: 0644]
LayoutTests/platform/mac/fast/text/international/vertical-text-glyph-test-expected.png [new file with mode: 0644]
LayoutTests/platform/mac/fast/text/international/vertical-text-glyph-test-expected.txt [new file with mode: 0644]
LayoutTests/platform/mac/fast/text/international/vertical-text-metrics-test-expected.txt [new file with mode: 0644]
WebCore/ChangeLog
WebCore/WebCore.exp.in
WebCore/WebCore.xcodeproj/project.pbxproj
WebCore/css/CSSFontFaceSource.cpp
WebCore/css/CSSStyleSelector.cpp
WebCore/loader/CachedFont.cpp
WebCore/loader/CachedFont.h
WebCore/platform/graphics/FontCache.cpp
WebCore/platform/graphics/FontDescription.h
WebCore/platform/graphics/FontOrientation.h [new file with mode: 0644]
WebCore/platform/graphics/SimpleFontData.h
WebCore/platform/graphics/cairo/FontCustomPlatformData.cpp
WebCore/platform/graphics/cairo/FontCustomPlatformData.h
WebCore/platform/graphics/cocoa/FontPlatformData.h
WebCore/platform/graphics/cocoa/FontPlatformDataCocoa.mm
WebCore/platform/graphics/gtk/FontCustomPlatformDataPango.cpp
WebCore/platform/graphics/haiku/FontCustomPlatformData.cpp
WebCore/platform/graphics/haiku/FontCustomPlatformData.h
WebCore/platform/graphics/mac/FontCacheMac.mm
WebCore/platform/graphics/mac/FontCustomPlatformData.cpp
WebCore/platform/graphics/mac/FontCustomPlatformData.h
WebCore/platform/graphics/mac/GlyphPageTreeNodeMac.cpp
WebCore/platform/graphics/mac/SimpleFontDataCoreText.cpp
WebCore/platform/graphics/mac/SimpleFontDataMac.mm
WebCore/platform/graphics/qt/FontCustomPlatformData.h
WebCore/platform/graphics/qt/FontCustomPlatformDataQt.cpp
WebCore/platform/graphics/skia/FontCustomPlatformData.cpp
WebCore/platform/graphics/skia/FontCustomPlatformData.h
WebCore/platform/graphics/win/FontCustomPlatformData.cpp
WebCore/platform/graphics/win/FontCustomPlatformData.h
WebCore/platform/graphics/win/FontCustomPlatformDataCairo.cpp
WebCore/platform/graphics/win/FontCustomPlatformDataCairo.h
WebCore/platform/graphics/wince/FontCustomPlatformData.cpp
WebCore/platform/graphics/wince/FontCustomPlatformData.h
WebCore/platform/graphics/wx/FontCustomPlatformData.cpp
WebCore/platform/graphics/wx/FontCustomPlatformData.h