]> source.dussan.org Git - xmlgraphics-fop.git/commitdiff
Tweak: look for default font-style/weight before trying default font-family
authorAndreas L. Delmelle <adelmelle@apache.org>
Thu, 31 Aug 2006 13:56:32 +0000 (13:56 +0000)
committerAndreas L. Delmelle <adelmelle@apache.org>
Thu, 31 Aug 2006 13:56:32 +0000 (13:56 +0000)
git-svn-id: https://svn.apache.org/repos/asf/xmlgraphics/fop/trunk@438923 13f79535-47bb-0310-9956-ffa450edef68

src/java/org/apache/fop/fonts/FontInfo.java

index 993de884898b5b143848513885fc8f24f11ce04a..987bb94b797197f5b1bbbe812465e8eceafcb674 100644 (file)
@@ -143,19 +143,26 @@ public class FontInfo {
                 return null;
             }
             
-            // try the same font-family and weight with default style
+            // only if the font may be substituted
+            // fallback 1: try the same font-family and weight with default style
             if (f == null) {
                 key = createFontKey(family, "normal", weight);
                 f = getInternalFontKey(key);
             }
             
-            // then try any family with orig style/weight
+            // fallback 2: try the same font-family with default style and weight
+            if (f == null) {
+                key = createFontKey(family, "normal", 400);
+                f = getInternalFontKey(key);
+            }
+            
+            // fallback 3: try any family with orig style/weight
             if (f == null) {
                 key = createFontKey("any", style, weight);
                 f = getInternalFontKey(key);
             }
 
-            // then use default
+            // last resort: use default
             if (f == null) {
                 key = Font.DEFAULT_FONT;
                 f = getInternalFontKey(key);