]> source.dussan.org Git - xmlgraphics-fop.git/commitdiff
FOP-2299: Non Unicode named glyphs not loaded for Type1 fonts
authorRobert Meyer <rmeyer@apache.org>
Mon, 21 Oct 2013 14:54:09 +0000 (14:54 +0000)
committerRobert Meyer <rmeyer@apache.org>
Mon, 21 Oct 2013 14:54:09 +0000 (14:54 +0000)
git-svn-id: https://svn.apache.org/repos/asf/xmlgraphics/fop/trunk@1534195 13f79535-47bb-0310-9956-ffa450edef68

src/java/org/apache/fop/fonts/type1/AFMFile.java
src/java/org/apache/fop/fonts/type1/Type1FontLoader.java

index f6bc3b16342d5463b9cdb237a56c2f96fedee776..2aa718ea0ced0959ef6affc0d033d73ef34876b3 100644 (file)
@@ -319,7 +319,7 @@ public class AFMFile {
      */
     public void addCharMetrics(AFMCharMetrics metrics) {
         String name = metrics.getCharName();
-        if (metrics.getUnicodeSequence() == null) {
+        if (metrics.getUnicodeSequence() == null && name.equals(".notdef")) {
             //Ignore as no Unicode assignment is possible
             return;
         }
index 853e23eb5e423a39c661d1ba9569bda109785f20..dddf2a3a30de828f13b19de79379de16173590fb 100644 (file)
@@ -393,10 +393,7 @@ public class Type1FontLoader extends FontLoader {
         List<AFMCharMetrics> chars = afm.getCharMetrics();
         for (AFMCharMetrics charMetrics : chars) {
             if (charMetrics.getCharCode() >= 0) {
-                String u = charMetrics.getUnicodeSequence();
-                if (u != null && u.length() == 1) {
-                    mappingCount++;
-                }
+                mappingCount++;
             }
         }
         // ...and now build the table.
@@ -409,6 +406,10 @@ public class Type1FontLoader extends FontLoader {
                 String unicodes = charMetrics.getUnicodeSequence();
                 if (unicodes == null) {
                     log.info("No Unicode mapping for glyph: " + charMetrics);
+                    table[idx] = charMetrics.getCharCode();
+                    idx++;
+                    table[idx] = charMetrics.getCharCode();
+                    idx++;
                 } else if (unicodes.length() == 1) {
                     table[idx] = charMetrics.getCharCode();
                     idx++;