Author: adelmelle
Date: Thu Aug 31 06:56:32 2006
New Revision: 438923
URL: http://svn.apache.org/viewvc?rev=438923&view=rev
Log:
Tweak: look for default font-style/weight before trying default font-family
Modified:
xmlgraphics/fop/trunk/src/java/org/apache/fop/fonts/FontInfo.java
Modified: xmlgraphics/fop/trunk/src/java/org/apache/fop/fonts/FontInfo.java
URL:
http://svn.apache.org/viewvc/xmlgraphics/fop/trunk/src/java/org/apache/fop/fonts/FontInfo.java?rev=438923&r1=438922&r2=438923&view=diff
==============================================================================
--- xmlgraphics/fop/trunk/src/java/org/apache/fop/fonts/FontInfo.java (original)
+++ xmlgraphics/fop/trunk/src/java/org/apache/fop/fonts/FontInfo.java Thu Aug
31 06:56:32 2006
@@ -143,19 +143,26 @@
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);
---------------------------------------------------------------------
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]