You are viewing a plain text version of this content. The canonical link for it is here.
Posted to fop-dev@xmlgraphics.apache.org by bu...@apache.org on 2001/07/07 02:15:29 UTC

[Bug 2489] New: - leader CID font bug

http://nagoya.apache.org/bugzilla/show_bug.cgi?id=2489

*** shadow/2489	Fri Jul  6 17:15:28 2001
--- shadow/2489.tmp.22002	Fri Jul  6 17:15:29 2001
***************
*** 0 ****
--- 1,85 ----
+ +============================================================================+
+ | leader CID font bug                                                        |
+ +----------------------------------------------------------------------------+
+ |        Bug #: 2489                        Product: Fop                     |
+ |       Status: NEW                         Version: all                     |
+ |   Resolution:                            Platform: All                     |
+ |     Severity: Major                    OS/Version: Other                   |
+ |     Priority: Other                     Component: pdf renderer            |
+ +----------------------------------------------------------------------------+
+ |  Assigned To: fop-dev@xml.apache.org                                       |
+ |  Reported By: hintak_leung@yahoo.co.uk                                     |
+ |      CC list: Cc:                                                          |
+ +----------------------------------------------------------------------------+
+ |          URL:                                                              |
+ +============================================================================+
+ |                              DESCRIPTION                                   |
+ If the dots are typeset with a CID font, the result is unpredictable. Here is a
+ patch, which I posted to fop-dev earlier but nobody seems to want to commit 
+ it to CVS after two days...
+ ---------------------
+ Apply this patch to:
+ xml-fop/src/org/apache/fop/layout/LineArea.java
+ 
+ A bug was introduced between version 1.42 and 1.43 of LineArea 
+ which uses a lot of mapChar to cope with bug 1618 (CVS log has
+ a typo error instead to "1681"), and forgot to change the
+ leader calculation.
+ 
+ This bug should have caused FOP to crash with any XSL:FO input 
+ that has a leader with dots or space with non-pdf-standard 
+ fonts. I wonder why nobody spotted it in release 0.19? My 
+ last CVS build was May 16 and it worked fine - the fatal bug 
+ was introduced on 12 June and went into release 0.19 and 
+ went unreported for nearly a month... 
+ 
+ Somebody please patch this into the CVS tree?
+ 
+ =============================================================
+ *** LineArea.java-bad	Tue Jun 12 12:37:42 2001
+ --- LineArea.java	Wed Jul  4 00:44:44 2001
+ ***************
+ *** 751,769 ****
+          * creates a leader as String out of the given char and the leader 
+ length
+          * and wraps it in an InlineArea which is returned
+          */
+ !     private InlineArea buildSimpleLeader(int charNumber, int leaderLength) {
+ ! 		int width = this.currentFontState.width(charNumber);
+   		if (width == 0)	{
+ - 			char c = (char) charNumber;
+   			MessageHandler.errorln("char " + c + " has width 0. 
+ Using width 100 instead.");
+   			width = 100;
+   		}
+           int factor = (int) Math.floor (leaderLength /
+                                          width);
+           char [] leaderChars = new char [factor];
+ -         char fillChar = (char) charNumber;
+           for (int i = 0; i < factor; i ++) {
+ !             leaderChars[i] = fillChar;
+           }
+           WordArea leaderPatternArea =
+             new WordArea(currentFontState, this.red, this.green,
+ --- 751,767 ----
+          * creates a leader as String out of the given char and the leader 
+ length
+          * and wraps it in an InlineArea which is returned
+          */
+ !     private InlineArea buildSimpleLeader(char c, int leaderLength) {
+ ! 		int width = this.currentFontState.width
+ (currentFontState.mapChar(c));
+   		if (width == 0)	{
+   			MessageHandler.errorln("char " + c + " has width 0. 
+ Using width 100 instead.");
+   			width = 100;
+   		}
+           int factor = (int) Math.floor (leaderLength /
+                                          width);
+           char [] leaderChars = new char [factor];
+           for (int i = 0; i < factor; i ++) {
+ !             leaderChars[i] = c;
+           }
+           WordArea leaderPatternArea =
+             new WordArea(currentFontState, this.red, this.green,
+ ==============================

---------------------------------------------------------------------
To unsubscribe, e-mail: fop-dev-unsubscribe@xml.apache.org
For additional commands, email: fop-dev-help@xml.apache.org