Changeset 94352 in webkit
- Timestamp:
- Sep 1, 2011, 3:32:43 PM (15 years ago)
- Location:
- trunk
- Files:
-
- 3 added
- 3 edited
-
LayoutTests/ChangeLog (modified) (1 diff)
-
LayoutTests/fast/text/fallback-traits-fixup.html (added)
-
LayoutTests/platform/mac/fast/text/fallback-traits-fixup-expected.png (added)
-
LayoutTests/platform/mac/fast/text/fallback-traits-fixup-expected.txt (added)
-
Source/WebCore/ChangeLog (modified) (1 diff)
-
Source/WebCore/platform/graphics/mac/FontCacheMac.mm (modified) (2 diffs)
Legend:
- Unmodified
- Added
- Removed
-
trunk/LayoutTests/ChangeLog
r94351 r94352 1 2011-09-01 Dan Bernstein <mitz@apple.com> 2 3 <rdar://problem/9528843> STIX glyphs not rendered on this stackoverflow answer 4 https://bugs.webkit.org/show_bug.cgi?id=67444 5 6 Reviewed by Darin Adler. 7 8 * fast/text/fallback-traits-fixup.html: Added. 9 * platform/mac/fast/text/fallback-traits-fixup-expected.png: Added. 10 * platform/mac/fast/text/fallback-traits-fixup-expected.txt: Added. 11 1 12 2011-09-01 James Robinson <jamesr@chromium.org> 2 13 -
trunk/Source/WebCore/ChangeLog
r94350 r94352 1 2011-09-01 Dan Bernstein <mitz@apple.com> 2 3 <rdar://problem/9528843> STIX glyphs not rendered on this stackoverflow answer 4 https://bugs.webkit.org/show_bug.cgi?id=67444 5 6 Reviewed by Darin Adler. 7 8 Test: fast/text/fallback-traits-fixup.html 9 10 After obtaining STIX Regular as a fallback font for some characters, getFontDataForCharacters() 11 proceeded to ask for a font from the same family having the desired traits and weight (because 12 wkGetFontInLanguageForRange() does not preserve traits and weight). The returned font was different 13 and happened to not contain the desired character. 14 15 * platform/graphics/mac/FontCacheMac.mm: 16 (WebCore::FontCache::getFontDataForCharacters): Only ask for a family member with the desired 17 traits and weight if the substitute font does not already have them, and only use the returned 18 member if it actually contains the desired character. 19 1 20 2011-09-01 Kentaro Hara <haraken@google.com> 2 21 -
trunk/Source/WebCore/platform/graphics/mac/FontCacheMac.mm
r93140 r94352 102 102 const SimpleFontData* FontCache::getFontDataForCharacters(const Font& font, const UChar* characters, int length) 103 103 { 104 const FontPlatformData& platformData = font.fontDataAt(0)->fontDataForCharacter(characters[0])->platformData(); 104 UChar32 character; 105 U16_GET(characters, 0, 0, length, character); 106 const FontPlatformData& platformData = font.fontDataAt(0)->fontDataForCharacter(character)->platformData(); 105 107 NSFont *nsFont = platformData.font(); 106 108 … … 141 143 } 142 144 143 if (NSFont *bestVariation = [fontManager fontWithFamily:[substituteFont familyName] traits:traits weight:weight size:size])144 substituteFont = bestVariation;145 146 substituteFont = font.fontDescription().usePrinterFont() ? [substituteFont printerFont] : [substituteFont screenFont];147 148 145 NSFontTraitMask substituteFontTraits = [fontManager traitsOfFont:substituteFont]; 149 146 NSInteger substituteFontWeight = [fontManager weightOfFont:substituteFont]; 147 148 if (traits != substituteFontTraits || weight != substituteFontWeight) { 149 if (NSFont *bestVariation = [fontManager fontWithFamily:[substituteFont familyName] traits:traits weight:weight size:size]) { 150 if (([fontManager traitsOfFont:bestVariation] != substituteFontTraits || [fontManager weightOfFont:bestVariation] != substituteFontWeight) 151 && [[bestVariation coveredCharacterSet] longCharacterIsMember:character]) 152 substituteFont = bestVariation; 153 } 154 } 155 156 substituteFont = font.fontDescription().usePrinterFont() ? [substituteFont printerFont] : [substituteFont screenFont]; 157 158 substituteFontTraits = [fontManager traitsOfFont:substituteFont]; 159 substituteFontWeight = [fontManager weightOfFont:substituteFont]; 150 160 151 161 FontPlatformData alternateFont(substituteFont, platformData.size(),
Note:
See TracChangeset
for help on using the changeset viewer.