From: Andreas L. Delmelle Date: Thu, 31 Aug 2006 13:56:32 +0000 (+0000) Subject: Tweak: look for default font-style/weight before trying default font-family X-Git-Tag: fop-0_93~106 X-Git-Url: https://source.dussan.org/?a=commitdiff_plain;h=9629bae165e39283dfc2194ac56e4093824dc456;p=xmlgraphics-fop.git 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 --- 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);