pdfbox-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From til...@apache.org
Subject svn commit: r1614392 - /pdfbox/branches/1.8/pdfbox/src/main/java/org/apache/pdfbox/pdmodel/font/PDTrueTypeFont.java
Date Tue, 29 Jul 2014 15:52:44 GMT
Author: tilman
Date: Tue Jul 29 15:52:44 2014
New Revision: 1614392

URL: http://svn.apache.org/r1614392
Log:
PDFBOX-2166: Treat a font with only one with as monospaced even if fixedPitch flag isn't set

Modified:
    pdfbox/branches/1.8/pdfbox/src/main/java/org/apache/pdfbox/pdmodel/font/PDTrueTypeFont.java

Modified: pdfbox/branches/1.8/pdfbox/src/main/java/org/apache/pdfbox/pdmodel/font/PDTrueTypeFont.java
URL: http://svn.apache.org/viewvc/pdfbox/branches/1.8/pdfbox/src/main/java/org/apache/pdfbox/pdmodel/font/PDTrueTypeFont.java?rev=1614392&r1=1614391&r2=1614392&view=diff
==============================================================================
--- pdfbox/branches/1.8/pdfbox/src/main/java/org/apache/pdfbox/pdmodel/font/PDTrueTypeFont.java
(original)
+++ pdfbox/branches/1.8/pdfbox/src/main/java/org/apache/pdfbox/pdmodel/font/PDTrueTypeFont.java
Tue Jul 29 15:52:44 2014
@@ -398,7 +398,7 @@ public class PDTrueTypeFont extends PDSi
             int[] widthValues = hMet.getAdvanceWidth();
             // some monospaced fonts provide only one value for the width 
             // instead of an array containing the same value for every glyphid 
-            boolean isMonospaced = fd.isFixedPitch();
+            boolean isMonospaced = fd.isFixedPitch() || widthValues.length == 1;
             int nWidths=lastChar-firstChar+1;
             List<Float> widths = new ArrayList<Float>(nWidths);
             // use the first width as default



Mime
View raw message