Changeset 46428 in webkit
- Timestamp:
- Jul 27, 2009 2:31:55 PM (15 years ago)
- Location:
- trunk/WebCore
- Files:
-
- 4 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/WebCore/ChangeLog
r46427 r46428 1 2009-07-27 Mike Fenton <mike.fenton@torchmobile.com> 2 3 Reviewed by Adam Treat. 4 5 Add mapping FontWeight to QFont::Weight values as requested via FIXME. 6 https://bugs.webkit.org/show_bug.cgi?id=27663 7 8 * platform/graphics/qt/FontCacheQt.cpp: 9 (WebCore::FontPlatformDataCacheKey::FontPlatformDataCacheKey): 10 * platform/graphics/qt/FontPlatformData.h: 11 (WebCore::FontPlatformData::toQFontWeight): 12 * platform/graphics/qt/FontPlatformDataQt.cpp: 13 (WebCore::FontPlatformData::FontPlatformData): 14 1 15 2009-07-27 Jakub Wieczorek <faw217@gmail.com> 2 16 -
trunk/WebCore/platform/graphics/qt/FontCacheQt.cpp
r46124 r46428 66 66 { 67 67 // FIXME: Map all FontWeight values to QFont weights in FontPlatformData's ctor and follow it here 68 if ( description.weight() >= FontWeight600)68 if (FontPlatformData::toQFontWeight(description.weight()) > QFont::Normal) 69 69 m_bold = true; 70 70 -
trunk/WebCore/platform/graphics/qt/FontPlatformData.h
r46388 r46428 2 2 Copyright (C) 2008 Nokia Corporation and/or its subsidiary(-ies) 3 3 Copyright (C) 2008 Holger Hans Peter Freyther 4 Copyright (C) 2009 Torch Mobile Inc. http://www.torchmobile.com/ 4 5 5 6 This library is free software; you can redistribute it and/or … … 41 42 FontPlatformData(const QFont&, bool bold); 42 43 44 static inline QFont::Weight toQFontWeight(FontWeight fontWeight) 45 { 46 switch (fontWeight) { 47 case FontWeight100: 48 case FontWeight200: 49 return QFont::Light; // QFont::Light == Weight of 25 50 case FontWeight600: 51 return QFont::DemiBold; // QFont::DemiBold == Weight of 63 52 case FontWeight700: 53 case FontWeight800: 54 return QFont::Bold; // QFont::Bold == Weight of 75 55 case FontWeight900: 56 return QFont::Black; // QFont::Black == Weight of 87 57 case FontWeight300: 58 case FontWeight400: 59 case FontWeight500: 60 default: 61 return QFont::Normal; // QFont::Normal == Weight of 50 62 } 63 } 64 43 65 QFont font() const { return m_font; } 44 66 float size() const { return m_size; } -
trunk/WebCore/platform/graphics/qt/FontPlatformDataQt.cpp
r46388 r46428 1 1 /* 2 2 Copyright (C) 2008 Holger Hans Peter Freyther 3 Copyright (C) 2009 Torch Mobile Inc. http://www.torchmobile.com/ 3 4 4 5 This library is free software; you can redistribute it and/or … … 43 44 m_font.setPixelSize(qRound(description.computedSize())); 44 45 m_font.setItalic(description.italic()); 45 // FIXME: Map all FontWeight values to QFont weights. 46 if (description.weight() >= FontWeight600) { 47 m_font.setWeight(QFont::Bold); 48 m_bold = true; 49 } else 50 m_font.setWeight(QFont::Normal); 46 47 m_font.setWeight(toQFontWeight(description.weight())); 48 m_bold = m_font.bold(); 51 49 52 50 bool smallCaps = description.smallCaps();
Note: See TracChangeset
for help on using the changeset viewer.