[SCM] WebKit Debian packaging branch, webkit-1.2, updated. upstream/1.1.90-6072-g9a69373

vestbo at webkit.org vestbo at webkit.org
Thu Apr 8 00:23:04 UTC 2010


The following commit has been merged in the webkit-1.2 branch:
commit c8f50af094e29594cf04caca6ca450d150af52f6
Author: vestbo at webkit.org <vestbo at webkit.org@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Date:   Mon Dec 7 13:29:20 2009 +0000

    [Qt] Fix support for generic font families
    
    Reviewed by Simon Hausmann.
    
    By not propagating the resolved font family in FontCacheQt and
    only concidering the font description we ended up passing the
    generic font families to Qt directly. Since most systems don't
    have a mapping for these font families we ended up using the
    default font in most cases.
    
    * platform/graphics/qt/FontCacheQt.cpp:
    * platform/graphics/qt/FontPlatformData.h:
    * platform/graphics/qt/FontPlatformDataQt.cpp:
    
    git-svn-id: http://svn.webkit.org/repository/webkit/trunk@51758 268f45cc-cd09-0410-ab3c-d52691b4dbfc

diff --git a/WebCore/ChangeLog b/WebCore/ChangeLog
index 1de35d6..8f380a8 100644
--- a/WebCore/ChangeLog
+++ b/WebCore/ChangeLog
@@ -1,3 +1,19 @@
+2009-12-07  Tor Arne Vestbø  <tor.arne.vestbo at nokia.com>
+
+        Reviewed by Simon Hausmann.
+
+        [Qt] Fix support for generic font families
+
+        By not propagating the resolved font family in FontCacheQt and
+        only concidering the font description we ended up passing the
+        generic font families to Qt directly. Since most systems don't
+        have a mapping for these font families we ended up using the
+        default font in most cases.
+
+        * platform/graphics/qt/FontCacheQt.cpp:
+        * platform/graphics/qt/FontPlatformData.h:
+        * platform/graphics/qt/FontPlatformDataQt.cpp:
+
 2009-12-06  Oliver Hunt  <oliver at apple.com>
 
         Reviewed by Maciej Stachowiak.
diff --git a/WebCore/platform/graphics/qt/FontCacheQt.cpp b/WebCore/platform/graphics/qt/FontCacheQt.cpp
index 648eed7..82fb709 100644
--- a/WebCore/platform/graphics/qt/FontCacheQt.cpp
+++ b/WebCore/platform/graphics/qt/FontCacheQt.cpp
@@ -34,6 +34,8 @@
 #include <wtf/ListHashSet.h>
 #include <wtf/StdLibExtras.h>
 
+#include <QFont>
+
 using namespace WTF;
 
 namespace WebCore {
@@ -49,22 +51,22 @@ const SimpleFontData* FontCache::getFontDataForCharacters(const Font&, const UCh
 
 FontPlatformData* FontCache::getSimilarFontPlatformData(const Font& font)
 {
-    return new FontPlatformData(font.fontDescription());
+    return 0;
 }
 
 FontPlatformData* FontCache::getLastResortFallbackFont(const FontDescription& fontDescription)
 {
-    return new FontPlatformData(fontDescription);
+    const AtomicString fallbackFamily = QFont(fontDescription.family().family()).lastResortFont();
+    return new FontPlatformData(fontDescription, fallbackFamily);
 }
 
 void FontCache::getTraitsInFamily(const AtomicString&, Vector<unsigned>&)
 {
 }
 
-FontPlatformData* FontCache::createFontPlatformData(const FontDescription& fontDescription, const AtomicString&)
+FontPlatformData* FontCache::createFontPlatformData(const FontDescription& fontDescription, const AtomicString& familyName)
 {
-    // FIXME : we must take into account the familly name (second argument)
-    return new FontPlatformData(fontDescription);
+    return new FontPlatformData(fontDescription, familyName);
 }
 
 } // namespace WebCore
diff --git a/WebCore/platform/graphics/qt/FontPlatformData.h b/WebCore/platform/graphics/qt/FontPlatformData.h
index 306ada8..4a3f8bc 100644
--- a/WebCore/platform/graphics/qt/FontPlatformData.h
+++ b/WebCore/platform/graphics/qt/FontPlatformData.h
@@ -65,7 +65,7 @@ class FontPlatformData : public FastAllocBase {
 public:
     FontPlatformData(float size, bool bold, bool oblique);
     FontPlatformData(const FontPlatformData &);
-    FontPlatformData(const FontDescription&, int wordSpacing = 0, int letterSpacing = 0);
+    FontPlatformData(const FontDescription&, const AtomicString& familyName, int wordSpacing = 0, int letterSpacing = 0);
     FontPlatformData(const QFont& font)
         : m_data(new FontPlatformDataPrivate(font))
     {}
diff --git a/WebCore/platform/graphics/qt/FontPlatformDataQt.cpp b/WebCore/platform/graphics/qt/FontPlatformDataQt.cpp
index a0e2a1d..2cc2fc6 100644
--- a/WebCore/platform/graphics/qt/FontPlatformDataQt.cpp
+++ b/WebCore/platform/graphics/qt/FontPlatformDataQt.cpp
@@ -46,16 +46,19 @@ FontPlatformData::FontPlatformData(const FontPlatformData &other) : m_data(other
         ++m_data->refCount;
 }
 
-FontPlatformData::FontPlatformData(const FontDescription& description, int wordSpacing, int letterSpacing)
+FontPlatformData::FontPlatformData(const FontDescription& description, const AtomicString& familyName, int wordSpacing, int letterSpacing)
     : m_data(new FontPlatformDataPrivate())
 {
-    QString familyName;
+    QString familyNames(familyName);
+    if (!familyName.isEmpty())
+        familyNames += QLatin1Char(',');
+
     const FontFamily* family = &description.family();
     while (family) {
-        familyName += family->family();
+        familyNames += family->family();
         family = family->next();
         if (family)
-            familyName += QLatin1Char(',');
+            familyNames += QLatin1Char(',');
     }
     QFont& font = m_data->font;
     font.setFamily(familyName);

-- 
WebKit Debian packaging



More information about the Pkg-webkit-commits mailing list