Changeset 188377 in webkit
- Timestamp:
- Aug 12, 2015, 10:36:21 PM (11 years ago)
- Location:
- trunk
- Files:
-
- 2 added
- 6 edited
-
LayoutTests/ChangeLog (modified) (1 diff)
-
LayoutTests/fast/text/system-font-punctuation.html (added)
-
LayoutTests/platform/ios-simulator/fast/text/system-font-punctuation-expected.txt (added)
-
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
-
trunk/LayoutTests/ChangeLog
r188376 r188377 1 2015-08-12 Myles C. Maxfield <mmaxfield@apple.com> 2 3 [Cocoa] [CJK-configured device] System font has vertical punctuation 4 https://bugs.webkit.org/show_bug.cgi?id=147964 5 <rdar://problem/22256660> 6 7 Reviewed by Dean Jackson. 8 9 Make sure punctuation isn't vertical. 10 11 * fast/text/system-font-punctuation.html: Added. 12 * platform/ios-simulator/fast/text/system-font-punctuation-expected.txt: Added 13 * platform/mac/fast/text/system-font-punctuation-expected.txt: Added 14 1 15 2015-08-12 Alexey Proskuryakov <ap@apple.com> 2 16 -
trunk/Source/WebCore/ChangeLog
r188375 r188377 1 2015-08-12 Myles C. Maxfield <mmaxfield@apple.com> 2 3 [Cocoa] [CJK-configured device] System font has vertical punctuation 4 https://bugs.webkit.org/show_bug.cgi?id=147964 5 <rdar://problem/22256660> 6 7 Reviewed by Dean Jackson. 8 9 GlyphPage::fill() has multiple code paths to accomplish its goal. It uses the shouldUseCoreText() helper 10 function to determine which one of the paths should be taken. However, not all of the code paths in 11 GlyphPage::fill() are able of handling all situations. Indeed, the CoreText code paths in GlyphPage::fill() 12 are only able to handle the situations which shouldUseCoreText() returns true for. This happens in the 13 following cases: 14 15 1. If the font is a composite font 16 2. If the font is used for text-combine 17 3. If the font has vertical glyphs 18 19 In r187693, I added one more case to this list: If the font is the system font. However, I failed to add 20 the necessary support to GlyphPage::fill() for this case. Becasue of this, we just happened to fall into 21 the case of vertical fonts (just by coincidence), which causes us to use 22 CTFontGetVerticalGlyphsForCharacters() instead of CTFontGetGlyphsForCharacters(). 23 24 The solution is to adopt the same behavior we were using before r187693. Back then, we were using 25 CGFontGetGlyphsForUnichars(), which always returned horizontal glyphs. We should simply adopt this same 26 behavior, except in the Core Text case. Therefore, this patch is just a simple check to see if we are 27 using the system font when determining which Core Text function to use. 28 29 Test: fast/text/system-font-punctuation.html 30 31 * platform/graphics/FontDescription.h: 32 (WebCore::FontDescription::setWidthVariant): 33 * platform/graphics/FontPlatformData.h: 34 (WebCore::FontPlatformData::isForTextCombine): 35 * platform/graphics/mac/GlyphPageMac.cpp: 36 (WebCore::shouldUseCoreText): 37 (WebCore::GlyphPage::fill): 38 * rendering/RenderCombineText.cpp: 39 (WebCore::RenderCombineText::combineText): 40 1 41 2015-08-12 Jinyoung Hur <hur.ims@navercorp.com> 2 42 -
trunk/Source/WebCore/platform/graphics/FontDescription.h
r187626 r188377 125 125 void setOrientation(FontOrientation orientation) { m_orientation = orientation; } 126 126 void setNonCJKGlyphOrientation(NonCJKGlyphOrientation orientation) { m_nonCJKGlyphOrientation = orientation; } 127 void setWidthVariant(FontWidthVariant widthVariant) { m_widthVariant = widthVariant; } 127 void setWidthVariant(FontWidthVariant widthVariant) { m_widthVariant = widthVariant; } // Make sure new callers of this sync with FontPlatformData::isForTextCombine()! 128 128 void setLocale(const AtomicString&); 129 129 void setFeatureSettings(PassRefPtr<FontFeatureSettings> settings) { m_featureSettings = settings; } -
trunk/Source/WebCore/platform/graphics/FontPlatformData.h
r187806 r188377 138 138 FontOrientation orientation() const { return m_orientation; } 139 139 FontWidthVariant widthVariant() const { return m_widthVariant; } 140 bool isForTextCombine() const { return widthVariant() != RegularWidth; } // Keep in sync with callers of FontDescription::setWidthVariant(). 140 141 141 142 void setOrientation(FontOrientation orientation) { m_orientation = orientation; } -
trunk/Source/WebCore/platform/graphics/mac/GlyphPageMac.cpp
r188263 r188377 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. -
trunk/Source/WebCore/rendering/RenderCombineText.cpp
r182609 r188377 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.