Index: /trunk/src/gui/text/qfontdatabase.cpp
===================================================================
--- /trunk/src/gui/text/qfontdatabase.cpp	(revision 317)
+++ /trunk/src/gui/text/qfontdatabase.cpp	(revision 318)
@@ -145,4 +145,7 @@
                                 uint yres = 0, uint avgwidth = 0, bool add = false);
 #endif // Q_WS_X11
+#ifdef Q_WS_PM
+    QList<QFontDatabase::WritingSystem> systems;
+#endif
 #if defined(Q_WS_QWS) || defined(Q_WS_PM)
     QByteArray fileName;
@@ -224,4 +227,7 @@
             free(pixelSizes[count].encodings);
 #endif
+#ifdef Q_WS_PM
+            pixelSizes[count].systems.~QList<QFontDatabase::WritingSystem>();
+#endif
 #if defined(Q_WS_QWS) || defined(Q_WS_PM)
             pixelSizes[count].fileName.~QByteArray();
@@ -279,4 +285,7 @@
     pixelSizes[count].count = 0;
     pixelSizes[count].encodings = 0;
+#endif
+#ifdef Q_WS_PM
+    new (&pixelSizes[count].systems) QList<QFontDatabase::WritingSystem>;
 #endif
 #if defined(Q_WS_QWS) || defined(Q_WS_PM)
@@ -965,4 +974,19 @@
 #endif // Q_WS_X11
 
+#if defined(Q_WS_PM)
+static bool sizeSupportsScript(int script, QtFontSize *size)
+{
+    // empty writing system list means we support all
+    // (see qfontdatabase_pm.cpp for explanation)
+    if (size->systems.isEmpty())
+        return true;
+    foreach (QFontDatabase::WritingSystem ws, size->systems) {
+        if (scriptForWritingSystem[ws] == script)
+            return true;
+    }
+    return false;
+}
+#endif // Q_WS_PM
+
 #if !defined(Q_WS_MAC)
 static
@@ -1046,4 +1070,11 @@
                 }
 #endif
+#ifdef Q_WS_PM
+                if (!sizeSupportsScript(script, style->pixelSizes + x)) {
+                    FM_DEBUG("          size %3d does not support the script we want",
+                             style->pixelSizes[x].pixelSize);
+                    continue;
+                }
+#endif
 
                 unsigned int d;
@@ -1090,4 +1121,13 @@
         }
 #endif // Q_WS_X11
+#ifdef Q_WS_PM
+        if (size) {
+            if (!sizeSupportsScript(script, size)) {
+                size = 0;
+                FM_DEBUG("          foundry doesn't support the script we want");
+                continue;
+            }
+        }
+#endif
 
         unsigned int this_score = 0x0000;
Index: /trunk/src/gui/text/qfontdatabase_pm.cpp
===================================================================
--- /trunk/src/gui/text/qfontdatabase_pm.cpp	(revision 317)
+++ /trunk/src/gui/text/qfontdatabase_pm.cpp	(revision 318)
@@ -295,15 +295,5 @@
                     else
                         cached.styleKey.weight = QFont::Black;
-
-                    // @todo "Workplace Sans" from Alex Taylor has weight class
-                    // < 400 whic makes it Light. It has some bad side effects
-                    // in Qt, in particular, requesting Normal will select Bold
-                    // instead of Light if "Workplace Sans Bold" is also installed.
-                    // For this reason, we override the weight here. Remove the
-                    // hack if the font is changed to Normal.
-                    if (cached.familyName == QLatin1String("Workplace Sans")) {
-                        if (cached.styleKey.weight == QFont::Light)
-                            cached.styleKey.weight = QFont::Normal;
-                    }
+FD_DEBUG("os2_table->usWeightClass %u", os2_table->usWeightClass);
 
                     switch (os2_table->usWidthClass) {
@@ -329,4 +319,5 @@
                     cached.systems =
                         determineWritingSystemsFromTrueTypeBits(unicodeRange, codePageRange);
+FD_DEBUG() << "cached.systems" << cached.systems;
                 } else {
                     // we've only got simple weight information and no stretch
@@ -402,17 +393,12 @@
             family->fixedPitch = cached.fixedPitch;
 
-            if (cached.systems.isEmpty() || cached.familyName == QLatin1String("Workplace Sans")) {
+            if (cached.systems.isEmpty()) {
                 // it was hard or impossible to determine the actual writing system
                 // of the font (as in case of OS/2 bitmap and PFB fonts for which it is
                 // usually simply reported that they support standard/system codepages).
                 // Pretend that we support all writing systems to not miss the one.
-                // Note that "Workplace Sans" TTF by Alex Taylor doesn't provide correct
-                // unicode and codepage ranges in os2_table for some reason but versions
-                // 0.4 and earlier are known to support many popular scripts so hack it.
                 //
                 // @todo find a proper way to detect actual supported scripts to make
                 // sure these fonts are not matched for scripts they don't support.
-                //
-                // @todo remove the hack for "Workplace Sans" once it is corrected
                 for (int ws = 0; ws < QFontDatabase::WritingSystemsCount; ++ws)
                     family->writingSystems[ws] = QtFontFamily::Supported;
@@ -437,4 +423,5 @@
                 size->fileName = file;
                 size->fileIndex = cached.index;
+                size->systems = cached.systems;
             }
 
@@ -446,4 +433,5 @@
                 size->fileName = file;
                 size->fileIndex = cached.index;
+                size->systems = cached.systems;
             }
         }
