From e8d3199b5154012c1109085741b53f36b3a59282 Mon Sep 17 00:00:00 2001 From: Adrian Cumiskey Date: Thu, 17 Jul 2008 18:49:36 +0000 Subject: [PATCH] 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 --- .../org/apache/fop/fo/FOPropertyMapping.java | 2 +- .../fop/render/afp/fonts/AFPFontCollection.java | 16 ++++++++++++++++ 2 files changed, 17 insertions(+), 1 deletion(-) 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); -- 2.39.5