Changeset 80582 in webkit


Ignore:
Timestamp:
Mar 8, 2011 12:53:58 PM (13 years ago)
Author:
hyatt@apple.com
Message:

https://bugs.webkit.org/show_bug.cgi?id=48540, support the text-orientation CSS property.

Reviewed by Dan Bernstein.

This patch adds support for two values of the text-orientation property (the ones that actually matter): vertical-right and upright.
The TextOrientation is part of the FontDescription and used to look up fonts (similar to FontOrientation).

Orientation of non-CJK characters is done using fallback font data of the appropriate orientation type, e.g., verticalRightOrientation and
uprightOrientation fallback font data. Vertical right is just implemented as a normal horizontal font. Upright is implemented as a
vertically oriented font that rotates all glyphs.

The main complication implementing text-orientation is that fonts have "baked-in" vertical glyphs for letters that are hardcoded to
a vertical right facing. This means that you can use those special vertical glyphs for vertical-right orientation without having to
fall back, but then for upright orientation you have to ignore them and still fall back. As you can see from the test case, this doesn't
work very well, but hopefully it won't be all that common. Limitations of CoreText prevent this case from rendering properly in either the
simple or complex code paths, although the simple code path at least gets close.

Added fast/blockflow/text-orientation-basic.html

Source/WebCore:

  • WebCore.exp.in:
  • WebCore.xcodeproj/project.pbxproj:
  • css/CSSComputedStyleDeclaration.cpp:

(WebCore::CSSComputedStyleDeclaration::getPropertyCSSValue):

  • css/CSSFontFaceSource.cpp:

(WebCore::CSSFontFaceSource::getFontData):

  • css/CSSParser.cpp:

(WebCore::CSSParser::parseValue):

  • css/CSSPrimitiveValueMappings.h:

(WebCore::CSSPrimitiveValue::CSSPrimitiveValue):
(WebCore::CSSPrimitiveValue::operator TextOrientation):

  • css/CSSPropertyNames.in:
  • css/CSSStyleSelector.cpp:

(WebCore::CSSStyleSelector::applyDeclarations):
(WebCore::CSSStyleSelector::applyProperty):

  • css/CSSValueKeywords.in:
  • loader/cache/CachedFont.cpp:

(WebCore::CachedFont::platformDataFromCustomData):

  • loader/cache/CachedFont.h:
  • platform/graphics/FontCache.cpp:

(WebCore::FontPlatformDataCacheKey::FontPlatformDataCacheKey):
(WebCore::FontPlatformDataCacheKey::operator==):
(WebCore::computeHash):
(WebCore::FontCache::getCachedFontPlatformData):

  • platform/graphics/FontDescription.h:

(WebCore::FontDescription::FontDescription):
(WebCore::FontDescription::textOrientation):
(WebCore::FontDescription::setTextOrientation):
(WebCore::FontDescription::operator==):

  • platform/graphics/FontFastPath.cpp:

(WebCore::Font::glyphDataForCharacter):
(WebCore::offsetToMiddleOfGlyph):

  • platform/graphics/SimpleFontData.cpp:

(WebCore::SimpleFontData::SimpleFontData):
(WebCore::SimpleFontData::verticalRightOrientationFontData):
(WebCore::SimpleFontData::uprightOrientationFontData):
(WebCore::SimpleFontData::brokenIdeographFontData):
(WebCore::SimpleFontData::DerivedFontData::~DerivedFontData):

  • platform/graphics/SimpleFontData.h:

(WebCore::SimpleFontData::hasVerticalGlyphs):
(WebCore::SimpleFontData::isTextOrientationFallback):

  • platform/graphics/cairo/FontCustomPlatformData.h:
  • platform/graphics/cocoa/FontPlatformData.h:

(WebCore::FontPlatformData::FontPlatformData):
(WebCore::FontPlatformData::textOrientation):
(WebCore::FontPlatformData::hash):
(WebCore::FontPlatformData::operator==):

  • platform/graphics/cocoa/FontPlatformDataCocoa.mm:

(WebCore::FontPlatformData::FontPlatformData):
(WebCore::FontPlatformData::operator=):

  • platform/graphics/freetype/FontCustomPlatformDataFreeType.cpp:

(WebCore::FontCustomPlatformData::fontPlatformData):

  • platform/graphics/haiku/FontCustomPlatformData.cpp:

(WebCore::FontCustomPlatformData::fontPlatformData):

  • platform/graphics/haiku/FontCustomPlatformData.h:
  • platform/graphics/mac/ComplexTextControllerCoreText.cpp:

(WebCore::ComplexTextController::collectComplexTextRunsForCharactersCoreText):

  • platform/graphics/mac/FontCacheMac.mm:

(WebCore::FontCache::createFontPlatformData):

  • platform/graphics/mac/FontCustomPlatformData.cpp:

(WebCore::FontCustomPlatformData::fontPlatformData):

  • platform/graphics/mac/FontCustomPlatformData.h:
  • platform/graphics/mac/FontMac.mm:

(WebCore::showGlyphsWithAdvances):
(WebCore::Font::drawGlyphs):

  • platform/graphics/mac/GlyphPageTreeNodeMac.cpp:

(WebCore::shouldUseCoreText):
(WebCore::GlyphPage::fill):

  • platform/graphics/mac/SimpleFontDataCoreText.cpp:

(WebCore::SimpleFontData::getCFStringAttributes):

  • platform/graphics/mac/SimpleFontDataMac.mm:

(WebCore::SimpleFontData::platformInit):
(WebCore::SimpleFontData::platformBoundsForGlyph):
(WebCore::SimpleFontData::platformWidthForGlyph):

  • platform/graphics/pango/FontCustomPlatformDataPango.cpp:

(WebCore::FontCustomPlatformData::fontPlatformData):

  • platform/graphics/qt/FontCustomPlatformData.h:
  • platform/graphics/qt/FontCustomPlatformDataQt.cpp:

(WebCore::FontCustomPlatformData::fontPlatformData):

  • platform/graphics/skia/FontCustomPlatformData.cpp:

(WebCore::FontCustomPlatformData::fontPlatformData):

  • platform/graphics/skia/FontCustomPlatformData.h:
  • platform/graphics/win/FontCustomPlatformData.cpp:

(WebCore::FontCustomPlatformData::fontPlatformData):

  • platform/graphics/win/FontCustomPlatformData.h:
  • platform/graphics/win/FontCustomPlatformDataCairo.cpp:

(WebCore::FontCustomPlatformData::fontPlatformData):

  • platform/graphics/win/FontCustomPlatformDataCairo.h:
  • platform/graphics/wince/FontCustomPlatformData.cpp:

(WebCore::FontCustomPlatformData::fontPlatformData):

  • platform/graphics/wince/FontCustomPlatformData.h:
  • platform/text/TextOrientation.h: Added.
  • rendering/InlineFlowBox.cpp:

(WebCore::InlineFlowBox::requiresIdeographicBaseline):

  • rendering/style/RenderStyle.h:

(WebCore::InheritedFlags::initialTextOrientation):

LayoutTests:

  • fast/blockflow/text-orientation-basic.html: Added.
  • platform/mac/fast/blockflow/text-orientation-basic-expected.checksum: Added.
  • platform/mac/fast/blockflow/text-orientation-basic-expected.png: Added.
  • platform/mac/fast/blockflow/text-orientation-basic-expected.txt: Added.
Location:
trunk
Files:
5 added
45 edited

Legend:

