Changeset 195403 in webkit
- Timestamp:
- Jan 20, 2016, 11:58:28 PM (11 years ago)
- Location:
- branches/safari-601-branch
- Files:
-
- 6 edited
- 2 copied
-
LayoutTests/ChangeLog (modified) (1 diff)
-
LayoutTests/fast/text/system-font-punctuation.html (copied) (copied from trunk/LayoutTests/fast/text/system-font-punctuation.html )
-
LayoutTests/platform/ios-simulator/fast/text/system-font-punctuation-expected.txt (copied) (copied from trunk/LayoutTests/platform/ios-simulator/fast/text/system-font-punctuation-expected.txt )
-
Source/WebCore/ChangeLog (modified) (1 diff)
-
Source/WebCore/platform/graphics/FontDescription.h (modified) (1 diff)
-
Source/WebCore/platform/graphics/FontPlatformData.h (modified) (1 diff)
-
Source/WebCore/platform/graphics/mac/GlyphPageMac.cpp (modified) (2 diffs)
-
Source/WebCore/rendering/RenderCombineText.cpp (modified) (1 diff)
Legend:
- Unmodified
- Added
- Removed
-
branches/safari-601-branch/LayoutTests/ChangeLog
r195402 r195403 1 2016-01-20 Babak Shafiei <bshafiei@apple.com> 2 3 Merge r188377. 4 5 2015-08-12 Myles C. Maxfield <mmaxfield@apple.com> 6 7 [Cocoa] [CJK-configured device] System font has vertical punctuation 8 https://bugs.webkit.org/show_bug.cgi?id=147964 9 <rdar://problem/22256660> 10 11 Reviewed by Dean Jackson. 12 13 Make sure punctuation isn't vertical. 14 15 * fast/text/system-font-punctuation.html: Added. 16 * platform/ios-simulator/fast/text/system-font-punctuation-expected.txt: Added 17 * platform/mac/fast/text/system-font-punctuation-expected.txt: Added 18 1 19 2016-01-20 Babak Shafiei <bshafiei@apple.com> 2 20 -
branches/safari-601-branch/Source/WebCore/ChangeLog
r195402 r195403 1 2016-01-20 Babak Shafiei <bshafiei@apple.com> 2 3 Merge r188377. 4 5 2015-08-12 Myles C. Maxfield <mmaxfield@apple.com> 6 7 [Cocoa] [CJK-configured device] System font has vertical punctuation 8 https://bugs.webkit.org/show_bug.cgi?id=147964 9 <rdar://problem/22256660> 10 11 Reviewed by Dean Jackson. 12 13 GlyphPage::fill() has multiple code paths to accomplish its goal. It uses the shouldUseCoreText() helper 14 function to determine which one of the paths should be taken. However, not all of the code paths in 15 GlyphPage::fill() are able of handling all situations. Indeed, the CoreText code paths in GlyphPage::fill() 16 are only able to handle the situations which shouldUseCoreText() returns true for. This happens in the 17 following cases: 18 19 1. If the font is a composite font 20 2. If the font is used for text-combine 21 3. If the font has vertical glyphs 22 23 In r187693, I added one more case to this list: If the font is the system font. However, I failed to add 24 the necessary support to GlyphPage::fill() for this case. Becasue of this, we just happened to fall into 25 the case of vertical fonts (just by coincidence), which causes us to use 26 CTFontGetVerticalGlyphsForCharacters() instead of CTFontGetGlyphsForCharacters(). 27 28 The solution is to adopt the same behavior we were using before r187693. Back then, we were using 29 CGFontGetGlyphsForUnichars(), which always returned horizontal glyphs. We should simply adopt this same 30 behavior, except in the Core Text case. Therefore, this patch is just a simple check to see if we are 31 using the system font when determining which Core Text function to use. 32 33 Test: fast/text/system-font-punctuation.html 34 35 * platform/graphics/FontDescription.h: 36 (WebCore::FontDescription::setWidthVariant): 37 * platform/graphics/FontPlatformData.h: 38 (WebCore::FontPlatformData::isForTextCombine): 39 * platform/graphics/mac/GlyphPageMac.cpp: 40 (WebCore::shouldUseCoreText): 41 (WebCore::GlyphPage::fill): 42 * rendering/RenderCombineText.cpp: 43 (WebCore::RenderCombineText::combineText): 44 1 45 2016-01-20 Babak Shafiei <bshafiei@apple.com> 2 46 -
branches/safari-601-branch/Source/WebCore/platform/graphics/FontDescription.h
r194287 r195403 178 178 void setOrientation(FontOrientation orientation) { m_orientation = orientation; } 179 179 void setNonCJKGlyphOrientation(NonCJKGlyphOrientation orientation) { m_nonCJKGlyphOrientation = orientation; } 180 void setWidthVariant(FontWidthVariant widthVariant) { m_widthVariant = widthVariant; } 180 void setWidthVariant(FontWidthVariant widthVariant) { m_widthVariant = widthVariant; } // Make sure new callers of this sync with FontPlatformData::isForTextCombine()! 181 181 void setScript(UScriptCode s) { m_script = s; } 182 182 void setFeatureSettings(FontFeatureSettings&& settings) { m_featureSettings = WTF::move(settings); } -
branches/safari-601-branch/Source/WebCore/platform/graphics/FontPlatformData.h
r193671 r195403 136 136 FontOrientation orientation() const { return m_orientation; } 137 137 FontWidthVariant widthVariant() const { return m_widthVariant; } 138 bool isForTextCombine() const { return widthVariant() != RegularWidth; } // Keep in sync with callers of FontDescription::setWidthVariant(). 138 139 139 140 void setOrientation(FontOrientation orientation) { m_orientation = orientation; } -
branches/safari-601-branch/Source/WebCore/platform/graphics/mac/GlyphPageMac.cpp
r195402 r195403 43 43 static bool shouldUseCoreText(const UChar* buffer, unsigned bufferLength, const Font* fontData) 44 44 { 45 // This needs to be kept in sync with GlyphPage::fill(). Currently, the CoreText paths are not able to handle 46 // every situtation. Returning true from this function in a new situation will require you to explicitly add 47 // handling for that situation in the CoreText paths of GlyphPage::fill(). 45 48 if (fontData->platformData().isCompositeFontReference() || fontData->isSystemFont()) 46 49 return true; 47 if (fontData->platformData(). widthVariant() != RegularWidth|| fontData->hasVerticalGlyphs()) {50 if (fontData->platformData().isForTextCombine() || fontData->hasVerticalGlyphs()) { 48 51 // Ideographs don't have a vertical variant or width variants. 49 52 for (unsigned i = 0; i < bufferLength; ++i) { … … 89 92 } 90 93 } else if (!fontData->platformData().isCompositeFontReference()) { 91 if (fontData->platformData().widthVariant() == RegularWidth) 94 // Because we know the implementation of shouldUseCoreText(), if the font isn't for text combine and it isn't a system font, 95 // we know it must have vertical glyphs. 96 if (fontData->platformData().isForTextCombine() || fontData->isSystemFont()) 97 CTFontGetGlyphsForCharacters(fontData->platformData().ctFont(), buffer, glyphs.data(), bufferLength); 98 else 92 99 CTFontGetVerticalGlyphsForCharacters(fontData->platformData().ctFont(), buffer, glyphs.data(), bufferLength); 93 else94 CTFontGetGlyphsForCharacters(fontData->platformData().ctFont(), buffer, glyphs.data(), bufferLength);95 100 // When buffer consists of surrogate pairs, CTFontGetVerticalGlyphsForCharacters and CTFontGetGlyphsForCharacters 96 101 // place the glyphs at indices corresponding to the first character of each pair. -
branches/safari-601-branch/Source/WebCore/rendering/RenderCombineText.cpp
r182609 r195403 118 118 static const FontWidthVariant widthVariants[] = { HalfWidth, ThirdWidth, QuarterWidth }; 119 119 for (size_t i = 0 ; i < WTF_ARRAY_LENGTH(widthVariants) ; ++i) { 120 description.setWidthVariant(widthVariants[i]); 120 description.setWidthVariant(widthVariants[i]); // When modifying this, make sure to keep it in sync with FontPlatformData::isForTextCombine()! 121 121 122 122 FontCascade compressedFont(description, style().fontCascade().letterSpacing(), style().fontCascade().wordSpacing());
Note:
See TracChangeset
for help on using the changeset viewer.