From 480edcfb80906fbad780060093c7e943b91f8430 Mon Sep 17 00:00:00 2001 From: Robert Meyer Date: Mon, 21 Oct 2013 14:54:09 +0000 Subject: [PATCH] FOP-2299: Non Unicode named glyphs not loaded for Type1 fonts 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 | 2 +- src/java/org/apache/fop/fonts/type1/Type1FontLoader.java | 9 +++++---- 2 files changed, 6 insertions(+), 5 deletions(-) diff --git a/src/java/org/apache/fop/fonts/type1/AFMFile.java b/src/java/org/apache/fop/fonts/type1/AFMFile.java index f6bc3b163..2aa718ea0 100644 --- a/src/java/org/apache/fop/fonts/type1/AFMFile.java +++ b/src/java/org/apache/fop/fonts/type1/AFMFile.java @@ -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; } diff --git a/src/java/org/apache/fop/fonts/type1/Type1FontLoader.java b/src/java/org/apache/fop/fonts/type1/Type1FontLoader.java index 853e23eb5..dddf2a3a3 100644 --- a/src/java/org/apache/fop/fonts/type1/Type1FontLoader.java +++ b/src/java/org/apache/fop/fonts/type1/Type1FontLoader.java @@ -393,10 +393,7 @@ public class Type1FontLoader extends FontLoader { List 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++; -- 2.39.5