Unmodified
Added
Removed
  • trunk/LayoutTests/ChangeLog

    r80579 r80582  
     12011-03-08  David Hyatt  <hyatt@apple.com>
     2
     3        Reviewed by Dan Bernstein.
     4
     5        https://bugs.webkit.org/show_bug.cgi?id=48540, support the text-orientation CSS property.
     6       
     7        This patch adds support for two values of the text-orientation property (the ones that actually matter): vertical-right and upright.
     8        The TextOrientation is part of the FontDescription and used to look up fonts (similar to FontOrientation).
     9       
     10        Orientation of non-CJK characters is done using fallback font data of the appropriate orientation type, e.g., verticalRightOrientation and
     11        uprightOrientation fallback font data.  Vertical right is just implemented as a normal horizontal font.  Upright is implemented as a
     12        vertically oriented font that rotates all glyphs.
     13       
     14        The main complication implementing text-orientation is that fonts have "baked-in" vertical glyphs for letters that are hardcoded to
     15        a vertical right facing.  This means that you can use those special vertical glyphs for vertical-right orientation without having to
     16        fall back, but then for upright orientation you have to ignore them and still fall back.  As you can see from the test case, this doesn't
     17        work very well, but hopefully it won't be all that common.  Limitations of CoreText prevent this case from rendering properly in either the
     18        simple or complex code paths, although the simple code path at least gets close.
     19
     20        Added fast/blockflow/text-orientation-basic.html
     21
     22        * fast/blockflow/text-orientation-basic.html: Added.
     23        * platform/mac/fast/blockflow/text-orientation-basic-expected.checksum: Added.
     24        * platform/mac/fast/blockflow/text-orientation-basic-expected.png: Added.
     25        * platform/mac/fast/blockflow/text-orientation-basic-expected.txt: Added.
     26
    1272011-03-08  Nico Weber  <thakis@chromium.org>
    228
  • trunk/Source/WebCore/ChangeLog

    r80580 r80582  
     12011-03-08  David Hyatt  <hyatt@apple.com>
     2
     3        Reviewed by Dan Bernstein.
     4
     5        https://bugs.webkit.org/show_bug.cgi?id=48540, support the text-orientation CSS property.
     6       
     7        This patch adds support for two values of the text-orientation property (the ones that actually matter): vertical-right and upright.
     8        The TextOrientation is part of the FontDescription and used to look up fonts (similar to FontOrientation).
     9       
     10        Orientation of non-CJK characters is done using fallback font data of the appropriate orientation type, e.g., verticalRightOrientation and
     11        uprightOrientation fallback font data.  Vertical right is just implemented as a normal horizontal font.  Upright is implemented as a
     12        vertically oriented font that rotates all glyphs.
     13       
     14        The main complication implementing text-orientation is that fonts have "baked-in" vertical glyphs for letters that are hardcoded to
     15        a vertical right facing.  This means that you can use those special vertical glyphs for vertical-right orientation without having to
     16        fall back, but then for upright orientation you have to ignore them and still fall back.  As you can see from the test case, this doesn't
     17        work very well, but hopefully it won't be all that common.  Limitations of CoreText prevent this case from rendering properly in either the
     18        simple or complex code paths, although the simple code path at least gets close.
     19
     20        Added fast/blockflow/text-orientation-basic.html
     21
     22        * WebCore.exp.in:
     23        * WebCore.xcodeproj/project.pbxproj:
     24        * css/CSSComputedStyleDeclaration.cpp:
     25        (WebCore::CSSComputedStyleDeclaration::getPropertyCSSValue):
     26        * css/CSSFontFaceSource.cpp:
     27        (WebCore::CSSFontFaceSource::getFontData):
     28        * css/CSSParser.cpp:
     29        (WebCore::CSSParser::parseValue):
     30        * css/CSSPrimitiveValueMappings.h:
     31        (WebCore::CSSPrimitiveValue::CSSPrimitiveValue):
     32        (WebCore::CSSPrimitiveValue::operator TextOrientation):
     33        * css/CSSPropertyNames.in:
     34        * css/CSSStyleSelector.cpp:
     35        (WebCore::CSSStyleSelector::applyDeclarations):
     36        (WebCore::CSSStyleSelector::applyProperty):
     37        * css/CSSValueKeywords.in:
     38        * loader/cache/CachedFont.cpp:
     39        (WebCore::CachedFont::platformDataFromCustomData):
     40        * loader/cache/CachedFont.h:
     41        * platform/graphics/FontCache.cpp:
     42        (WebCore::FontPlatformDataCacheKey::FontPlatformDataCacheKey):
     43        (WebCore::FontPlatformDataCacheKey::operator==):
     44        (WebCore::computeHash):
     45        (WebCore::FontCache::getCachedFontPlatformData):
     46        * platform/graphics/FontDescription.h:
     47        (WebCore::FontDescription::FontDescription):
     48        (WebCore::FontDescription::textOrientation):
     49        (WebCore::FontDescription::setTextOrientation):
     50        (WebCore::FontDescription::operator==):
     51        * platform/graphics/FontFastPath.cpp:
     52        (WebCore::Font::glyphDataForCharacter):
     53        (WebCore::offsetToMiddleOfGlyph):
     54        * platform/graphics/SimpleFontData.cpp:
     55        (WebCore::SimpleFontData::SimpleFontData):
     56        (WebCore::SimpleFontData::verticalRightOrientationFontData):
     57        (WebCore::SimpleFontData::uprightOrientationFontData):
     58        (WebCore::SimpleFontData::brokenIdeographFontData):
     59        (WebCore::SimpleFontData::DerivedFontData::~DerivedFontData):
     60        * platform/graphics/SimpleFontData.h:
     61        (WebCore::SimpleFontData::hasVerticalGlyphs):
     62        (WebCore::SimpleFontData::isTextOrientationFallback):
     63        * platform/graphics/cairo/FontCustomPlatformData.h:
     64        * platform/graphics/cocoa/FontPlatformData.h:
     65        (WebCore::FontPlatformData::FontPlatformData):
     66        (WebCore::FontPlatformData::textOrientation):
     67        (WebCore::FontPlatformData::hash):
     68        (WebCore::FontPlatformData::operator==):
     69        * platform/graphics/cocoa/FontPlatformDataCocoa.mm:
     70        (WebCore::FontPlatformData::FontPlatformData):
     71        (WebCore::FontPlatformData::operator=):
     72        * platform/graphics/freetype/FontCustomPlatformDataFreeType.cpp:
     73        (WebCore::FontCustomPlatformData::fontPlatformData):
     74        * platform/graphics/haiku/FontCustomPlatformData.cpp:
     75        (WebCore::FontCustomPlatformData::fontPlatformData):
     76        * platform/graphics/haiku/FontCustomPlatformData.h:
     77        * platform/graphics/mac/ComplexTextControllerCoreText.cpp:
     78        (WebCore::ComplexTextController::collectComplexTextRunsForCharactersCoreText):
     79        * platform/graphics/mac/FontCacheMac.mm:
     80        (WebCore::FontCache::createFontPlatformData):
     81        * platform/graphics/mac/FontCustomPlatformData.cpp:
     82        (WebCore::FontCustomPlatformData::fontPlatformData):
     83        * platform/graphics/mac/FontCustomPlatformData.h:
     84        * platform/graphics/mac/FontMac.mm:
     85        (WebCore::showGlyphsWithAdvances):
     86        (WebCore::Font::drawGlyphs):
     87        * platform/graphics/mac/GlyphPageTreeNodeMac.cpp:
     88        (WebCore::shouldUseCoreText):
     89        (WebCore::GlyphPage::fill):
     90        * platform/graphics/mac/SimpleFontDataCoreText.cpp:
     91        (WebCore::SimpleFontData::getCFStringAttributes):
     92        * platform/graphics/mac/SimpleFontDataMac.mm:
     93        (WebCore::SimpleFontData::platformInit):
     94        (WebCore::SimpleFontData::platformBoundsForGlyph):
     95        (WebCore::SimpleFontData::platformWidthForGlyph):
     96        * platform/graphics/pango/FontCustomPlatformDataPango.cpp:
     97        (WebCore::FontCustomPlatformData::fontPlatformData):
     98        * platform/graphics/qt/FontCustomPlatformData.h:
     99        * platform/graphics/qt/FontCustomPlatformDataQt.cpp:
     100        (WebCore::FontCustomPlatformData::fontPlatformData):
     101        * platform/graphics/skia/FontCustomPlatformData.cpp:
     102        (WebCore::FontCustomPlatformData::fontPlatformData):
     103        * platform/graphics/skia/FontCustomPlatformData.h:
     104        * platform/graphics/win/FontCustomPlatformData.cpp:
     105        (WebCore::FontCustomPlatformData::fontPlatformData):
     106        * platform/graphics/win/FontCustomPlatformData.h:
     107        * platform/graphics/win/FontCustomPlatformDataCairo.cpp:
     108        (WebCore::FontCustomPlatformData::fontPlatformData):
     109        * platform/graphics/win/FontCustomPlatformDataCairo.h:
     110        * platform/graphics/wince/FontCustomPlatformData.cpp:
     111        (WebCore::FontCustomPlatformData::fontPlatformData):
     112        * platform/graphics/wince/FontCustomPlatformData.h:
     113        * platform/text/TextOrientation.h: Added.
     114        * rendering/InlineFlowBox.cpp:
     115        (WebCore::InlineFlowBox::requiresIdeographicBaseline):
     116        * rendering/style/RenderStyle.h:
     117        (WebCore::InheritedFlags::initialTextOrientation):
     118
    11192011-03-08  Ryosuke Niwa  <rniwa@webkit.org>
    2120
  • trunk/Source/WebCore/WebCore.exp.in

    r80559 r80582  
    422422__ZN7WebCore16DeviceMotionData6createEN3WTF10PassRefPtrINS0_12AccelerationEEES4_NS2_INS0_12RotationRateEEEbd
    423423__ZN7WebCore16FontFallbackList15releaseFontDataEv
    424 __ZN7WebCore16FontPlatformDataC1EP6NSFontfbbNS_15FontOrientationENS_16FontWidthVariantE
     424__ZN7WebCore16FontPlatformDataC1EP6NSFontfbbNS_15FontOrientationENS_15TextOrientationENS_16FontWidthVariantE
    425425__ZN7WebCore16FontPlatformDataD1Ev
    426426__ZN7WebCore16HTMLInputElement13setAutofilledEb
  • trunk/Source/WebCore/WebCore.xcodeproj/project.pbxproj

    r80536 r80582  
    51625162                BCD0FBD00DBD625E00B2F630 /* DOMAbstractView.mm in Sources */ = {isa = PBXBuildFile; fileRef = BCD0FBCF0DBD625E00B2F630 /* DOMAbstractView.mm */; };
    51635163                BCD0FC4F0DBD720B00B2F630 /* DOMRGBColorInternal.h in Headers */ = {isa = PBXBuildFile; fileRef = BCD0FC4E0DBD720B00B2F630 /* DOMRGBColorInternal.h */; };
     5164                BCD3F9831326C93700098A60 /* TextOrientation.h in Headers */ = {isa = PBXBuildFile; fileRef = BCD3F9821326C93700098A60 /* TextOrientation.h */; settings = {ATTRIBUTES = (Private, ); }; };
    51645165                BCD41ABB0C060DE800C0E446 /* JSHTMLFrameSetElementCustom.cpp in Sources */ = {isa = PBXBuildFile; fileRef = BCD41ABA0C060DE800C0E446 /* JSHTMLFrameSetElementCustom.cpp */; };
    51655166                BCD533640ED6848900887468 /* CachedScriptSourceProvider.h in Headers */ = {isa = PBXBuildFile; fileRef = BCD533630ED6848900887468 /* CachedScriptSourceProvider.h */; };
     
    1154911550                BCD0FBCF0DBD625E00B2F630 /* DOMAbstractView.mm */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.objcpp; path = DOMAbstractView.mm; sourceTree = "<group>"; };
    1155011551                BCD0FC4E0DBD720B00B2F630 /* DOMRGBColorInternal.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = DOMRGBColorInternal.h; sourceTree = "<group>"; };
     11552                BCD3F9821326C93700098A60 /* TextOrientation.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = TextOrientation.h; sourceTree = "<group>"; };
    1155111553                BCD41ABA0C060DE800C0E446 /* JSHTMLFrameSetElementCustom.cpp */ = {isa = PBXFileReference; fileEncoding = 30; lastKnownFileType = sourcecode.cpp.cpp; path = JSHTMLFrameSetElementCustom.cpp; sourceTree = "<group>"; };
    1155211554                BCD533630ED6848900887468 /* CachedScriptSourceProvider.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = CachedScriptSourceProvider.h; sourceTree = "<group>"; };
     
    1767717679                                B2C3DA180D006C1D00EF6F26 /* TextEncodingRegistry.cpp */,
    1767817680                                B2C3DA190D006C1D00EF6F26 /* TextEncodingRegistry.h */,
     17681                                BCD3F9821326C93700098A60 /* TextOrientation.h */,
    1767917682                                B2C3DA1A0D006C1D00EF6F26 /* TextStream.cpp */,
    1768017683                                B2C3DA1B0D006C1D00EF6F26 /* TextStream.h */,
     
    2256922572                                598D77DF132541FA00761B22 /* JavaArrayJSC.h in Headers */,
    2257022573                                598D77E31325420E00761B22 /* JavaFieldJSC.h in Headers */,
     22574                                BCD3F9831326C93700098A60 /* TextOrientation.h in Headers */,
    2257122575                        );
    2257222576                        runOnlyForDeploymentPostprocessing = 0;
  • trunk/Source/WebCore/css/CSSComputedStyleDeclaration.cpp

    r80463 r80582  
    229229    CSSPropertyWebkitTextEmphasisStyle,
    230230    CSSPropertyWebkitTextFillColor,
     231    CSSPropertyWebkitTextOrientation,
    231232    CSSPropertyWebkitTextSecurity,
    232233    CSSPropertyWebkitTextStrokeColor,
     
    16341635        case CSSPropertyWebkitTextCombine:
    16351636            return primitiveValueCache->createValue(style->textCombine());
     1637        case CSSPropertyWebkitTextOrientation:
     1638            return CSSPrimitiveValue::create(style->fontDescription().textOrientation());
    16361639
    16371640        case CSSPropertyContent:
  • trunk/Source/WebCore/css/CSSFontFaceSource.cpp

    r77153 r80582  
    116116
    117117    // See if we have a mapping in our FontData cache.
    118     unsigned hashKey = (fontDescription.computedPixelSize() + 1) << 5 | fontDescription.widthVariant() << 3 | (fontDescription.orientation() == Vertical ? 4 : 0) | (syntheticBold ? 2 : 0) | (syntheticItalic ? 1 : 0);
     118    unsigned hashKey = (fontDescription.computedPixelSize() + 1) << 6 | fontDescription.widthVariant() << 4
     119                       | (fontDescription.textOrientation() == TextOrientationUpright ? 8 : 0) | (fontDescription.orientation() == Vertical ? 4 : 0) | (syntheticBold ? 2 : 0) | (syntheticItalic ? 1 : 0);
    119120    if (SimpleFontData* cachedData = m_fontDataTable.get(hashKey))
    120121        return cachedData;
     
    163164                    return 0;
    164165
    165                 fontData.set(new SimpleFontData(m_font->platformDataFromCustomData(fontDescription.computedPixelSize(), syntheticBold, syntheticItalic, fontDescription.orientation(), fontDescription.widthVariant(), fontDescription.renderingMode()), true, false));
     166                fontData.set(new SimpleFontData(m_font->platformDataFromCustomData(fontDescription.computedPixelSize(), syntheticBold, syntheticItalic, fontDescription.orientation(),
     167                                                                                   fontDescription.textOrientation(), fontDescription.widthVariant(), fontDescription.renderingMode()), true, false));
    166168            }
    167169        } else {
  • trunk/Source/WebCore/css/CSSParser.cpp

    r80463 r80582  
    18321832    case CSSPropertyWebkitTextEmphasisStyle:
    18331833        return parseTextEmphasisStyle(important);
     1834
     1835    case CSSPropertyWebkitTextOrientation:
     1836        // FIXME: For now just support upright and vertical-right.
     1837        if (id == CSSValueVerticalRight || id == CSSValueUpright)
     1838            validPrimitive = true;
     1839        break;
    18341840
    18351841#if ENABLE(SVG)
  • trunk/Source/WebCore/css/CSSPrimitiveValueMappings.h

    r74098 r80582  
    4040#include "SVGRenderStyleDefs.h"
    4141#include "TextDirection.h"
     42#include "TextOrientation.h"
    4243#include "TextRenderingMode.h"
    4344#include "ThemeTypes.h"
     
    21782179}
    21792180
     2181template<> inline CSSPrimitiveValue::CSSPrimitiveValue(TextOrientation e)
     2182    : m_type(CSS_IDENT)
     2183    , m_hasCachedCSSText(false)
     2184{
     2185    switch (e) {
     2186    case TextOrientationVerticalRight:
     2187        m_value.ident = CSSValueVerticalRight;
     2188        break;
     2189    case TextOrientationUpright:
     2190        m_value.ident = CSSValueUpright;
     2191        break;
     2192    }
     2193}
     2194
     2195template<> inline CSSPrimitiveValue::operator TextOrientation() const
     2196{
     2197    switch (m_value.ident) {
     2198    case CSSValueVerticalRight:
     2199        return TextOrientationVerticalRight;
     2200    case CSSValueUpright:
     2201        return TextOrientationUpright;
     2202    default:
     2203        ASSERT_NOT_REACHED();
     2204        return TextOrientationVerticalRight;
     2205    }
     2206}
     2207
    21802208template<> inline CSSPrimitiveValue::CSSPrimitiveValue(EPointerEvents e)
    21812209    : m_type(CSS_IDENT)
  • trunk/Source/WebCore/css/CSSPropertyNames.in

    r80438 r80582  
    2222text-rendering
    2323-webkit-font-smoothing
     24-webkit-text-orientation
    2425-webkit-text-size-adjust
    2526-webkit-writing-mode
  • trunk/Source/WebCore/css/CSSStyleSelector.cpp

    r80438 r80582  
    34073407                if (applyFirst) {
    34083408                    COMPILE_ASSERT(firstCSSProperty == CSSPropertyColor, CSS_color_is_first_property);
    3409                     COMPILE_ASSERT(CSSPropertyZoom == CSSPropertyColor + 13, CSS_zoom_is_end_of_first_prop_range);
     3409                    COMPILE_ASSERT(CSSPropertyZoom == CSSPropertyColor + 14, CSS_zoom_is_end_of_first_prop_range);
    34103410                    COMPILE_ASSERT(CSSPropertyLineHeight == CSSPropertyZoom + 1, CSS_line_height_is_after_zoom);
    34113411
     
    62086208        return;
    62096209
     6210    case CSSPropertyWebkitTextOrientation: {
     6211        if (!isInherit && !isInitial && !primitiveValue)
     6212            return;
     6213       
     6214        TextOrientation result;
     6215        if (isInherit)
     6216            result = m_parentStyle->fontDescription().textOrientation();
     6217        else if (isInitial)
     6218            result = RenderStyle::initialTextOrientation();
     6219        else
     6220            result = *primitiveValue;
     6221       
     6222        FontDescription fontDescription = m_style->fontDescription();
     6223        if (fontDescription.textOrientation() != result) {
     6224            fontDescription.setTextOrientation(result);
     6225            if (m_style->setFontDescription(fontDescription))
     6226                m_fontDirty = true;
     6227        }
     6228        return;
     6229    }
     6230
    62106231#if ENABLE(SVG)
    62116232    default:
  • trunk/Source/WebCore/css/CSSValueKeywords.in

    r74915 r80582  
    791791# contain
    792792# cover
     793
     794# -webkit-text-orientation
     795upright
     796vertical-right
  • trunk/Source/WebCore/loader/cache/CachedFont.cpp

    r77153 r80582  
    118118}
    119119
    120 FontPlatformData CachedFont::platformDataFromCustomData(float size, bool bold, bool italic, FontOrientation orientation, FontWidthVariant widthVariant, FontRenderingMode renderingMode)
     120FontPlatformData CachedFont::platformDataFromCustomData(float size, bool bold, bool italic, FontOrientation orientation, TextOrientation textOrientation, FontWidthVariant widthVariant, FontRenderingMode renderingMode)
    121121{
    122122#if ENABLE(SVG_FONTS)
     
    126126#ifdef STORE_FONT_CUSTOM_PLATFORM_DATA
    127127    ASSERT(m_fontData);
    128     return m_fontData->fontPlatformData(static_cast<int>(size), bold, italic, orientation, widthVariant, renderingMode);
     128    return m_fontData->fontPlatformData(static_cast<int>(size), bold, italic, orientation, textOrientation, widthVariant, renderingMode);
    129129#else
    130130    return FontPlatformData();
  • trunk/Source/WebCore/loader/cache/CachedFont.h

    r77153 r80582  
    3131#include "FontRenderingMode.h"
    3232#include "FontWidthVariant.h"
     33#include "TextOrientation.h"
    3334#include <wtf/Vector.h>
    3435
     
    6566
    6667    bool ensureCustomFontData();
    67     FontPlatformData platformDataFromCustomData(float size, bool bold, bool italic, FontOrientation = Horizontal, FontWidthVariant = RegularWidth, FontRenderingMode = NormalRenderingMode);
     68    FontPlatformData platformDataFromCustomData(float size, bool bold, bool italic, FontOrientation = Horizontal, TextOrientation = TextOrientationVerticalRight, FontWidthVariant = RegularWidth, FontRenderingMode = NormalRenderingMode);
    6869
    6970#if ENABLE(SVG_FONTS)
  • trunk/Source/WebCore/platform/graphics/FontCache.cpp

    r79402 r80582  
    5858public:
    5959    FontPlatformDataCacheKey(const AtomicString& family = AtomicString(), unsigned size = 0, unsigned weight = 0, bool italic = false,
    60                              bool isPrinterFont = false, FontRenderingMode renderingMode = NormalRenderingMode, FontOrientation orientation = Horizontal, FontWidthVariant widthVariant = RegularWidth)
     60                             bool isPrinterFont = false, FontRenderingMode renderingMode = NormalRenderingMode, FontOrientation orientation = Horizontal,
     61                             TextOrientation textOrientation = TextOrientationVerticalRight, FontWidthVariant widthVariant = RegularWidth)
    6162        : m_size(size)
    6263        , m_weight(weight)
     
    6667        , m_renderingMode(renderingMode)
    6768        , m_orientation(orientation)
     69        , m_textOrientation(textOrientation)
    6870        , m_widthVariant(widthVariant)
    6971    {
     
    7779        return equalIgnoringCase(m_family, other.m_family) && m_size == other.m_size &&
    7880               m_weight == other.m_weight && m_italic == other.m_italic && m_printerFont == other.m_printerFont &&
    79                m_renderingMode == other.m_renderingMode && m_orientation == other.m_orientation && m_widthVariant == other.m_widthVariant;
     81               m_renderingMode == other.m_renderingMode && m_orientation == other.m_orientation && m_textOrientation == other.m_textOrientation && m_widthVariant == other.m_widthVariant;
    8082    }
    8183
     
    8789    FontRenderingMode m_renderingMode;
    8890    FontOrientation m_orientation;
     91    TextOrientation m_textOrientation;
    8992    FontWidthVariant m_widthVariant;
    9093
     
    100103        fontKey.m_weight,
    101104        fontKey.m_widthVariant,
    102         static_cast<unsigned>(fontKey.m_orientation) << 3 | static_cast<unsigned>(fontKey.m_italic) << 2 | static_cast<unsigned>(fontKey.m_printerFont) << 1 | static_cast<unsigned>(fontKey.m_renderingMode)
     105        static_cast<unsigned>(fontKey.m_textOrientation) << 4 | static_cast<unsigned>(fontKey.m_orientation) << 3 | static_cast<unsigned>(fontKey.m_italic) << 2 | static_cast<unsigned>(fontKey.m_printerFont) << 1 | static_cast<unsigned>(fontKey.m_renderingMode)
    103106    };
    104107    return WTF::StringHasher::createBlobHash<sizeof(hashCodes)>(hashCodes);
     
    199202
    200203    FontPlatformDataCacheKey key(familyName, fontDescription.computedPixelSize(), fontDescription.weight(), fontDescription.italic(),
    201                                  fontDescription.usePrinterFont(), fontDescription.renderingMode(), fontDescription.orientation(), fontDescription.widthVariant());
     204                                 fontDescription.usePrinterFont(), fontDescription.renderingMode(), fontDescription.orientation(),
     205                                 fontDescription.textOrientation(), fontDescription.widthVariant());
    202206    FontPlatformData* result = 0;
    203207    bool foundResult;
  • trunk/Source/WebCore/platform/graphics/FontDescription.h

    r77153 r80582  
    3232#include "FontTraitsMask.h"
    3333#include "FontWidthVariant.h"
     34#include "TextOrientation.h"
    3435#include "TextRenderingMode.h"
    3536
     
    5960        , m_computedSize(0)
    6061        , m_orientation(Horizontal)
     62        , m_textOrientation(TextOrientationVerticalRight)
    6163        , m_widthVariant(RegularWidth)
    6264        , m_italic(false)
     
    100102    bool isSpecifiedFont() const { return m_isSpecifiedFont; }
    101103    FontOrientation orientation() const { return m_orientation; }
     104    TextOrientation textOrientation() const { return m_textOrientation; }
    102105    FontWidthVariant widthVariant() const { return m_widthVariant; }
    103106
     
    121124    void setIsSpecifiedFont(bool isSpecifiedFont) { m_isSpecifiedFont = isSpecifiedFont; }
    122125    void setOrientation(FontOrientation orientation) { m_orientation = orientation; }
     126    void setTextOrientation(TextOrientation textOrientation) { m_textOrientation = textOrientation; }
    123127    void setWidthVariant(FontWidthVariant widthVariant) { m_widthVariant = widthVariant; }
    124128
     
    130134    float m_computedSize;    // Computed size adjusted for the minimum font size and the zoom factor. 
    131135
    132     FontOrientation m_orientation;
    133    
     136    FontOrientation m_orientation; // Whether the font is rendering on a horizontal line or a vertical line.
     137    TextOrientation m_textOrientation; // Only used by vertical text. Determines the default orientation for non-ideograph glyphs.
     138
    134139    FontWidthVariant m_widthVariant;
    135140
     
    170175        && m_isSpecifiedFont == other.m_isSpecifiedFont
    171176        && m_orientation == other.m_orientation
     177        && m_textOrientation == other.m_textOrientation
    172178        && m_widthVariant == other.m_widthVariant;
    173179}
  • trunk/Source/WebCore/platform/graphics/FontFastPath.cpp

    r78846 r80582  
    7878            if (page) {
    7979                GlyphData data = page->glyphDataForCharacter(c);
     80                if (data.fontData && (data.fontData->platformData().orientation() == Horizontal || data.fontData->isTextOrientationFallback()))
     81                    return data;
     82               
    8083                if (data.fontData) {
    81                     if (data.fontData->platformData().orientation() == Vertical && data.fontData->orientation() == Horizontal && Font::isCJKIdeographOrSymbol(c)) {
    82                         const SimpleFontData* ideographFontData = data.fontData->brokenIdeographFontData();
    83                         GlyphPageTreeNode* ideographNode = GlyphPageTreeNode::getRootChild(ideographFontData, pageNumber);
    84                         const GlyphPage* ideographPage = ideographNode->page();
    85                         if (ideographPage) {
    86                             GlyphData data = ideographPage->glyphDataForCharacter(c);
    87                             if (data.fontData)
    88                                 return data;
     84                    if (isCJKIdeographOrSymbol(c)) {
     85                        if (!data.fontData->hasVerticalGlyphs()) {
     86                            // Use the broken ideograph font data. The broken ideograph font will use the horizontal width of glyphs
     87                            // to make sure you get a square (even for broken glyphs like symbols used for punctuation).
     88                            const SimpleFontData* brokenIdeographFontData = data.fontData->brokenIdeographFontData();
     89                            GlyphPageTreeNode* brokenIdeographNode = GlyphPageTreeNode::getRootChild(brokenIdeographFontData, pageNumber);
     90                            const GlyphPage* brokenIdeographPage = brokenIdeographNode->page();
     91                            if (brokenIdeographPage) {
     92                                GlyphData brokenIdeographData = brokenIdeographPage->glyphDataForCharacter(c);
     93                                if (brokenIdeographData.fontData)
     94                                    return brokenIdeographData;
     95                            }
     96                           
     97                            // Shouldn't be possible to even reach this point.
     98                            ASSERT_NOT_REACHED();
     99                            return data;
    89100                        }
    90                        
     101                    } else {
     102                        if (m_fontDescription.textOrientation() == TextOrientationVerticalRight) {
     103                            const SimpleFontData* verticalRightFontData = data.fontData->verticalRightOrientationFontData();
     104                            GlyphPageTreeNode* verticalRightNode = GlyphPageTreeNode::getRootChild(verticalRightFontData, pageNumber);
     105                            const GlyphPage* verticalRightPage = verticalRightNode->page();
     106                            if (verticalRightPage) {
     107                                GlyphData verticalRightData = verticalRightPage->glyphDataForCharacter(c);
     108                                // If the glyphs are distinct, we will make the assumption that the font has a vertical-right glyph baked
     109                                // into it.
     110                                if (data.glyph != verticalRightData.glyph)
     111                                    return data;
     112                                // The glyphs are identical, meaning that we should just use the horizontal glyph.
     113                                if (verticalRightData.fontData)
     114                                    return verticalRightData;
     115                            }
     116                        } else if (m_fontDescription.textOrientation() == TextOrientationUpright) {
     117                            const SimpleFontData* uprightFontData = data.fontData->uprightOrientationFontData();
     118                            GlyphPageTreeNode* uprightNode = GlyphPageTreeNode::getRootChild(uprightFontData, pageNumber);
     119                            const GlyphPage* uprightPage = uprightNode->page();
     120                            if (uprightPage) {
     121                                GlyphData uprightData = uprightPage->glyphDataForCharacter(c);
     122                                // If the glyphs are the same, then we know we can just use the horizontal glyph rotated vertically to be upright.
     123                                if (data.glyph == uprightData.glyph)
     124                                    return data;
     125                                // The glyphs are distinct, meaning that the font has a vertical-right glyph baked into it. We can't use that
     126                                // glyph, so we fall back to the upright data and use the horizontal glyph.
     127                                if (uprightData.fontData)
     128                                    return uprightData;
     129                            }
     130                        }
     131
    91132                        // Shouldn't be possible to even reach this point.
    92133                        ASSERT_NOT_REACHED();
     134                        return data;
    93135                    }
    94                     return data;
    95136                }
    96137
     
    365406inline static float offsetToMiddleOfGlyph(const SimpleFontData* fontData, Glyph glyph)
    366407{
    367     if (fontData->orientation() == Horizontal) {
     408    if (fontData->platformData().orientation() == Horizontal) {
    368409        FloatRect bounds = fontData->boundsForGlyph(glyph);
    369410        return bounds.x() + bounds.width() / 2;
  • trunk/Source/WebCore/platform/graphics/SimpleFontData.cpp

    r78846 r80582  
    4848namespace WebCore {
    4949
    50 SimpleFontData::SimpleFontData(const FontPlatformData& platformData, bool isCustomFont, bool isLoading)
     50SimpleFontData::SimpleFontData(const FontPlatformData& platformData, bool isCustomFont, bool isLoading, bool isTextOrientationFallback)
    5151    : m_maxCharWidth(-1)
    5252    , m_avgCharWidth(-1)
    53     , m_orientation(platformData.orientation())
    5453    , m_platformData(platformData)
    5554    , m_treatAsFixedPitch(false)
    5655    , m_isCustomFont(isCustomFont)
    5756    , m_isLoading(isLoading)
    58     , m_isBrokenIdeographFont(false)
     57    , m_isTextOrientationFallback(isTextOrientationFallback)
     58    , m_isBrokenIdeographFallback(false)
     59    , m_hasVerticalGlyphs(false)
    5960{
    6061    platformInit();
     
    6566#if ENABLE(SVG_FONTS)
    6667SimpleFontData::SimpleFontData(PassOwnPtr<SVGFontData> svgFontData, int size, bool syntheticBold, bool syntheticItalic)
    67     : m_orientation(Horizontal)
    68     , m_platformData(FontPlatformData(size, syntheticBold, syntheticItalic))
     68    : m_platformData(FontPlatformData(size, syntheticBold, syntheticItalic))
    6969    , m_treatAsFixedPitch(false)
    7070    , m_svgFontData(svgFontData)
    7171    , m_isCustomFont(true)
    7272    , m_isLoading(false)
    73     , m_isBrokenIdeographFont(false)
     73    , m_isTextOrientationFallback(false)
     74    , m_isBrokenIdeographFallback(false)
     75    , m_hasVerticalGlyphs(false)
    7476{
    7577    SVGFontFaceElement* svgFontFaceElement = m_svgFontData->svgFontFaceElement();
     
    203205}
    204206
     207SimpleFontData* SimpleFontData::verticalRightOrientationFontData() const
     208{
     209    if (!m_derivedFontData)
     210        m_derivedFontData = DerivedFontData::create(isCustomFont());
     211    if (!m_derivedFontData->verticalRightOrientation) {
     212        FontPlatformData verticalRightPlatformData(m_platformData);
     213        verticalRightPlatformData.m_orientation = Horizontal;
     214        m_derivedFontData->verticalRightOrientation = new SimpleFontData(verticalRightPlatformData, isCustomFont(), false, true);
     215    }
     216    return m_derivedFontData->verticalRightOrientation.get();
     217}
     218
     219SimpleFontData* SimpleFontData::uprightOrientationFontData() const
     220{
     221    if (!m_derivedFontData)
     222        m_derivedFontData = DerivedFontData::create(isCustomFont());
     223    if (!m_derivedFontData->uprightOrientation)
     224        m_derivedFontData->uprightOrientation = new SimpleFontData(m_platformData, isCustomFont(), false, true);
     225    return m_derivedFontData->uprightOrientation.get();
     226}
     227
    205228SimpleFontData* SimpleFontData::brokenIdeographFontData() const
    206229{
     
    209232    if (!m_derivedFontData->brokenIdeograph) {
    210233        m_derivedFontData->brokenIdeograph = new SimpleFontData(m_platformData, isCustomFont(), false);
    211         m_derivedFontData->brokenIdeograph->m_orientation = Vertical;
    212         m_derivedFontData->brokenIdeograph->m_isBrokenIdeographFont = true;
     234        m_derivedFontData->brokenIdeograph->m_isBrokenIdeographFallback = true;
    213235    }
    214236    return m_derivedFontData->brokenIdeograph.get();
     
    243265    if (brokenIdeograph)
    244266        GlyphPageTreeNode::pruneTreeCustomFontData(brokenIdeograph.get());
     267    if (verticalRightOrientation)
     268        GlyphPageTreeNode::pruneTreeCustomFontData(verticalRightOrientation.get());
     269    if (uprightOrientation)
     270        GlyphPageTreeNode::pruneTreeCustomFontData(uprightOrientation.get());
    245271}
    246272
  • trunk/Source/WebCore/platform/graphics/SimpleFontData.h

    r78846 r80582  
    7272class SimpleFontData : public FontData {
    7373public:
    74     SimpleFontData(const FontPlatformData&, bool isCustomFont = false, bool isLoading = false);
     74    SimpleFontData(const FontPlatformData&, bool isCustomFont = false, bool isLoading = false, bool isTextOrientationFallback = false);
    7575#if ENABLE(SVG_FONTS)
    7676    SimpleFontData(PassOwnPtr<SVGFontData>, int size, bool syntheticBold, bool syntheticItalic);
     
    9898    }
    9999
     100    SimpleFontData* verticalRightOrientationFontData() const;
     101    SimpleFontData* uprightOrientationFontData() const;
    100102    SimpleFontData* brokenIdeographFontData() const;
    101    
    102     // FIXME: Use the actual metrics for fonts with vertical tables instead of just hard-coding.  If the font is horizontally oriented or
    103     // a broken ideographic font, then just hard-code to split ascent/descent down the middle.  Otherwise we should actually use the metrics
    104     // from the font itself.
     103
     104    bool hasVerticalGlyphs() const { return m_hasVerticalGlyphs; }
     105    bool isTextOrientationFallback() const { return m_isTextOrientationFallback; }
     106
    105107    const FontMetrics& fontMetrics() const { return m_fontMetrics; }
    106108    float maxCharWidth() const { return m_maxCharWidth; }
     
    138140    virtual bool isSegmented() const;
    139141
    140     bool isBrokenIdeographFont() const { return m_isBrokenIdeographFont; }
    141 
    142142    const GlyphData& missingGlyphData() const { return m_missingGlyphData; }
    143143
     
    153153
    154154#if PLATFORM(MAC) || USE(CORE_TEXT)
    155     CFDictionaryRef getCFStringAttributes(TypesettingFeatures) const;
     155    CFDictionaryRef getCFStringAttributes(TypesettingFeatures, FontOrientation) const;
    156156#endif
    157157
     
    184184#endif
    185185
    186     FontOrientation orientation() const { return m_orientation; }
    187 
    188186private:
    189187    void platformInit();
     
    210208    float m_avgCharWidth;
    211209   
    212     FontOrientation m_orientation; // This is our supported orientation according to the tables in the font.  FontPlatformData will just always have the desired orientation.
    213                                    // This value represents what we actually support.
    214 
    215210    FontPlatformData m_platformData;
    216211
     
    226221    bool m_isCustomFont;  // Whether or not we are custom font loaded via @font-face
    227222    bool m_isLoading; // Whether or not this custom font is still in the act of loading.
    228     bool m_isBrokenIdeographFont;
    229 
     223   
     224    bool m_isTextOrientationFallback;
     225    bool m_isBrokenIdeographFallback;
     226    bool m_hasVerticalGlyphs;
     227   
    230228    Glyph m_spaceGlyph;
    231229    float m_spaceWidth;
     
    243241        OwnPtr<SimpleFontData> emphasisMark;
    244242        OwnPtr<SimpleFontData> brokenIdeograph;
     243        OwnPtr<SimpleFontData> verticalRightOrientation;
     244        OwnPtr<SimpleFontData> uprightOrientation;
    245245
    246246    private:
  • trunk/Source/WebCore/platform/graphics/cairo/FontCustomPlatformData.h

    r77153 r80582  
    2626#include "FontRenderingMode.h"
    2727#include "FontWidthVariant.h"
     28#include "TextOrientation.h"
    2829#include <wtf/Forward.h>
    2930#include <wtf/Noncopyable.h>
     
    4243    FontCustomPlatformData(FT_Face, SharedBuffer*);
    4344    ~FontCustomPlatformData();
    44     FontPlatformData fontPlatformData(int size, bool bold, bool italic, FontOrientation = Horizontal, FontWidthVariant = RegularWidth, FontRenderingMode = NormalRenderingMode);
     45    FontPlatformData fontPlatformData(int size, bool bold, bool italic, FontOrientation = Horizontal, TextOrientation = TextOrientationVerticalRight, FontWidthVariant = RegularWidth, FontRenderingMode = NormalRenderingMode);
    4546    static bool supportsFormat(const String&);
    4647
  • trunk/Source/WebCore/platform/graphics/cocoa/FontPlatformData.h

    r77153 r80582  
    2727#include "FontOrientation.h"
    2828#include "FontWidthVariant.h"
     29#include "TextOrientation.h"
    2930#include <wtf/text/StringImpl.h>
    3031
     
    6162class FontPlatformData {
    6263  public:
    63     FontPlatformData(float size, bool syntheticBold, bool syntheticOblique, FontOrientation orientation = Horizontal, FontWidthVariant widthVariant = RegularWidth)
     64    FontPlatformData(float size, bool syntheticBold, bool syntheticOblique, FontOrientation orientation = Horizontal,
     65                     TextOrientation textOrientation = TextOrientationVerticalRight, FontWidthVariant widthVariant = RegularWidth)
    6466        : m_syntheticBold(syntheticBold)
    6567        , m_syntheticOblique(syntheticOblique)
    6668        , m_orientation(orientation)
     69        , m_textOrientation(textOrientation)
    6770        , m_size(size)
    6871        , m_widthVariant(widthVariant)
     
    7578    }
    7679
    77     FontPlatformData(NSFont*, float size, bool syntheticBold = false, bool syntheticOblique = false, FontOrientation = Horizontal, FontWidthVariant = RegularWidth);
     80    FontPlatformData(NSFont*, float size, bool syntheticBold = false, bool syntheticOblique = false, FontOrientation = Horizontal,
     81                     TextOrientation = TextOrientationVerticalRight, FontWidthVariant = RegularWidth);
    7882   
    79     FontPlatformData(CGFontRef cgFont, float size, bool syntheticBold, bool syntheticOblique, FontOrientation orientation, FontWidthVariant widthVariant)
     83    FontPlatformData(CGFontRef cgFont, float size, bool syntheticBold, bool syntheticOblique, FontOrientation orientation,
     84                     TextOrientation textOrientation, FontWidthVariant widthVariant)
    8085        : m_syntheticBold(syntheticBold)
    8186        , m_syntheticOblique(syntheticOblique)
    8287        , m_orientation(orientation)
     88        , m_textOrientation(textOrientation)
    8389        , m_size(size)
    8490        , m_widthVariant(widthVariant)
     
    100106    bool syntheticOblique() const { return m_syntheticOblique; }
    101107    FontOrientation orientation() const { return m_orientation; }
     108    TextOrientation textOrientation() const { return m_textOrientation; }
    102109    FontWidthVariant widthVariant() const { return m_widthVariant; }
    103110
     
    105112    bool m_syntheticOblique;
    106113    FontOrientation m_orientation;
     114    TextOrientation m_textOrientation;
    107115
    108116    float m_size;
     
    113121    {
    114122        ASSERT(m_font != 0 || m_cgFont == 0);
    115         uintptr_t hashCodes[3] = { (uintptr_t)m_font, m_widthVariant, m_orientation << 2 | m_syntheticBold << 1 | m_syntheticOblique };
     123        uintptr_t hashCodes[3] = { (uintptr_t)m_font, m_widthVariant, m_textOrientation << 3 | m_orientation << 2 | m_syntheticBold << 1 | m_syntheticOblique };
    116124        return WTF::StringHasher::createBlobHash<sizeof(hashCodes)>(hashCodes);
    117125    }
     
    121129    bool operator==(const FontPlatformData& other) const
    122130    {
    123         return m_font == other.m_font && m_syntheticBold == other.m_syntheticBold && m_syntheticOblique == other.m_syntheticOblique &&
    124                m_cgFont == other.m_cgFont && m_size == other.m_size && m_orientation == other.m_orientation && m_widthVariant == other.m_widthVariant;
     131        return m_font == other.m_font && m_syntheticBold == other.m_syntheticBold && m_syntheticOblique == other.m_syntheticOblique
     132               && m_cgFont == other.m_cgFont && m_size == other.m_size && m_orientation == other.m_orientation
     133               && m_textOrientation == other.m_textOrientation && m_widthVariant == other.m_widthVariant;
    125134    }
    126135
  • trunk/Source/WebCore/platform/graphics/cocoa/FontPlatformDataCocoa.mm

    r77153 r80582  
    4646#endif  // PLATFORM(MAC)
    4747
    48 FontPlatformData::FontPlatformData(NSFont *nsFont, float size, bool syntheticBold, bool syntheticOblique, FontOrientation orientation, FontWidthVariant widthVariant)
     48FontPlatformData::FontPlatformData(NSFont *nsFont, float size, bool syntheticBold, bool syntheticOblique, FontOrientation orientation,
     49                                   TextOrientation textOrientation, FontWidthVariant widthVariant)
    4950    : m_syntheticBold(syntheticBold)
    5051    , m_syntheticOblique(syntheticOblique)
     52    , m_orientation(orientation)
     53    , m_textOrientation(textOrientation)
    5154    , m_size(size)
    5255    , m_widthVariant(widthVariant)
     
    6568    loadFont(nsFont, size, m_font, cgFont);
    6669
    67     m_orientation = orientation;
    68 
    6970    if (m_font)
    7071        CFRetain(m_font);
     
    8889    m_isColorBitmapFont = f.m_isColorBitmapFont;
    8990    m_orientation = f.m_orientation;
     91    m_textOrientation = f.m_textOrientation;
    9092    m_CTFont = f.m_CTFont;
    9193#if PLATFORM(CHROMIUM) && OS(DARWIN)
     
    116118    m_isColorBitmapFont = f.m_isColorBitmapFont;
    117119    m_orientation = f.m_orientation;
     120    m_textOrientation = f.m_textOrientation;
    118121    m_CTFont = f.m_CTFont;
    119122#if PLATFORM(CHROMIUM) && OS(DARWIN)
  • trunk/Source/WebCore/platform/graphics/freetype/FontCustomPlatformDataFreeType.cpp

    r77153 r80582  
    6060}
    6161
    62 FontPlatformData FontCustomPlatformData::fontPlatformData(int size, bool bold, bool italic, FontOrientation, FontWidthVariant, FontRenderingMode)
     62FontPlatformData FontCustomPlatformData::fontPlatformData(int size, bool bold, bool italic, FontOrientation, TextOrientation, FontWidthVariant, FontRenderingMode)
    6363{
    6464    return FontPlatformData(m_fontFace, size, bold, italic);
  • trunk/Source/WebCore/platform/graphics/haiku/FontCustomPlatformData.cpp

    r77153 r80582  
    3232}
    3333
    34 FontPlatformData FontCustomPlatformData::fontPlatformData(int size, bool bold, bool italic, FontOrientation, FontWidthVariant, FontRenderingMode)
     34FontPlatformData FontCustomPlatformData::fontPlatformData(int size, bool bold, bool italic, FontOrientation, TextOrientation, FontWidthVariant, FontRenderingMode)
    3535{
    3636    return FontPlatformData(size, bold, italic);
  • trunk/Source/WebCore/platform/graphics/haiku/FontCustomPlatformData.h

    r77153 r80582  
    2525#include "FontRenderingMode.h"
    2626#include "FontWidthVariant.h"
     27#include "TextOrientation.h"
    2728#include <wtf/Forward.h>
    2829
     
    4041        static bool supportsFormat(const String&);
    4142
    42         FontPlatformData fontPlatformData(int size, bool bold, bool italic, FontOrientation = Horizontal, FontWidthVariant = RegularWidth, FontRenderingMode = NormalRenderingMode);
     43        FontPlatformData fontPlatformData(int size, bool bold, bool italic, FontOrientation = Horizontal, TextOrientation = TextOrientationVerticalRight, FontWidthVariant = RegularWidth, FontRenderingMode = NormalRenderingMode);
    4344    };
    4445
  • trunk/Source/WebCore/platform/graphics/mac/ComplexTextControllerCoreText.cpp

    r76674 r80582  
    149149#else
    150150        RetainPtr<CFStringRef> string(AdoptCF, CFStringCreateWithCharactersNoCopy(kCFAllocatorDefault, cp, length, kCFAllocatorNull));
    151         RetainPtr<CFAttributedStringRef> attributedString(AdoptCF, CFAttributedStringCreate(kCFAllocatorDefault, string.get(), fontData->getCFStringAttributes(m_font.typesettingFeatures())));
     151        RetainPtr<CFAttributedStringRef> attributedString(AdoptCF, CFAttributedStringCreate(kCFAllocatorDefault, string.get(), fontData->getCFStringAttributes(m_font.typesettingFeatures(), fontData->platformData().orientation())));
    152152        RetainPtr<CTTypesetterRef> typesetter(AdoptCF, CTTypesetterCreateWithAttributedStringAndOptions(attributedString.get(), m_run.ltr() ? ltrTypesetterOptions : rtlTypesetterOptions));
    153153#endif
     
    155155        line.adoptCF(CTTypesetterCreateLine(typesetter.get(), CFRangeMake(0, 0)));
    156156    } else {
    157         ProviderInfo info = { cp, length, fontData->getCFStringAttributes(m_font.typesettingFeatures()) };
     157        ProviderInfo info = { cp, length, fontData->getCFStringAttributes(m_font.typesettingFeatures(), fontData->platformData().orientation()) };
    158158
    159159        line.adoptCF(wkCreateCTLineWithUniCharProvider(&provideStringAndAttributes, 0, &info));
  • trunk/Source/WebCore/platform/graphics/mac/FontCacheMac.mm

    r77153 r80582  
    212212    bool syntheticOblique = (traits & NSFontItalicTrait) && !(actualTraits & NSFontItalicTrait);
    213213
    214     return new FontPlatformData(platformFont, size, syntheticBold, syntheticOblique, fontDescription.orientation(), fontDescription.widthVariant());
     214    return new FontPlatformData(platformFont, size, syntheticBold, syntheticOblique, fontDescription.orientation(), fontDescription.textOrientation(), fontDescription.widthVariant());
    215215}
    216216
  • trunk/Source/WebCore/platform/graphics/mac/FontCustomPlatformData.cpp

    r77153 r80582  
    3939}
    4040
    41 FontPlatformData FontCustomPlatformData::fontPlatformData(int size, bool bold, bool italic, FontOrientation orientation, FontWidthVariant widthVariant, FontRenderingMode)
     41FontPlatformData FontCustomPlatformData::fontPlatformData(int size, bool bold, bool italic, FontOrientation orientation, TextOrientation textOrientation, FontWidthVariant widthVariant, FontRenderingMode)
    4242{
    43     return FontPlatformData(m_cgFont, size, bold, italic, orientation, widthVariant);
     43    return FontPlatformData(m_cgFont, size, bold, italic, orientation, textOrientation, widthVariant);
    4444}
    4545
  • trunk/Source/WebCore/platform/graphics/mac/FontCustomPlatformData.h

    r77153 r80582  
    2525#include "FontRenderingMode.h"
    2626#include "FontWidthVariant.h"
     27#include "TextOrientation.h"
    2728#include <CoreFoundation/CFBase.h>
    2829#include <wtf/Forward.h>
     
    4950    ~FontCustomPlatformData();
    5051
    51     FontPlatformData fontPlatformData(int size, bool bold, bool italic, FontOrientation = Horizontal, FontWidthVariant = RegularWidth, FontRenderingMode = NormalRenderingMode);
     52    FontPlatformData fontPlatformData(int size, bool bold, bool italic, FontOrientation = Horizontal, TextOrientation = TextOrientationVerticalRight, FontWidthVariant = RegularWidth, FontRenderingMode = NormalRenderingMode);
    5253
    5354    static bool supportsFormat(const String&);
  • trunk/Source/WebCore/platform/graphics/mac/FontMac.mm

    r76743 r80582  
    5353}
    5454
    55 static void showGlyphsWithAdvances(const SimpleFontData* font, CGContextRef context, const CGGlyph* glyphs, const CGSize* advances, size_t count)
    56 {
     55static void showGlyphsWithAdvances(const FloatPoint& point, const SimpleFontData* font, CGContextRef context, const CGGlyph* glyphs, const CGSize* advances, size_t count)
     56{
     57    CGContextSetTextPosition(context, point.x(), point.y());
     58
    5759    const FontPlatformData& platformData = font->platformData();
    5860    if (!platformData.isColorBitmapFont()) {
    5961        CGAffineTransform savedMatrix;
    60         bool isVertical = font->orientation() == Vertical;
    61 
     62        bool isVertical = font->platformData().orientation() == Vertical;
    6263        if (isVertical) {
    6364            CGAffineTransform rotateLeftTransform = CGAffineTransformMake(0, -1, 1, 0, 0, 0);
    64 
    6565            savedMatrix = CGContextGetTextMatrix(context);
    6666            CGAffineTransform runMatrix = CGAffineTransformConcat(savedMatrix, rotateLeftTransform);
    67             // Move start point to put glyphs into original region.
    68             runMatrix.tx = savedMatrix.tx + font->fontMetrics().ascent();
    69             runMatrix.ty = savedMatrix.ty + font->fontMetrics().descent();
    7067            CGContextSetTextMatrix(context, runMatrix);
    71         }
    72 
    73         CGContextShowGlyphsWithAdvances(context, glyphs, advances, count);
    74 
    75         if (isVertical)
     68           
     69            CGAffineTransform translationsTransform = CGAffineTransformMake(platformData.m_size, 0, 0, platformData.m_size, 0, 0);
     70            translationsTransform = CGAffineTransformConcat(translationsTransform, rotateLeftTransform);
     71            CGFloat unitsPerEm = CGFontGetUnitsPerEm(platformData.cgFont());
     72            translationsTransform = CGAffineTransformConcat(translationsTransform, CGAffineTransformMakeScale(1 / unitsPerEm, 1 / unitsPerEm));
     73
     74            Vector<CGSize, 256> translations(count);
     75            CTFontGetVerticalTranslationsForGlyphs(platformData.ctFont(), glyphs, translations.data(), count);
     76           
     77            CGAffineTransform transform = CGAffineTransformInvert(CGContextGetTextMatrix(context));
     78
     79            CGPoint position = FloatPoint(point.x(), point.y() + font->fontMetrics().floatAscent(IdeographicBaseline) - font->fontMetrics().floatAscent());
     80            Vector<CGPoint, 256> positions(count);
     81            for (size_t i = 0; i < count; ++i) {
     82                CGSize translation = CGSizeApplyAffineTransform(translations[i], translationsTransform);
     83                positions[i] = CGPointApplyAffineTransform(CGPointMake(position.x - translation.width, position.y + translation.height), transform);
     84                position.x += advances[i].width;
     85                position.y += advances[i].height;
     86            }
     87            CGContextShowGlyphsAtPositions(context, glyphs, positions.data(), count);
    7688            CGContextSetTextMatrix(context, savedMatrix);
     89        } else
     90            CGContextShowGlyphsWithAdvances(context, glyphs, advances, count);
    7791    }
    7892#if !defined(BUILDING_ON_TIGER) && !defined(BUILDING_ON_LEOPARD) && !defined(BUILDING_ON_SNOW_LEOPARD)
     
    189203        // If shadows are ignoring transforms, then we haven't applied the Y coordinate flip yet, so down is negative.
    190204        float shadowTextY = point.y() + shadowOffset.height() * (context->shadowsIgnoreTransforms() ? -1 : 1);
    191         CGContextSetTextPosition(cgContext, shadowTextX, shadowTextY);
    192         showGlyphsWithAdvances(font, cgContext, glyphBuffer.glyphs(from), glyphBuffer.advances(from), numGlyphs);
    193         if (font->syntheticBoldOffset()) {
    194             CGContextSetTextPosition(cgContext, shadowTextX + font->syntheticBoldOffset(), shadowTextY);
    195             showGlyphsWithAdvances(font, cgContext, glyphBuffer.glyphs(from), glyphBuffer.advances(from), numGlyphs);
    196         }
     205        showGlyphsWithAdvances(FloatPoint(shadowTextX, shadowTextY), font, cgContext, glyphBuffer.glyphs(from), glyphBuffer.advances(from), numGlyphs);
     206        if (font->syntheticBoldOffset())
     207            showGlyphsWithAdvances(FloatPoint(shadowTextX + font->syntheticBoldOffset(), shadowTextY), font, cgContext, glyphBuffer.glyphs(from), glyphBuffer.advances(from), numGlyphs);
    197208        context->setFillColor(fillColor, fillColorSpace);
    198209    }
    199210
    200     CGContextSetTextPosition(cgContext, point.x(), point.y());
    201     showGlyphsWithAdvances(font, cgContext, glyphBuffer.glyphs(from), glyphBuffer.advances(from), numGlyphs);
    202     if (font->syntheticBoldOffset()) {
    203         CGContextSetTextPosition(cgContext, point.x() + font->syntheticBoldOffset(), point.y());
    204         showGlyphsWithAdvances(font, cgContext, glyphBuffer.glyphs(from), glyphBuffer.advances(from), numGlyphs);
    205     }
     211    showGlyphsWithAdvances(point, font, cgContext, glyphBuffer.glyphs(from), glyphBuffer.advances(from), numGlyphs);
     212    if (font->syntheticBoldOffset())
     213        showGlyphsWithAdvances(FloatPoint(point.x() + font->syntheticBoldOffset(), point.y()), font, cgContext, glyphBuffer.glyphs(from), glyphBuffer.advances(from), numGlyphs);
    206214
    207215    if (hasSimpleShadow)
  • trunk/Source/WebCore/platform/graphics/mac/GlyphPageTreeNodeMac.cpp

    r80414 r80582  
    4040static bool shouldUseCoreText(UChar* buffer, unsigned bufferLength, const SimpleFontData* fontData)
    4141{
    42     if (fontData->platformData().widthVariant() != RegularWidth || (fontData->orientation() == Vertical && !fontData->isBrokenIdeographFont())) {
     42    if (fontData->platformData().widthVariant() != RegularWidth || fontData->hasVerticalGlyphs()) {
    4343        // Ideographs don't have a vertical variant or width variants.
    4444        for (unsigned i = 0; i < bufferLength; ++i) {
     
    7171        // We ask CoreText for possible vertical variant glyphs
    7272        RetainPtr<CFStringRef> string(AdoptCF, CFStringCreateWithCharactersNoCopy(kCFAllocatorDefault, buffer, bufferLength, kCFAllocatorNull));
    73         RetainPtr<CFAttributedStringRef> attributedString(AdoptCF, CFAttributedStringCreate(kCFAllocatorDefault, string.get(), fontData->getCFStringAttributes(0)));
     73        RetainPtr<CFAttributedStringRef> attributedString(AdoptCF, CFAttributedStringCreate(kCFAllocatorDefault, string.get(), fontData->getCFStringAttributes(0, fontData->hasVerticalGlyphs() ? Vertical : Horizontal)));
    7474        RetainPtr<CTLineRef> line(AdoptCF, CTLineCreateWithAttributedString(attributedString.get()));
    7575
  • trunk/Source/WebCore/platform/graphics/mac/SimpleFontDataCoreText.cpp

    r72498 r80582  
    4040namespace WebCore {
    4141
    42 CFDictionaryRef SimpleFontData::getCFStringAttributes(TypesettingFeatures typesettingFeatures) const
     42CFDictionaryRef SimpleFontData::getCFStringAttributes(TypesettingFeatures typesettingFeatures, FontOrientation orientation) const
    4343{
    4444    unsigned key = typesettingFeatures + 1;
     
    4747    if (!addResult.second)
    4848        return attributesDictionary.get();
     49   
     50    bool treatLineAsVertical = orientation == Vertical;
    4951
    50     bool allowLigatures = (orientation() == Horizontal && platformData().allowsLigatures()) || (typesettingFeatures & Ligatures);
     52    bool allowLigatures = (!treatLineAsVertical && platformData().allowsLigatures()) || (typesettingFeatures & Ligatures);
    5153
    5254    static const int ligaturesNotAllowedValue = 0;
     
    6163        static const void* keysWithKerningDisabled[] = { kCTFontAttributeName, kCTKernAttributeName, kCTLigatureAttributeName, kCTVerticalFormsAttributeName };
    6264        const void* valuesWithKerningDisabled[] = { platformData().ctFont(), kerningAdjustment, allowLigatures
    63             ? ligaturesAllowed : ligaturesNotAllowed, orientation() == Vertical ? kCFBooleanTrue : kCFBooleanFalse };
     65            ? ligaturesAllowed : ligaturesNotAllowed, treatLineAsVertical ? kCFBooleanTrue : kCFBooleanFalse };
    6466        attributesDictionary.adoptCF(CFDictionaryCreate(0, keysWithKerningDisabled, valuesWithKerningDisabled,
    6567            WTF_ARRAY_LENGTH(keysWithKerningDisabled), &kCFCopyStringDictionaryKeyCallBacks, &kCFTypeDictionaryValueCallBacks));
     
    6769        // By omitting the kCTKernAttributeName attribute, we get Core Text's standard kerning.
    6870        static const void* keysWithKerningEnabled[] = { kCTFontAttributeName, kCTLigatureAttributeName, kCTVerticalFormsAttributeName };
    69         const void* valuesWithKerningEnabled[] = { platformData().ctFont(), allowLigatures ? ligaturesAllowed : ligaturesNotAllowed, orientation() == Vertical ? kCFBooleanTrue : kCFBooleanFalse };
     71        const void* valuesWithKerningEnabled[] = { platformData().ctFont(), allowLigatures ? ligaturesAllowed : ligaturesNotAllowed, treatLineAsVertical ? kCFBooleanTrue : kCFBooleanFalse };
    7072        attributesDictionary.adoptCF(CFDictionaryCreate(0, keysWithKerningEnabled, valuesWithKerningEnabled,
    7173            WTF_ARRAY_LENGTH(keysWithKerningEnabled), &kCFCopyStringDictionaryKeyCallBacks, &kCFTypeDictionaryValueCallBacks));
  • trunk/Source/WebCore/platform/graphics/mac/SimpleFontDataMac.mm

    r77530 r80582  
    260260    }
    261261   
    262     if (m_orientation == Vertical) {
    263         // Ignore vertical orientation when the font doesn't support vertical metrics.
     262    if (platformData().orientation() == Vertical && !isTextOrientationFallback()) {
    264263        // The check doesn't look neat but this is what AppKit does for vertical writing...
    265264        RetainPtr<CFArrayRef> tableTags(AdoptCF, CTFontCopyAvailableTables(m_platformData.ctFont(), kCTFontTableOptionExcludeSynthetic));
    266265        CFIndex numTables = CFArrayGetCount(tableTags.get());
    267         bool found = false;
    268266        for (CFIndex index = 0; index < numTables; ++index) {
    269267            CTFontTableTag tag = (CTFontTableTag)(uintptr_t)CFArrayGetValueAtIndex(tableTags.get(), index);
    270268            if (tag == kCTFontTableVhea || tag == kCTFontTableVORG) {
    271                 found = true;
     269                m_hasVerticalGlyphs = true;
    272270                break;
    273271            }
    274272        }
    275 
    276         if (found == false)
    277             m_orientation = Horizontal;
    278273    }
    279274
     
    476471    FloatRect boundingBox;
    477472#ifndef BUILDING_ON_TIGER
    478     boundingBox = CTFontGetBoundingRectsForGlyphs(m_platformData.ctFont(),
    479                     orientation() == Vertical ? kCTFontVerticalOrientation : kCTFontHorizontalOrientation, &glyph, 0, 1);
     473    boundingBox = CTFontGetBoundingRectsForGlyphs(m_platformData.ctFont(), platformData().orientation() == Vertical ? kCTFontVerticalOrientation : kCTFontHorizontalOrientation, &glyph, 0, 1);
    480474    boundingBox.setY(-boundingBox.maxY());
    481475#else
     
    495489{
    496490    CGSize advance;
    497     if (orientation() == Horizontal || m_isBrokenIdeographFont) {
     491    if (platformData().orientation() == Horizontal || m_isBrokenIdeographFallback) {
    498492        NSFont* font = platformData().font();
    499493        float pointSize = platformData().m_size;
  • trunk/Source/WebCore/platform/graphics/pango/FontCustomPlatformDataPango.cpp

    r77153 r80582  
    3131}
    3232
    33 FontPlatformData FontCustomPlatformData::fontPlatformData(int size, bool bold, bool italic, FontOrientation, FontWidthVariant, FontRenderingMode)
     33FontPlatformData FontCustomPlatformData::fontPlatformData(int size, bool bold, bool italic, FontOrientation, TextOrientation, FontWidthVariant, FontRenderingMode)
    3434{
    3535    return FontPlatformData(m_fontFace, size, bold, italic);
  • trunk/Source/WebCore/platform/graphics/qt/FontCustomPlatformData.h

    r77153 r80582  
    2626#include "FontRenderingMode.h"
    2727#include "FontWidthVariant.h"
     28#include "TextOrientation.h"
    2829#include <wtf/FastAllocBase.h>
    2930#include <wtf/Forward.h>
     
    4445    int m_handle;
    4546
    46     FontPlatformData fontPlatformData(int size, bool bold, bool italic, FontOrientation = Horizontal, FontWidthVariant = RegularWidth, FontRenderingMode = NormalRenderingMode);
     47    FontPlatformData fontPlatformData(int size, bool bold, bool italic, FontOrientation = Horizontal, TextOrientation = TextOrientationVerticalRight,
     48                                      FontWidthVariant = RegularWidth, FontRenderingMode = NormalRenderingMode);
    4749
    4850    static bool supportsFormat(const String&);
  • trunk/Source/WebCore/platform/graphics/qt/FontCustomPlatformDataQt.cpp

    r77153 r80582  
    3535}
    3636
    37 FontPlatformData FontCustomPlatformData::fontPlatformData(int size, bool bold, bool italic, FontOrientation, FontWidthVariant, FontRenderingMode)
     37FontPlatformData FontCustomPlatformData::fontPlatformData(int size, bool bold, bool italic, FontOrientation, TextOrientation, FontWidthVariant, FontRenderingMode)
    3838{
    3939    QFont font;
  • trunk/Source/WebCore/platform/graphics/skia/FontCustomPlatformData.cpp

    r79174 r80582  
    6666}
    6767
    68 FontPlatformData FontCustomPlatformData::fontPlatformData(int size, bool bold, bool italic, FontOrientation orientation, FontWidthVariant, FontRenderingMode mode)
     68FontPlatformData FontCustomPlatformData::fontPlatformData(int size, bool bold, bool italic, FontOrientation orientation,
     69                                                          TextOrientation, FontWidthVariant, FontRenderingMode mode)
    6970{
    7071#if OS(WINDOWS)
  • trunk/Source/WebCore/platform/graphics/skia/FontCustomPlatformData.h

    r77153 r80582  
    3636#include "FontRenderingMode.h"
    3737#include "FontWidthVariant.h"
     38#include "TextOrientation.h"
    3839#include <wtf/Forward.h>
    3940#include <wtf/Noncopyable.h>
     
    6768    ~FontCustomPlatformData();
    6869
    69     FontPlatformData fontPlatformData(int size, bool bold, bool italic, FontOrientation = Horizontal, FontWidthVariant = RegularWidth,
    70                                       FontRenderingMode = NormalRenderingMode);
     70    FontPlatformData fontPlatformData(int size, bool bold, bool italic, FontOrientation = Horizontal, TextOrientation = TextOrientationVerticalRight,
     71                                      FontWidthVariant = RegularWidth, FontRenderingMode = NormalRenderingMode);
    7172
    7273    static bool supportsFormat(const String&);
  • trunk/Source/WebCore/platform/graphics/win/FontCustomPlatformData.cpp

    r77153 r80582  
    6060}
    6161
    62 FontPlatformData FontCustomPlatformData::fontPlatformData(int size, bool bold, bool italic, FontOrientation, FontWidthVariant, FontRenderingMode renderingMode)
     62FontPlatformData FontCustomPlatformData::fontPlatformData(int size, bool bold, bool italic, FontOrientation, TextOrientation, FontWidthVariant, FontRenderingMode renderingMode)
    6363{
    6464    ASSERT(m_fontReference);
  • trunk/Source/WebCore/platform/graphics/win/FontCustomPlatformData.h

    r77153 r80582  
    2626#include "FontWidthVariant.h"
    2727#include "PlatformString.h"
     28#include "TextOrientation.h"
    2829#include <wtf/Forward.h>
    2930#include <wtf/Noncopyable.h>
     
    4748    ~FontCustomPlatformData();
    4849
    49     FontPlatformData fontPlatformData(int size, bool bold, bool italic, FontOrientation = Horizontal, FontWidthVariant = RegularWidth, FontRenderingMode = NormalRenderingMode);
     50    FontPlatformData fontPlatformData(int size, bool bold, bool italic, FontOrientation = Horizontal, TextOrientation = TextOrientationVerticalRight,
     51                                      FontWidthVariant = RegularWidth, FontRenderingMode = NormalRenderingMode);
    5052
    5153    static bool supportsFormat(const String&);
  • trunk/Source/WebCore/platform/graphics/win/FontCustomPlatformDataCairo.cpp

    r77153 r80582  
    3333}
    3434
    35 FontPlatformData FontCustomPlatformData::fontPlatformData(int size, bool bold, bool italic, FontOrientation, FontWidthVariant)
     35FontPlatformData FontCustomPlatformData::fontPlatformData(int size, bool bold, bool italic, FontOrientation, TextOrientation, FontWidthVariant)
    3636{
    3737    return FontPlatformData(m_fontFace, size, bold, italic);
  • trunk/Source/WebCore/platform/graphics/win/FontCustomPlatformDataCairo.h

    r77153 r80582  
    4343    ~FontCustomPlatformData();
    4444
    45     FontPlatformData fontPlatformData(int size, bool bold, bool italic, FontOrientation = Horizontal, FontWidthVariant = RegularWidth);
     45    FontPlatformData fontPlatformData(int size, bool bold, bool italic, FontOrientation = Horizontal, TextOrientation = TextOrientationVerticalRight, FontWidthVariant = RegularWidth);
    4646
    4747    static bool supportsFormat(const String&);
  • trunk/Source/WebCore/platform/graphics/wince/FontCustomPlatformData.cpp

    r77153 r80582  
    4646}
    4747
    48 FontPlatformData FontCustomPlatformData::fontPlatformData(int size, bool bold, bool italic, FontOrientation, FontWidthVariant, FontRenderingMode renderingMode)
     48FontPlatformData FontCustomPlatformData::fontPlatformData(int size, bool bold, bool italic, FontOrientation, TextOrientation, FontWidthVariant, FontRenderingMode renderingMode)
    4949{
    5050    FontDescription fontDesc;
  • trunk/Source/WebCore/platform/graphics/wince/FontCustomPlatformData.h

    r77153 r80582  
    2525#include "FontRenderingMode.h"
    2626#include "FontWidthVariant.h"
     27#include "TextOrientation.h"
    2728#include "PlatformString.h"
    2829#include <wtf/Noncopyable.h>
     
    4950        ~FontCustomPlatformData();
    5051
    51         FontPlatformData fontPlatformData(int size, bool bold, bool italic, FontOrientation = Horizontal, FontWidthVariant = RegularWidth, FontRenderingMode = NormalRenderingMode);
     52        FontPlatformData fontPlatformData(int size, bool bold, bool italic, FontOrientation = Horizontal, TextOrientation = TextOrientationVerticalRight, FontWidthVariant = RegularWidth, FontRenderingMode = NormalRenderingMode);
    5253
    5354        static bool supportsFormat(const String&);
  • trunk/Source/WebCore/rendering/InlineFlowBox.cpp

    r79734 r80582  
    326326        return false;
    327327   
    328     if (renderer()->style(m_firstLine)->font().primaryFont()->orientation() == Vertical)
     328    if (renderer()->style(m_firstLine)->fontDescription().textOrientation() == TextOrientationUpright
     329        || renderer()->style(m_firstLine)->font().primaryFont()->hasVerticalGlyphs())
    329330        return true;
    330331
     
    337338                return true;
    338339        } else {
    339             if (curr->renderer()->style(m_firstLine)->font().primaryFont()->orientation() == Vertical)
     340            if (curr->renderer()->style(m_firstLine)->font().primaryFont()->hasVerticalGlyphs())
    340341                return true;
    341342           
     
    348349            if (usedFonts) {
    349350                for (size_t i = 0; i < usedFonts->size(); ++i) {
    350                     if (usedFonts->at(i)->orientation() == Vertical)
     351                    if (usedFonts->at(i)->hasVerticalGlyphs())
    351352                        return true;
    352353                }
  • trunk/Source/WebCore/rendering/style/RenderStyle.h

    r80438 r80582  
    5959#include "StyleVisualData.h"
    6060#include "TextDirection.h"
     61#include "TextOrientation.h"
    6162#include "ThemeTypes.h"
    6263#include "TransformOperations.h"
     
    12121213    static WritingMode initialWritingMode() { return TopToBottomWritingMode; }
    12131214    static TextCombine initialTextCombine() { return TextCombineNone; }
     1215    static TextOrientation initialTextOrientation() { return TextOrientationVerticalRight; }
    12141216    static EDisplay initialDisplay() { return INLINE; }
    12151217    static EEmptyCell initialEmptyCells() { return SHOW; }
Note: See TracChangeset for help on using the changeset viewer.