From 9629bae165e39283dfc2194ac56e4093824dc456 Mon Sep 17 00:00:00 2001 From: "Andreas L. Delmelle" Date: Thu, 31 Aug 2006 13:56:32 +0000 Subject: [PATCH] Tweak: look for default font-style/weight before trying default font-family 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 | 13 ++++++++++--- 1 file changed, 10 insertions(+), 3 deletions(-) diff --git a/src/java/org/apache/fop/fonts/FontInfo.java b/src/java/org/apache/fop/fonts/FontInfo.java index 993de8848..987bb94b7 100644 --- a/src/java/org/apache/fop/fonts/FontInfo.java +++ b/src/java/org/apache/fop/fonts/FontInfo.java @@ -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); -- 2.39.5