Bug 2489 - leader CID font bug
Summary: leader CID font bug
Status: CLOSED DUPLICATE of bug 2556
Alias: None
Product: Fop - Now in Jira
Classification: Unclassified
Component: pdf (show other bugs)
Version: all
Hardware: All other
: P3 major
Target Milestone: ---
Assignee: fop-dev
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2001-07-06 17:15 UTC by hin-tak leung
Modified: 2012-04-01 13:51 UTC (History)
0 users



Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description hin-tak leung 2001-07-06 17:15:28 UTC
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,
==============================
Comment 1 Tore Engvig 2001-07-17 13:24:51 UTC

*** This bug has been marked as a duplicate of 2556 ***
Comment 2 Glenn Adams 2012-04-01 13:51:09 UTC
batch transition to closed remaining pre-FOP1.0 resolved bugs