Changeset 131005 in webkit
- Timestamp:
- Oct 10, 2012 8:20:37 PM (12 years ago)
- Location:
- trunk
- Files:
-
- 2 added
- 5 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/LayoutTests/ChangeLog
r131004 r131005 1 2012-10-10 Dan Bernstein <mitz@apple.com> 2 3 <rdar://problem/12472460> text-combine doesn’t use third- and quarter-width variants when used with @font-face 4 https://bugs.webkit.org/show_bug.cgi?id=98961 5 6 Reviewed by Tim Horton. 7 8 * fast/text/text-combine-with-font-face-expected.html: Added. 9 * fast/text/text-combine-with-font-face.html: Added. 10 1 11 2012-10-10 Elliott Sprehn <esprehn@chromium.org> 2 12 -
trunk/Source/WebCore/ChangeLog
r131004 r131005 1 2012-10-10 Dan Bernstein <mitz@apple.com> 2 3 <rdar://problem/12472460> text-combine doesn’t use third- and quarter-width variants when used with @font-face 4 https://bugs.webkit.org/show_bug.cgi?id=98961 5 6 Reviewed by Tim Horton. 7 8 Test: fast/text/text-combine-with-font-face.html 9 10 * css/CSSSegmentedFontFace.cpp: 11 (WebCore::CSSSegmentedFontFace::getFontData): Added the width variant to the 12 key used for entries in the font data table, so that we can return different 13 font data for different width variants. 14 * platform/graphics/FontWidthVariant.h: Defined FontWidthVariantWidth for 15 use in the computation of the above key. 16 * rendering/RenderCombineText.cpp: 17 (WebCore::RenderCombineText::combineText): Added a local variable to store 18 the font selector before changing the font description. Previously, by the time 19 we tried to get the font selector from the font, it had already been cleared, 20 so we called Font::update() with a 0 font selector, meaning @font-face fonts 21 could not be selected. 22 1 23 2012-10-10 Elliott Sprehn <esprehn@chromium.org> 2 24 -
trunk/Source/WebCore/css/CSSSegmentedFontFace.cpp
r130612 r131005 106 106 107 107 FontTraitsMask desiredTraitsMask = fontDescription.traitsMask(); 108 unsigned hashKey = ((fontDescription.computedPixelSize() + 1) << (FontTraitsMaskWidth + 1)) | ((fontDescription.orientation() == Vertical ? 1 : 0) << FontTraitsMaskWidth) | desiredTraitsMask; 108 unsigned hashKey = ((fontDescription.computedPixelSize() + 1) << (FontTraitsMaskWidth + FontWidthVariantWidth + 1)) 109 | ((fontDescription.orientation() == Vertical ? 1 : 0) << (FontTraitsMaskWidth + FontWidthVariantWidth)) 110 | fontDescription.widthVariant() << FontTraitsMaskWidth 111 | desiredTraitsMask; 109 112 110 113 RefPtr<SegmentedFontData>& fontData = m_fontDataTable.add(hashKey, 0).iterator->value; -
trunk/Source/WebCore/platform/graphics/FontWidthVariant.h
r95901 r131005 29 29 namespace WebCore { 30 30 31 enum FontWidthVariant { RegularWidth, HalfWidth, ThirdWidth, QuarterWidth }; 31 enum FontWidthVariant { 32 RegularWidth, 33 HalfWidth, 34 ThirdWidth, 35 QuarterWidth, 36 LastFontWidthVariant = QuarterWidth 37 }; 38 39 const unsigned FontWidthVariantWidth = 2; 40 41 COMPILE_ASSERT(LastFontWidthVariant >> FontWidthVariantWidth == 0, FontWidthVariantWidth_is_correct); 32 42 33 43 } // namespace WebCore -
trunk/Source/WebCore/rendering/RenderCombineText.cpp
r126359 r131005 104 104 m_isCombined = m_combinedTextWidth <= emWidth; 105 105 106 FontSelector* fontSelector = style()->font().fontSelector(); 107 106 108 if (m_isCombined) 107 109 shouldUpdateFont = style()->setFontDescription(description); // Need to change font orientation to horizontal. … … 112 114 description.setWidthVariant(widthVariants[i]); 113 115 Font compressedFont = Font(description, style()->font().letterSpacing(), style()->font().wordSpacing()); 114 compressedFont.update( style()->font().fontSelector());116 compressedFont.update(fontSelector); 115 117 float runWidth = compressedFont.width(run); 116 118 if (runWidth <= emWidth) { … … 129 131 130 132 if (shouldUpdateFont) 131 style()->font().update( style()->font().fontSelector());133 style()->font().update(fontSelector); 132 134 133 135 if (m_isCombined) {
Note: See TracChangeset
for help on using the changeset viewer.