Changeset 79174 in webkit
- Timestamp:
- Feb 20, 2011 8:37:38 PM (13 years ago)
- Location:
- trunk/Source/WebCore
- Files:
-
- 5 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/Source/WebCore/ChangeLog
r79169 r79174 1 2011-02-20 Sheriff Bot <webkit.review.bot@gmail.com> 2 3 Unreviewed, rolling out r79169. 4 http://trac.webkit.org/changeset/79169 5 https://bugs.webkit.org/show_bug.cgi?id=54846 6 7 Made unexpected results for tests without CJK characters 8 (Requested by tkent on #webkit). 9 10 * platform/graphics/chromium/FontCacheChromiumWin.cpp: 11 (WebCore::FontCache::createFontPlatformData): 12 * platform/graphics/chromium/FontPlatformDataChromiumWin.cpp: 13 (WebCore::FontPlatformData::FontPlatformData): 14 (WebCore::FontPlatformData::operator=): 15 * platform/graphics/chromium/FontPlatformDataChromiumWin.h: 16 (WebCore::FontPlatformData::orientation): 17 * platform/graphics/skia/FontCustomPlatformData.cpp: 18 (WebCore::FontCustomPlatformData::fontPlatformData): 19 1 20 2011-02-20 Chun-Lung Huang <alvincl.huang@gmail.com> 2 21 -
trunk/Source/WebCore/platform/graphics/chromium/FontCacheChromiumWin.cpp
r79169 r79174 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/bb688137617 // 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 else622 updatedFamilyName = family;623 624 615 // Windows will always give us a valid pointer here, even if the face name 625 616 // is non-existent. We have to double-check and see if the family name was 626 617 // really used. 627 618 String winName; 628 HFONT hfont = createFontIndirectAndGetWinName( updatedFamilyName, &winfont, &winName);619 HFONT hfont = createFontIndirectAndGetWinName(family, &winfont, &winName); 629 620 if (!hfont) 630 621 return 0; … … 632 623 // FIXME: Do we need to use predefined fonts "guaranteed" to exist 633 624 // when we're running in layout-test mode? 634 if (!equalIgnoringCase( updatedFamilyName, winName)) {625 if (!equalIgnoringCase(family, winName)) { 635 626 // For CJK fonts with both English and native names, 636 627 // GetTextFace returns a native name under the font's "locale" … … 640 631 // compare it with what's requested in the first place. 641 632 String altName; 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 } 633 if (!LookupAltName(family, altName) || 634 !equalIgnoringCase(altName, winName)) { 635 DeleteObject(hfont); 636 return 0; 652 637 } 653 638 } 654 639 655 return new FontPlatformData(hfont, fontDescription.computedPixelSize(), fontDescription.orientation()); 656 } 657 658 } 640 return new FontPlatformData(hfont, 641 fontDescription.computedPixelSize()); 642 } 643 644 } -
trunk/Source/WebCore/platform/graphics/chromium/FontPlatformDataChromiumWin.cpp
r79169 r79174 47 47 , m_scriptCache(0) 48 48 , m_scriptFontProperties(0) 49 , m_orientation(Horizontal)50 49 { 51 50 } … … 56 55 , m_scriptCache(0) 57 56 , m_scriptFontProperties(0) 58 , m_orientation(Horizontal)59 57 { 60 58 } 61 59 62 FontPlatformData::FontPlatformData(HFONT font, float size , FontOrientation orientation)60 FontPlatformData::FontPlatformData(HFONT font, float size) 63 61 : m_font(RefCountedHFONT::create(font)) 64 62 , m_size(size) 65 63 , m_scriptCache(0) 66 64 , m_scriptFontProperties(0) 67 , m_orientation(orientation)68 65 { 69 66 } … … 75 72 , m_scriptCache(0) 76 73 , m_scriptFontProperties(0) 77 , m_orientation(Horizontal)78 74 { 79 75 } … … 84 80 , m_scriptCache(0) 85 81 , m_scriptFontProperties(0) 86 , m_orientation(Horizontal)87 82 { 88 83 } … … 93 88 m_font = data.m_font; 94 89 m_size = data.m_size; 95 m_orientation = data.m_orientation;96 90 97 91 // The following fields will get re-computed if necessary. -
trunk/Source/WebCore/platform/graphics/chromium/FontPlatformDataChromiumWin.h
r79169 r79174 58 58 FontPlatformData(WTF::HashTableDeletedValueType); 59 59 FontPlatformData(); 60 FontPlatformData(HFONT, float size , FontOrientation = Horizontal);60 FontPlatformData(HFONT, float size); 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 m_orientation; }73 FontOrientation orientation() const { return Horizontal; } // FIXME: Implement. 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;131 130 132 131 mutable SCRIPT_CACHE m_scriptCache; -
trunk/Source/WebCore/platform/graphics/skia/FontCustomPlatformData.cpp
r79169 r79174 79 79 return FontPlatformData(); 80 80 } 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())); 81 memcpy(logFont.lfFaceName, m_name.charactersWithNullTermination(), 82 sizeof(logFont.lfFaceName[0]) * (1 + m_name.length())); 89 83 90 84 // FIXME: almost identical to FillLogFont in FontCacheWin.cpp. … … 106 100 107 101 HFONT hfont = CreateFontIndirect(&logFont); 108 return FontPlatformData(hfont, size , orientation);102 return FontPlatformData(hfont, size); 109 103 #elif OS(LINUX) || OS(FREEBSD) || PLATFORM(BREWMP) 110 104 ASSERT(m_fontReference);
Note: See TracChangeset
for help on using the changeset viewer.