diff options
Diffstat (limited to 'src/java/org/apache')
-rw-r--r-- | src/java/org/apache/fop/fonts/truetype/TTFFile.java | 4 | ||||
-rw-r--r-- | src/java/org/apache/fop/fonts/truetype/TTFFontLoader.java | 12 |
2 files changed, 9 insertions, 7 deletions
diff --git a/src/java/org/apache/fop/fonts/truetype/TTFFile.java b/src/java/org/apache/fop/fonts/truetype/TTFFile.java index 9fd6adbce..a1b6319ed 100644 --- a/src/java/org/apache/fop/fonts/truetype/TTFFile.java +++ b/src/java/org/apache/fop/fonts/truetype/TTFFile.java @@ -1691,6 +1691,10 @@ public class TTFFile { return result; } + String getGlyphName(int glyphIndex) { + return mtxTab[glyphIndex].getName(); + } + /** * Static main method to get info about a TrueType font. * @param args The command line arguments diff --git a/src/java/org/apache/fop/fonts/truetype/TTFFontLoader.java b/src/java/org/apache/fop/fonts/truetype/TTFFontLoader.java index df8cce1b2..10e618adf 100644 --- a/src/java/org/apache/fop/fonts/truetype/TTFFontLoader.java +++ b/src/java/org/apache/fop/fonts/truetype/TTFFontLoader.java @@ -27,8 +27,6 @@ import java.util.Map; import org.apache.commons.io.IOUtils; -import org.apache.xmlgraphics.fonts.Glyphs; - import org.apache.fop.fonts.BFEntry; import org.apache.fop.fonts.CIDFontType; import org.apache.fop.fonts.EncodingMode; @@ -187,11 +185,11 @@ public class TTFFontLoader extends FontLoader { for (char u = (char)ce.getUnicodeStart(); u <= ce.getUnicodeEnd(); u++) { int codePoint = singleFont.getEncoding().mapChar(u); if (codePoint <= 0) { - String unicode = Character.toString(u); - String charName = Glyphs.stringToGlyph(unicode); - if (charName.length() > 0) { - NamedCharacter nc = new NamedCharacter(charName, unicode); - int glyphIndex = ce.getGlyphStartIndex() + u - ce.getUnicodeStart(); + int glyphIndex = ce.getGlyphStartIndex() + u - ce.getUnicodeStart(); + String glyphName = ttf.getGlyphName(glyphIndex); + if (glyphName != "") { + String unicode = Character.toString(u); + NamedCharacter nc = new NamedCharacter(glyphName, unicode); singleFont.addUnencodedCharacter(nc, wx[glyphIndex]); } } |