pdfbox-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From til...@apache.org
Subject svn commit: r1824622 - /pdfbox/branches/2.0/pdfbox/src/main/java/org/apache/pdfbox/rendering/PageDrawer.java
Date Sat, 17 Feb 2018 18:45:33 GMT
Author: tilman
Date: Sat Feb 17 18:45:33 2018
New Revision: 1824622

URL: http://svn.apache.org/viewvc?rev=1824622&view=rev
Log:
PDFBOX-4106: Fix non-embedded vertical font rendering, by Aaron Madlon-Kay

Modified:
    pdfbox/branches/2.0/pdfbox/src/main/java/org/apache/pdfbox/rendering/PageDrawer.java

Modified: pdfbox/branches/2.0/pdfbox/src/main/java/org/apache/pdfbox/rendering/PageDrawer.java
URL: http://svn.apache.org/viewvc/pdfbox/branches/2.0/pdfbox/src/main/java/org/apache/pdfbox/rendering/PageDrawer.java?rev=1824622&r1=1824621&r2=1824622&view=diff
==============================================================================
--- pdfbox/branches/2.0/pdfbox/src/main/java/org/apache/pdfbox/rendering/PageDrawer.java (original)
+++ pdfbox/branches/2.0/pdfbox/src/main/java/org/apache/pdfbox/rendering/PageDrawer.java Sat
Feb 17 18:45:33 2018
@@ -424,8 +424,10 @@ public class PageDrawer extends PDFGraph
         GeneralPath path = glyph2D.getPathForCharacterCode(code);
         if (path != null)
         {
-            // stretch non-embedded glyph if it does not match the width contained in the
PDF
-            if (!font.isEmbedded())
+            // Stretch non-embedded glyph if it does not match the height/width contained
in the PDF.
+            // Vertical fonts have zero X displacement, so the following code scales to 0
if we don't skip it.
+            // TODO: How should vertical fonts be handled?
+            if (!font.isEmbedded() && !font.isVertical())
             {
                 float fontWidth = font.getWidthFromFont(code);
                 if (fontWidth > 0 && // ignore spaces



Mime
View raw message