pdfbox-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From leleu...@apache.org
Subject svn commit: r1201518 - /pdfbox/trunk/preflight/src/main/java/org/apache/padaf/preflight/font/AbstractFontContainer.java
Date Sun, 13 Nov 2011 21:20:07 GMT
Author: leleueri
Date: Sun Nov 13 21:20:07 2011
New Revision: 1201518

URL: http://svn.apache.org/viewvc?rev=1201518&view=rev
Log:
PDFBOX-1162 : Font error in "preflight" .....when validating the attached PDF/A 

Modified:
    pdfbox/trunk/preflight/src/main/java/org/apache/padaf/preflight/font/AbstractFontContainer.java

Modified: pdfbox/trunk/preflight/src/main/java/org/apache/padaf/preflight/font/AbstractFontContainer.java
URL: http://svn.apache.org/viewvc/pdfbox/trunk/preflight/src/main/java/org/apache/padaf/preflight/font/AbstractFontContainer.java?rev=1201518&r1=1201517&r2=1201518&view=diff
==============================================================================
--- pdfbox/trunk/preflight/src/main/java/org/apache/padaf/preflight/font/AbstractFontContainer.java
(original)
+++ pdfbox/trunk/preflight/src/main/java/org/apache/padaf/preflight/font/AbstractFontContainer.java
Sun Nov 13 21:20:07 2011
@@ -159,8 +159,10 @@ public abstract class AbstractFontContai
   }
 
   protected void checkWidthsConsistency(int cid, float widthProvidedByPdfDictionary, float
widthInFontProgram) throws GlyphException {
-  	if(!(Math.floor(widthInFontProgram) == widthProvidedByPdfDictionary || Math.round(widthInFontProgram)
== widthProvidedByPdfDictionary)) {
-  	  GlyphException e = new GlyphException(ValidationConstants.ERROR_FONTS_METRICS, cid,

+	  // a delta of 1/1000 unit is allowed
+	  float epsilon = widthInFontProgram/1000;
+	  if(!(Math.floor(widthInFontProgram-epsilon) <= widthProvidedByPdfDictionary &&
Math.round(widthInFontProgram+epsilon) >= widthProvidedByPdfDictionary)) {
+		  GlyphException e = new GlyphException(ValidationConstants.ERROR_FONTS_METRICS, cid, 
 				  				"Width of the character \"" + cid 
 				  				+ "\" in the font program \""
 				  				+ this.font.getBaseFont() 



Mime
View raw message