Changeset 79169 in webkit
- Timestamp:
- Feb 20, 2011 7:28:22 PM (13 years ago)
- Location:
- trunk/Source/WebCore
- Files:
-
- 5 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/Source/WebCore/ChangeLog
r79168 r79169 1 2011-02-20 Chun-Lung Huang <alvincl.huang@gmail.com> 2 3 Reviewed by Kent Tamura. 4 5 On Chromium Windows, glyphs in vertical text tests are rotated 90 6 degrees clockwise. https://bugs.webkit.org/show_bug.cgi?id=51450 7 8 This platform dependent patch makes Chromium Windows show the 9 vertical writing text correctly. Job was done by adding a prefix '@' 10 in front of the font family name (Windows Only). No new tests added. 11 12 * platform/graphics/chromium/FontCacheChromiumWin.cpp: 13 (WebCore::FontCache::createFontPlatformData): 14 * platform/graphics/chromium/FontPlatformDataChromiumWin.cpp: 15 (WebCore::FontPlatformData::FontPlatformData): 16 (WebCore::FontPlatformData::operator=): 17 * platform/graphics/chromium/FontPlatformDataChromiumWin.h: 18 (WebCore::FontPlatformData::orientation): 19 * platform/graphics/skia/FontCustomPlatformData.cpp: 20 (WebCore::FontCustomPlatformData::fontPlatformData): 21 1 22 2011-02-20 Simon Fraser <simon.fraser@apple.com> 2 23 -
trunk/Source/WebCore/platform/graphics/chromium/FontCacheChromiumWin.cpp
r76679 r79169 613 613 FillLogFont(fontDescription, &winfont); 614 614 615 // Take the orientation into consideration. For vertical: add "@" in front of the family name. 616 // "@" is a built-in behaviour for Windows platform. http://msdn.microsoft.com/en-us/goglobal/bb688137 617 // Try to create hfont with family name "@font-family-name". 618 AtomicString updatedFamilyName; 619 if (fontDescription.orientation() == Vertical && !family.startsWith("@") && !family.isEmpty()) 620 updatedFamilyName = "@" + String(family); 621 else 622 updatedFamilyName = family; 623 615 624 // Windows will always give us a valid pointer here, even if the face name 616 625 // is non-existent. We have to double-check and see if the family name was 617 626 // really used. 618 627 String winName; 619 HFONT hfont = createFontIndirectAndGetWinName( family, &winfont, &winName);628 HFONT hfont = createFontIndirectAndGetWinName(updatedFamilyName, &winfont, &winName); 620 629 if (!hfont) 621 630 return 0; … … 623 632 // FIXME: Do we need to use predefined fonts "guaranteed" to exist 624 633 // when we're running in layout-test mode? 625 if (!equalIgnoringCase( family, winName)) {634 if (!equalIgnoringCase(updatedFamilyName, winName)) { 626 635 // For CJK fonts with both English and native names, 627 636 // GetTextFace returns a native name under the font's "locale" … … 631 640 // compare it with what's requested in the first place. 632 641 String altName; 633 if (!LookupAltName(family, altName) || 634 !equalIgnoringCase(altName, winName)) { 635 DeleteObject(hfont); 636 return 0; 642 if (fontDescription.orientation() == Vertical) { 643 if (!LookupAltName(family, altName) || !equalIgnoringCase("@" + altName, winName)) { 644 DeleteObject(hfont); 645 return 0; 646 } 647 } else { 648 if (!LookupAltName(updatedFamilyName, altName) || !equalIgnoringCase(altName, winName)) { 649 DeleteObject(hfont); 650 return 0; 651 } 637 652 } 638 653 } 639 654 640 return new FontPlatformData(hfont, 641 fontDescription.computedPixelSize()); 642 } 643 644 } 655 return new FontPlatformData(hfont, fontDescription.computedPixelSize(), fontDescription.orientation()); 656 } 657 658 } -
trunk/Source/WebCore/platform/graphics/chromium/FontPlatformDataChromiumWin.cpp
r76340 r79169 47 47 , m_scriptCache(0) 48 48 , m_scriptFontProperties(0) 49 , m_orientation(Horizontal) 49 50 { 50 51 } … … 55 56 , m_scriptCache(0) 56 57 , m_scriptFontProperties(0) 58 , m_orientation(Horizontal) 57 59 { 58 60 } 59 61 60 FontPlatformData::FontPlatformData(HFONT font, float size )62 FontPlatformData::FontPlatformData(HFONT font, float size, FontOrientation orientation) 61 63 : m_font(RefCountedHFONT::create(font)) 62 64 , m_size(size) 63 65 , m_scriptCache(0) 64 66 , m_scriptFontProperties(0) 67 , m_orientation(orientation) 65 68 { 66 69 } … … 72 75 , m_scriptCache(0) 73 76 , m_scriptFontProperties(0) 77 , m_orientation(Horizontal) 74 78 { 75 79 } … … 80 84 , m_scriptCache(0) 81 85 , m_scriptFontProperties(0) 86 , m_orientation(Horizontal) 82 87 { 83 88 } … … 88 93 m_font = data.m_font; 89 94 m_size = data.m_size; 95 m_orientation = data.m_orientation; 90 96 91 97 // The following fields will get re-computed if necessary. -
trunk/Source/WebCore/platform/graphics/chromium/FontPlatformDataChromiumWin.h
r71970 r79169 58 58 FontPlatformData(WTF::HashTableDeletedValueType); 59 59 FontPlatformData(); 60 FontPlatformData(HFONT, float size );60 FontPlatformData(HFONT, float size, FontOrientation = Horizontal); 61 61 FontPlatformData(float size, bool bold, bool oblique); 62 62 FontPlatformData(const FontPlatformData&); … … 71 71 float size() const { return m_size; } 72 72 73 FontOrientation orientation() const { return Horizontal; } // FIXME: Implement.73 FontOrientation orientation() const { return m_orientation; } 74 74 75 75 unsigned hash() const … … 128 128 RefPtr<RefCountedHFONT> m_font; 129 129 float m_size; // Point size of the font in pixels. 130 FontOrientation m_orientation; 130 131 131 132 mutable SCRIPT_CACHE m_scriptCache; -
trunk/Source/WebCore/platform/graphics/skia/FontCustomPlatformData.cpp
r77153 r79169 79 79 return FontPlatformData(); 80 80 } 81 memcpy(logFont.lfFaceName, m_name.charactersWithNullTermination(), 82 sizeof(logFont.lfFaceName[0]) * (1 + m_name.length())); 81 82 String newName; 83 if (orientation == Vertical && !m_name.startsWith("@")) 84 newName = "@" + m_name; 85 else 86 newName = m_name; 87 88 memcpy(logFont.lfFaceName, newName.charactersWithNullTermination(), sizeof(logFont.lfFaceName[0]) * (1 + newName.length())); 83 89 84 90 // FIXME: almost identical to FillLogFont in FontCacheWin.cpp. … … 100 106 101 107 HFONT hfont = CreateFontIndirect(&logFont); 102 return FontPlatformData(hfont, size );108 return FontPlatformData(hfont, size, orientation); 103 109 #elif OS(LINUX) || OS(FREEBSD) || PLATFORM(BREWMP) 104 110 ASSERT(m_fontReference);
Note: See TracChangeset
for help on using the changeset viewer.