Changeset 177957 in webkit
- Timestamp:
- Jan 6, 2015, 6:49:24 AM (10 years ago)
- Location:
- trunk/Source/WebCore
- Files:
-
- 5 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/Source/WebCore/ChangeLog
r177956 r177957 1 2015-01-06 Antti Koivisto <antti@apple.com> 2 3 Resolve mirroring and variant in Font instead of FontGlyphs 4 https://bugs.webkit.org/show_bug.cgi?id=140079 5 6 Reviewed by Darin Adler. 7 8 Make FontGlyphs more focused. It doesn't need to know about resolving variants and mirroring. 9 10 * platform/graphics/Font.cpp: 11 (WebCore::Font::glyphDataForCharacter): 12 * platform/graphics/Font.h: 13 (WebCore::Font::glyphDataForCharacter): Deleted. 14 * platform/graphics/FontGlyphs.cpp: 15 (WebCore::FontGlyphs::glyphDataForCharacter): 16 * platform/graphics/FontGlyphs.h: 17 1 18 2015-01-06 Shivakumar JM <shiva.jm@samsung.com> 2 19 -
trunk/Source/WebCore/platform/graphics/Font.cpp
r177955 r177957 416 416 glyphName = ""; 417 417 return width(run); 418 } 419 420 GlyphData Font::glyphDataForCharacter(UChar32 c, bool mirror, FontDataVariant variant) const 421 { 422 if (variant == AutoVariant) { 423 if (m_fontDescription.smallCaps() && !primaryFontData().isSVGFont()) { 424 UChar32 upperC = u_toupper(c); 425 if (upperC != c) { 426 c = upperC; 427 variant = SmallCapsVariant; 428 } else 429 variant = NormalVariant; 430 } else 431 variant = NormalVariant; 432 } 433 434 if (mirror) 435 c = u_charMirror(c); 436 437 return m_glyphs->glyphDataForCharacter(c, m_fontDescription, variant); 418 438 } 419 439 -
trunk/Source/WebCore/platform/graphics/Font.h
r177955 r177957 186 186 const SimpleFontData& primaryFontData() const; 187 187 const FontData* fontDataAt(unsigned) const; 188 GlyphData glyphDataForCharacter(UChar32 c, bool mirror, FontDataVariant variant = AutoVariant) const 189 { 190 return m_glyphs->glyphDataForCharacter(m_fontDescription, c, mirror, variant); 191 } 188 GlyphData glyphDataForCharacter(UChar32, bool mirror, FontDataVariant = AutoVariant) const; 189 192 190 #if PLATFORM(COCOA) 193 191 const SimpleFontData* fontDataForCombiningCharacterSequence(const UChar*, size_t length, FontDataVariant) const; -
trunk/Source/WebCore/platform/graphics/FontGlyphs.cpp
r177955 r177957 361 361 } 362 362 363 GlyphData FontGlyphs::glyphDataForCharacter( const FontDescription& description, UChar32 c, bool mirror, FontDataVariant variant)363 GlyphData FontGlyphs::glyphDataForCharacter( UChar32 c, const FontDescription& description, FontDataVariant variant) 364 364 { 365 365 ASSERT(isMainThread()); 366 367 if (variant == AutoVariant) { 368 if (description.smallCaps() && !primarySimpleFontData(description).isSVGFont()) { 369 UChar32 upperC = u_toupper(c); 370 if (upperC != c) { 371 c = upperC; 372 variant = SmallCapsVariant; 373 } else 374 variant = NormalVariant; 375 } else 376 variant = NormalVariant; 377 } 378 379 if (mirror) 380 c = u_charMirror(c); 366 ASSERT(variant != AutoVariant); 381 367 382 368 if (variant != NormalVariant) -
trunk/Source/WebCore/platform/graphics/FontGlyphs.h
r177955 r177957 53 53 bool isForPlatformFont() const { return m_isForPlatformFont; } 54 54 55 GlyphData glyphDataForCharacter( const FontDescription&, UChar32, bool mirror, FontDataVariant);55 GlyphData glyphDataForCharacter(UChar32, const FontDescription&, FontDataVariant); 56 56 57 57 bool isFixedPitch(const FontDescription&);
Note:
See TracChangeset
for help on using the changeset viewer.