You are viewing a plain text version of this content. The canonical link for it is here.
Posted to fop-commits@xmlgraphics.apache.org by rm...@apache.org on 2015/08/01 17:35:13 UTC

svn commit: r1693719 - /xmlgraphics/fop/trunk/src/java/org/apache/fop/fonts/truetype/OpenFont.java

Author: rmeyer
Date: Sat Aug  1 15:35:12 2015
New Revision: 1693719

URL: http://svn.apache.org/r1693719
Log:
FOP-2494 - Unable to use Ubuntu Mono Font

Modified:
    xmlgraphics/fop/trunk/src/java/org/apache/fop/fonts/truetype/OpenFont.java

Modified: xmlgraphics/fop/trunk/src/java/org/apache/fop/fonts/truetype/OpenFont.java
URL: http://svn.apache.org/viewvc/xmlgraphics/fop/trunk/src/java/org/apache/fop/fonts/truetype/OpenFont.java?rev=1693719&r1=1693718&r2=1693719&view=diff
==============================================================================
--- xmlgraphics/fop/trunk/src/java/org/apache/fop/fonts/truetype/OpenFont.java (original)
+++ xmlgraphics/fop/trunk/src/java/org/apache/fop/fonts/truetype/OpenFont.java Sat Aug  1 15:35:12 2015
@@ -1274,7 +1274,7 @@ public abstract class OpenFont {
         case 0x00020000:
             log.debug("PostScript format 2");
             postScriptVersion = PostScriptVersion.V2;
-            int numGlyphStrings = 0;
+            int numGlyphStrings = 257;
 
             // Read Number of Glyphs
             int l = fontFile.readTTFUShort();
@@ -1283,9 +1283,8 @@ public abstract class OpenFont {
             for (int i = 0; i < l; i++) {
                 mtxTab[i].setIndex(fontFile.readTTFUShort());
 
-                if (mtxTab[i].getIndex() > 257) {
-                    //Index is not in the Macintosh standard set
-                    numGlyphStrings++;
+                if (mtxTab[i].getIndex() > numGlyphStrings) {
+                    numGlyphStrings = mtxTab[i].getIndex();
                 }
 
                 if (log.isTraceEnabled()) {
@@ -1294,7 +1293,7 @@ public abstract class OpenFont {
             }
 
             // firstChar=minIndex;
-            String[] psGlyphsBuffer = new String[numGlyphStrings];
+            String[] psGlyphsBuffer = new String[numGlyphStrings - 257];
             if (log.isDebugEnabled()) {
                 log.debug("Reading " + numGlyphStrings
                         + " glyphnames, that are not in the standard Macintosh"



---------------------------------------------------------------------
To unsubscribe, e-mail: fop-commits-unsubscribe@xmlgraphics.apache.org
For additional commands, e-mail: fop-commits-help@xmlgraphics.apache.org