]> source.dussan.org Git - xmlgraphics-fop.git/commitdiff
Merged revisions 677668,677679 via svnmerge from
authorAdrian Cumiskey <acumiskey@apache.org>
Thu, 17 Jul 2008 18:49:36 +0000 (18:49 +0000)
committerAdrian Cumiskey <acumiskey@apache.org>
Thu, 17 Jul 2008 18:49:36 +0000 (18:49 +0000)
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

src/java/org/apache/fop/fo/FOPropertyMapping.java
src/java/org/apache/fop/render/afp/fonts/AFPFontCollection.java

index e7e76176a0c7d2bb1bf0704cf6df80ac3143606e..60317cf0df50009fe11c9696c4fc013c74c8ae8f 100644 (file)
@@ -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);
 
index 55953daf0c231d6f51cb109c7c4d9409658d2a04..df2f4a105798af8a80dcd09b7548f81fe85fc683 100644 (file)
@@ -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);