Changeset 130570 in webkit


Ignore:
Timestamp:
Oct 5, 2012 5:38:16 PM (12 years ago)
Author:
wangxianzhu@chromium.org
Message:

OpenTypeVerticalData issue with DroidSansFallback.ttf on chromium-android and chromium-linux
https://bugs.webkit.org/show_bug.cgi?id=97824

Reviewed by Tony Chang.

Source/WebCore:

The issue occurred when a font that contains vert GSUB table but doesn't have
a DFLT script and the first script doesn't have vert feature. Added logic to
handle the case.

Test: fast/writing-mode/vertical-subst-font-vert-no-dflt.html

  • platform/graphics/opentype/OpenTypeVerticalData.cpp:

(FeatureList):
(WebCore::OpenType::FeatureList::findFeature): Added to find the matching feature in FeatureList.
(WebCore::OpenType::GSUBTable::feature): Added logic to handle the case of no DFLT script and no vert feature under the first script.

LayoutTests:

Ref test for the change. The punctuations in the vertical text are expected to
be substituted with the corresponding vertical forms.

  • fast/writing-mode/vertical-subst-font-vert-no-dflt-expected.html: Added.
  • fast/writing-mode/vertical-subst-font-vert-no-dflt.html: Added.
  • platform/mac/TestExpectations: Added the new test as it fails on Mac because of https://bugs.webkit.org/show_bug.cgi?id=98560.
Location:
trunk
Files:
2 added
5 edited

Legend:

Unmodified
Added
Removed
  • trunk/LayoutTests/ChangeLog

    r130569 r130570  
     12012-10-05  Xianzhu Wang  <wangxianzhu@chromium.org>
     2
     3        OpenTypeVerticalData issue with DroidSansFallback.ttf on chromium-android and chromium-linux
     4        https://bugs.webkit.org/show_bug.cgi?id=97824
     5
     6        Reviewed by Tony Chang.
     7
     8        Ref test for the change. The punctuations in the vertical text are expected to
     9        be substituted with the corresponding vertical forms.
     10
     11        * fast/writing-mode/vertical-subst-font-vert-no-dflt-expected.html: Added.
     12        * fast/writing-mode/vertical-subst-font-vert-no-dflt.html: Added.
     13        * platform/mac/TestExpectations: Added the new test as it fails on Mac because of https://bugs.webkit.org/show_bug.cgi?id=98560.
     14
    1152012-10-05  Tony Chang  <tony@chromium.org>
    216
  • trunk/LayoutTests/platform/mac/TestExpectations

    r130569 r130570  
    13121312# Requires TestRunner displayInvalidatedRegion() support.
    13131313webkit.org/b/98523 fast/images/repaint-subrect-grid.html [ Failure ]
     1314
     1315# Rendering/Layout issue of CJK vertical text with some font.
     1316webkit.org/b/98560 fast/writing-mode/vertical-subst-font-vert-no-dflt.html [ ImageOnlyFailure ]
  • trunk/Source/WebCore/ChangeLog

    r130569 r130570  
     12012-10-05  Xianzhu Wang  <wangxianzhu@chromium.org>
     2
     3        OpenTypeVerticalData issue with DroidSansFallback.ttf on chromium-android and chromium-linux
     4        https://bugs.webkit.org/show_bug.cgi?id=97824
     5
     6        Reviewed by Tony Chang.
     7
     8        The issue occurred when a font that contains vert GSUB table but doesn't have
     9        a DFLT script and the first script doesn't have vert feature. Added logic to
     10        handle the case.
     11
     12        Test: fast/writing-mode/vertical-subst-font-vert-no-dflt.html
     13
     14        * platform/graphics/opentype/OpenTypeVerticalData.cpp:
     15        (FeatureList):
     16        (WebCore::OpenType::FeatureList::findFeature): Added to find the matching feature in FeatureList.
     17        (WebCore::OpenType::GSUBTable::feature): Added logic to handle the case of no DFLT script and no vert feature under the first script.
     18
    1192012-10-05  Tony Chang  <tony@chromium.org>
    220
  • trunk/Source/WebCore/platform/graphics/opentype/OpenTypeVerticalData.cpp

    r127361 r130570  
    257257        return 0;
    258258    }
     259
     260    const FeatureTable* findFeature(OpenType::Tag tag, const SharedBuffer& buffer) const
     261    {
     262        for (uint16_t i = 0; i < featureCount; ++i) {
     263            if (isValidEnd(buffer, &features[i]) && features[i].featureTag == tag)
     264                return validateOffset<FeatureTable>(buffer, features[i].featureOffset);
     265        }
     266        return 0;
     267    }
    259268};
    260269
     
    362371        const LangSysTable* langSys = defaultLangSys(buffer);
    363372        const FeatureList* features = featureList(buffer);
    364         if (!langSys || !features)
    365             return 0;
    366         return langSys->feature(featureTag, features, buffer);
     373        if (!features)
     374            return 0;
     375        const FeatureTable* feature = 0;
     376        if (langSys)
     377            feature = langSys->feature(featureTag, features, buffer);
     378        if (!feature) {
     379            // If the font has no langSys table, or has no default script and the first script doesn't
     380            // have the requested feature, then use the first matching feature directly.
     381            feature = features->findFeature(featureTag, buffer);
     382        }
     383        return feature;
    367384    }
    368385
Note: See TracChangeset for help on using the changeset viewer.