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 2019/05/27 16:59:24 UTC
svn commit: r1860145 -
/pdfbox/branches/issue45/pdfbox/src/main/java/org/apache/pdfbox/text/LegacyPDFStreamEngine.java
Author: tilman
Date: Mon May 27 16:59:24 2019
New Revision: 1860145
URL: http://svn.apache.org/viewvc?rev=1860145&view=rev
Log:
PDFBOX-4553: narrow condition to discard capHeight
Modified:
pdfbox/branches/issue45/pdfbox/src/main/java/org/apache/pdfbox/text/LegacyPDFStreamEngine.java
Modified: pdfbox/branches/issue45/pdfbox/src/main/java/org/apache/pdfbox/text/LegacyPDFStreamEngine.java
URL: http://svn.apache.org/viewvc/pdfbox/branches/issue45/pdfbox/src/main/java/org/apache/pdfbox/text/LegacyPDFStreamEngine.java?rev=1860145&r1=1860144&r2=1860145&view=diff
==============================================================================
--- pdfbox/branches/issue45/pdfbox/src/main/java/org/apache/pdfbox/text/LegacyPDFStreamEngine.java (original)
+++ pdfbox/branches/issue45/pdfbox/src/main/java/org/apache/pdfbox/text/LegacyPDFStreamEngine.java Mon May 27 16:59:24 2019
@@ -179,11 +179,11 @@ class LegacyPDFStreamEngine extends PDFS
{
glyphHeight = capHeight;
}
- // PDFBOX-3464, PDFBOX-448:
+ // PDFBOX-3464, PDFBOX-4480, PDFBOX-4553:
// sometimes even CapHeight has very high value, but Ascent and Descent are ok
float ascent = fontDescriptor.getAscent();
float descent = fontDescriptor.getDescent();
- if (ascent > 0 && descent < 0 &&
+ if (capHeight > ascent && ascent > 0 && descent < 0 &&
((ascent - descent) / 2 < glyphHeight || Float.compare(glyphHeight, 0) == 0))
{
glyphHeight = (ascent - descent) / 2;