You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@pdfbox.apache.org by ti...@apache.org on 2018/03/04 18:52:54 UTC
svn commit: r1825833 -
/pdfbox/branches/2.0/pdfbox/src/main/java/org/apache/pdfbox/rendering/PageDrawer.java
Author: tilman
Date: Sun Mar 4 18:52:53 2018
New Revision: 1825833
URL: http://svn.apache.org/viewvc?rev=1825833&view=rev
Log:
PDFBOX-3457: don't stretch glyphs if they are standard 14 or if they don't have an explicit width, by John Hewson
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=1825833&r1=1825832&r2=1825833&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 Sun Mar 4 18:52:53 2018
@@ -427,7 +427,7 @@ public class PageDrawer extends PDFGraph
// 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())
+ if (!font.isEmbedded() && !font.isVertical() && !font.isStandard14() && font.hasExplicitWidth(code))
{
float fontWidth = font.getWidthFromFont(code);
if (fontWidth > 0 && // ignore spaces