From: Adrian Cumiskey Date: Thu, 17 Jul 2008 18:49:36 +0000 (+0000) Subject: Merged revisions 677668,677679 via svnmerge from X-Git-Tag: fop-1_0~376^2~136 X-Git-Url: https://source.dussan.org/?a=commitdiff_plain;h=e8d3199b5154012c1109085741b53f36b3a59282;p=xmlgraphics-fop.git Merged revisions 677668,677679 via svnmerge from https://svn.apache.org/repos/asf/xmlgraphics/fop/trunk ........ r677668 | acumiskey | 2008-07-17 19:25:11 +0100 (Thu, 17 Jul 2008) | 2 lines Undoing this change for now until a better fix can be found as it breaks 4 unit tests. ........ r677679 | acumiskey | 2008-07-17 19:47:58 +0100 (Thu, 17 Jul 2008) | 2 lines I'm not really happy with this workaround, it is a bit of a hack (as Symbol and ZapfDingbats are not available) but it does prevent the IllegalArgumentException from being thrown. ........ git-svn-id: https://svn.apache.org/repos/asf/xmlgraphics/fop/branches/Temp_AFPGOCAResources@677680 13f79535-47bb-0310-9956-ffa450edef68 --- diff --git a/src/java/org/apache/fop/fo/FOPropertyMapping.java b/src/java/org/apache/fop/fo/FOPropertyMapping.java index e7e76176a..60317cf0d 100644 --- a/src/java/org/apache/fop/fo/FOPropertyMapping.java +++ b/src/java/org/apache/fop/fo/FOPropertyMapping.java @@ -963,7 +963,7 @@ public final class FOPropertyMapping implements Constants { // font-family m = new FontFamilyProperty.Maker(PR_FONT_FAMILY); m.setInherited(true); - m.setDefault("sans-serif"); + m.setDefault("sans-serif,Symbol,ZapfDingbats"); m.addShorthand(s_generics[PR_FONT]); addPropertyMaker("font-family", m); diff --git a/src/java/org/apache/fop/render/afp/fonts/AFPFontCollection.java b/src/java/org/apache/fop/render/afp/fonts/AFPFontCollection.java index 55953daf0..df2f4a105 100644 --- a/src/java/org/apache/fop/render/afp/fonts/AFPFontCollection.java +++ b/src/java/org/apache/fop/render/afp/fonts/AFPFontCollection.java @@ -97,6 +97,22 @@ public class AFPFontCollection implements FontCollection { fontInfo.addMetrics("F" + num, bf); num++; } + if (fontInfo.fontLookup("Symbol", Font.STYLE_NORMAL, Font.WEIGHT_NORMAL) == null) { + FontTriplet ft = fontInfo.fontLookup( + "sans-serif", Font.STYLE_NORMAL, Font.WEIGHT_NORMAL); + fontInfo.addFontProperties( + fontInfo.getInternalFontKey(ft), + "Symbol", Font.STYLE_NORMAL, Font.WEIGHT_NORMAL); + num++; + } + if (fontInfo.fontLookup("ZapfDingbats", Font.STYLE_NORMAL, Font.WEIGHT_NORMAL) == null) { + FontTriplet ft = fontInfo.fontLookup( + "sans-serif", Font.STYLE_NORMAL, Font.WEIGHT_NORMAL); + fontInfo.addFontProperties( + fontInfo.getInternalFontKey(ft), + "ZapfDingbats", Font.STYLE_NORMAL, Font.WEIGHT_NORMAL); + num++; + } if (fontInfo.fontLookup("any", Font.STYLE_NORMAL, Font.WEIGHT_NORMAL) == null) { FontTriplet ft = fontInfo.fontLookup( "sans-serif", Font.STYLE_NORMAL, Font.WEIGHT_NORMAL);