Nullpointer exception in InlineStackingLayoutManager

2003-03-08 Thread Rainer Garus
Since several weeks there is a nullpointer exception in InlineStackingLayoutManager.
The appended fo file is the shortest example I can construct to reproduce the error
(using Java 1.3.1_04 on Linux and snapshot xml-fop_20030308173134.tar.gz).
Remarks:

Removing text-alignjustify there is no exception
Removing hyphenate=true language=de there is no exception
Removing fo:inline and /fo:inline there is no exception
There is also no exception in the following case:
fo:inline
Beantwoord deze vraag met ja, als u met de Cancel bewerking wilt doorgaan, waarop de 
functie anders
/fo:inline
Regards
Rainer Garus


?xml version=1.0 encoding=UTF-8?
fo:root xmlns:fo=http://www.w3.org/1999/XSL/Format;
fo:layout-master-set
  fo:simple-page-master margin-right=25.4mm margin-left=25.4mm
 page-height=297mm page-width=210mm master-name=simple
fo:region-body/
  /fo:simple-page-master
/fo:layout-master-set
fo:page-sequence master-reference=simple
fo:flow flow-name=xsl-region-body
fo:block text-align=justify start-indent=1.3cm
  font-size=12pt font-family=Times hyphenate=true language=de
fo:inline
Beantwoord deze vraag met ja, als u met de Cancel bewerking wilt doorgaan, waarop de
functie anders
/fo:inline
/fo:block
/fo:flow
/fo:page-sequence
/fo:root


[INFO] 1.0dev
[DEBUG] Building formatting object tree
[DEBUG] Current heap size: 720Kb
[DEBUG] Word to hyphenate: functie
Exception occured with a null error message
org.apache.fop.apps.FOPException
at org.apache.fop.apps.CommandLineStarter.run(CommandLineStarter.java:117)
at org.apache.fop.apps.Fop.main(Fop.java:68)
-

java.lang.NullPointerException
at 
org.apache.fop.layoutmgr.InlineStackingLayoutManager.initChildLC(InlineStackingLayoutManager.java:351)
at 
org.apache.fop.layoutmgr.InlineStackingLayoutManager.getNextBreakPoss(InlineStackingLayoutManager.java:312)
at 
org.apache.fop.layoutmgr.LineLayoutManager.getNextBreakPoss(LineLayoutManager.java:211)
at 
org.apache.fop.layoutmgr.BlockLayoutManager.getNextBreakPoss(BlockLayoutManager.java:204)
at 
org.apache.fop.layoutmgr.FlowLayoutManager.getNextBreakPoss(FlowLayoutManager.java:110)
at 
org.apache.fop.layoutmgr.PageLayoutManager.getNextBreakPoss(PageLayoutManager.java:226)
at 
org.apache.fop.layoutmgr.PageLayoutManager.doLayout(PageLayoutManager.java:193)
at org.apache.fop.layoutmgr.PageLayoutManager.run(PageLayoutManager.java:173)
at org.apache.fop.fo.pagination.PageSequence.format(PageSequence.java:390)
at org.apache.fop.apps.LayoutHandler.endPageSequence(LayoutHandler.java:268)
at org.apache.fop.fo.pagination.PageSequence.end(PageSequence.java:351)
at org.apache.fop.fo.FOTreeBuilder.endElement(FOTreeBuilder.java:169)
at org.apache.xerces.parsers.AbstractSAXParser.endElement(Unknown Source)
at org.apache.xerces.impl.XMLNSDocumentScannerImpl.scanEndElement(Unknown 
Source)
at 
org.apache.xerces.impl.XMLDocumentFragmentScannerImpl$FragmentContentDispatcher.dispatch(Unknown
 Source)
at org.apache.xerces.impl.XMLDocumentFragmentScannerImpl.scanDocument(Unknown 
Source)
at org.apache.xerces.parsers.DTDConfiguration.parse(Unknown Source)
at org.apache.xerces.parsers.DTDConfiguration.parse(Unknown Source)
at org.apache.xerces.parsers.XMLParser.parse(Unknown Source)
at org.apache.xerces.parsers.AbstractSAXParser.parse(Unknown Source)
at org.apache.fop.apps.Driver.render(Driver.java:587)
at org.apache.fop.apps.CommandLineStarter.run(CommandLineStarter.java:108)
at org.apache.fop.apps.Fop.main(Fop.java:68)


fo.zip
Description: Zip archive
-
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, email: [EMAIL PROTECTED]

linefeed-treatment

2002-11-11 Thread Rainer Garus
With an actual 1.0dev fop the following part of a fo-file

fo:block
Hello
/fo:block

is rendered to a line which starts with a space character. Is this correct? And is the 
implementation in fop 0.20.4 false, which don't considered the starting space 
character?

The default value of linefeed-treatment is treat-as-space (7.15.7), so the linefeed 
character between  and H is substituted with a space. Is there a sentence in the 
specification suppressing the starting space character?

Rainer Garus

-
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, email: [EMAIL PROTECTED]




Re: [PATCH] Proper use of font encodings for native fonts

2002-06-27 Thread Rainer Garus

Attached is the patch for the development version of fop.

Some remarks:

1) With ant version 1.4.1 ant-optional.jar is not needed.
2) There are two new files src/codegen/encodings.xml and src/codegen/glyphlist.xml.
3) I have problems building fop with xalan version 2.2D11 (see bug 9706 for ant). 
Please upgrade to an actual xalan version.
4) Only building of fop is tested (with the snapshot 20020626162309 and with xalan 
version 2.3.1).


development.zip
Description: Zip archive

-
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, email: [EMAIL PROTECTED]


[PATCH] Proper use of font encodings for native fonts

2002-05-12 Thread Rainer Garus

The patch in http://marc.theaimsgroup.com/?l=fop-devm=101242543132144w=2 is only 
inserted in the maintenance branch, not in the main branch. Is the patch not accepted 
for the main branch? Due to changes in the main branch, the patch does not work for 
the main branch in the moment without modifications. It is necessary to send a new 
patch?

Rainer Garus

-
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, email: [EMAIL PROTECTED]




Re: [PATCH] Proper use of font encodings for native fonts

2002-01-30 Thread Rainer Garus

References:

[1] http://marc.theaimsgroup.com/?l=fop-devm=100559770232644w=2
[2] http://marc.theaimsgroup.com/?l=fop-devm=100790930100949w=2
[3] http://marc.theaimsgroup.com/?l=fop-devm=100386481704186w=2

In fop 0.20.x unicode characters with value greater 256 not represented in the font 
are substituted with the character '#'. With the patch [1] all characters not 
represented in the font are substituted. This makes a problem in 
LineArea.getCharWidth. Because the line feed character has no glyph the width of the 
line feed is computed to the width of the '#' character and is unequal to the space 
character. This is the reason for the second problem described in [2].

Attached is a simple patch for fop 0.20.3RC to solve the problem. The patch from Peter 
[1](together with the two updates) can now entered in cvs in the maintenance branch.

The patch [1](together with the first update in [2]) should be entered in cvs in the 
main branch. The design is easier to understand and the patch solves some design 
problems [3]. The attached patch (second update) is not necessary for the main branch 
in the moment. I think it is better to wait until the patch is in cvs and then to 
change the interface of the font subsystem. If a character is not contained in a font, 
the font subsystem should generate an exception. The area tree builder can then decide 
to substitute the character or to print a warning message.

Rainer Garus

--- Fop-0.20.3rc/src/org/apache/fop/layout/LineArea.javaSat Jan 19 17:15:36 
2002
+++ Fop1/src/org/apache/fop/layout/LineArea.javaWed Jan 30 19:46:52 2002
@@ -1235,51 +1235,53 @@
  * versions of space that might not exists in the font.
  */
 private int getCharWidth(char c) {
-int width = currentFontState.width(currentFontState.mapChar(c));
-if (width = 0) {
-// Estimate the width of spaces not represented in
-// the font
-int em = currentFontState.width(currentFontState.mapChar('m'));
-int en = currentFontState.width(currentFontState.mapChar('n'));
-if (em = 0)
-em = 500 * currentFontState.getFontSize();
-if (en = 0)
-en = em - 10;
+int width;
 
-if (c == ' ')
-width = em;
-if (c == '\u2000')
-width = en;
-if (c == '\u2001')
-width = em;
-if (c == '\u2002')
-width = em / 2;
-if (c == '\u2003')
-width = currentFontState.getFontSize();
-if (c == '\u2004')
-width = em / 3;
-if (c == '\u2005')
-width = em / 4;
-if (c == '\u2006')
-width = em / 6;
-if (c == '\u2007')
-width = getCharWidth(' ');
-if (c == '\u2008')
-width = getCharWidth('.');
-if (c == '\u2009')
-width = em / 5;
-if (c == '\u200A')
-width = 5;
-if (c == '\u200B')
-width = 100;
-if (c == '\u00A0')
-width = getCharWidth(' ');
-if (c == '\u202F')
-width = getCharWidth(' ') / 2;
-if (c == '\u3000')
-width = getCharWidth(' ') * 2;
-if ((c == '\n') || (c == '\r') || (c == '\t'))
-width = getCharWidth(' ');
+if ((c == '\n') || (c == '\r') || (c == '\t') || (c == '\u00A0')) {
+width = getCharWidth(' ');
+} else {
+width = currentFontState.width(currentFontState.mapChar(c));
+if (width = 0) {
+// Estimate the width of spaces not represented in
+// the font
+int em = currentFontState.width(currentFontState.mapChar('m'));
+int en = currentFontState.width(currentFontState.mapChar('n'));
+if (em = 0)
+em = 500 * currentFontState.getFontSize();
+if (en = 0)
+en = em - 10;
+
+if (c == ' ')
+width = em;
+if (c == '\u2000')
+width = en;
+if (c == '\u2001')
+width = em;
+if (c == '\u2002')
+width = em / 2;
+if (c == '\u2003')
+width = currentFontState.getFontSize();
+if (c == '\u2004')
+width = em / 3;
+if (c == '\u2005')
+width = em / 4;
+if (c == '\u2006')
+width = em / 6;
+if (c == '\u2007')
+width = getCharWidth(' ');
+if (c == '\u2008')
+width = getCharWidth('.');
+if (c == '\u2009')
+width = em / 5;
+if (c == '\u200A

RE: [ANNOUNCEMENT] FOP 0.20.3 Release Candidate available

2002-01-25 Thread Rainer Garus

I have the following remarks to the (html-)documentation of FOP 0.20.3rc:

 
1. Readme / FOP

Latest FOP version should be changed to 0.20.3.

2. Running FOP / Starting FOP

As in section Prerequisites a hint to fop.bat/fop.sh should be given, for example:
FOP can be easily invoked with the scripts Fop.bat/fop.sh. The possible parameters 
are: ...

3. Running FOP / Problems

Both mailing lists fop-user and fop-dev should be mentioned with hints which mailing 
list should be used.

4. Features / What's Implemented

FOP supports the XSL-FO 1.0 W3C Recommandation

5. Features / 1) Formatting Objects

Is the last line border and padding shorthand properties before section Feature / 
2) Properties correct?

6. Features / 2) Properties

The new property master-reference should be added to the list.

7. Font Support / Adding additional Type 1 fonts / Generating a font metrics file

The classpath is not correct: fop.jar is in the build directory, the others are in 
the lib directory.

8. Getting involved

A hint to the fop-user mailing list should be inserted.

9. Architecture / UML Diagramms

Are the UML diagrams up to date? If not, the section should be deleted.

10. Resources / Other resources

There is no apache archive of [EMAIL PROTECTED] in http://xml.apache.org/mail;. Is 
this correct?

11. Home

In the home page http://xml.apache.org in section FOP Java 1.1 should be changed to 
Java 1.2

12. File xml-fop/README

XSL candidate release should be changed to XSL recommendation.



Rainer Garus

-
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, email: [EMAIL PROTECTED]




Re: [PATCH] Proper use of font encodings for native fonts

2001-12-09 Thread Rainer Garus

Hi Peter,

I have installed the patch to the 0.20.2RC version and tested with the fonts.fo 
example. There are two problems (see attached file fonts.pdf):

First, the euro sign is not displayed, because of a bug in the class CodePointMapping. 
Not all of the unicode characters with value greater 256 are entered in the characters 
and codepoints arrays (see the attached patch file).

Second, the distance in the pdf-file of the last character of a line and the second 
character of the next line of the fo-file is twice of the distance between the other 
characters. You can see this very good in the section with the ZapfDingbats font 
between the digits. This prevents me from using your patch.

Rainer Garus

?xml version=1.0 ?

fo:root xmlns:fo=http://www.w3.org/1999/XSL/Format;

  !-- defines the layout master --
  fo:layout-master-set
fo:simple-page-master master-name=first 
   page-height=29.7cm 
   page-width=21cm 
   margin-top=1cm 
   margin-bottom=2cm 
   margin-left=2.5cm 
   margin-right=2.5cm
  fo:region-body margin-top=3cm/
  fo:region-before extent=3cm/
  fo:region-after extent=1.5cm/
/fo:simple-page-master
  /fo:layout-master-set

  !-- starts actual layout --
  fo:page-sequence master-name=first


fo:flow flow-name=xsl-region-body

  fo:block font-family=Helvetica font-size=14pt
Helvetica
  /fo:block
  fo:block space-after.optimum=10pt font-family=Helvetica
#x21; #x22; #x23; #x24; #x25; #x26; #x27; #x28; #x29; #x2A;
#x2B; #x2C; #x2D; #x2E; #x2F; #x30; #x31; #x32; #x33; #x34;
#x35; #x36; #x37; #x38; #x39; #x3A; #x3B; #x3C; #x3D; #x3E;
#x3F; #x40; #x41; #x42; #x43; #x44; #x45; #x46; #x47; #x48;
#x49; #x4A; #x4B; #x4C; #x4D; #x4E; #x4F; #x50; #x51; #x52;
#x53; #x54; #x55; #x56; #x57; #x58; #x59; #x5A; #x5B; #x5C;
#x5D; #x5E; #x5F; #x60; #x61; #x62; #x63; #x64; #x65; #x66;
#x67; #x68; #x69; #x6A; #x6B; #x6C; #x6D; #x6E; #x6F; #x70;
#x71; #x72; #x73; #x74; #x75; #x76; #x77; #x78; #x79; #x7A;
#x7B; #x7C; #x7D; #x7E; #xA1; #xA2; #xA3; #xA4; #xA5; #xA6;
#xA7; #xA8; #xA9; #xAA; #xAB; #xAC; #xAE; #xAF; #xB0; #xB1;
#xB2; #xB3; #xB4; #xB5; #xB6; #xB7; #xB8; #xB9; #xBA; #xBB;
#xBC; #xBD; #xBE; #xBF; #xC0; #xC1; #xC2; #xC3; #xC4; #xC5;
#xC6; #xC7; #xC8; #xC9; #xCA; #xCB; #xCC; #xCD; #xCE; #xCF;
#xD0; #xD1; #xD2; #xD3; #xD4; #xD5; #xD6; #xD7; #xD8; #xD9;
#xDA; #xDB; #xDC; #xDD; #xDE; #xDF; #xE0; #xE1; #xE2; #xE3;
#xE4; #xE5; #xE6; #xE7; #xE8; #xE9; #xEA; #xEB; #xEC; #xED;
#xEE; #xEF; #xF0; #xF1; #xF2; #xF3; #xF4; #xF5; #xF6; #xF7;
#xF8; #xF9; #xFA; #xFB; #xFC; #xFD; #xFE; #xFF;
#x0152; #x0153; #x0160; #x0161; #x0178;
#x017D; #x017E; #x0192; #x02DC; #x2013; #x2014; #x2018;
#x2019; #x201A; #x201C; #x201D; #x201E; #x2020; #x2021;
#x2022; #x2026; #x2030; #x2039; #x203A; #x2122;
  /fo:block

  fo:block font-family=Helvetica  font-size=14pt
Times Roman
  /fo:block
  fo:block space-after.optimum=10pt font-family=Times Roman
#x21; #x22; #x23; #x24; #x25; #x26; #x27; #x28; #x29; #x2A;
#x2B; #x2C; #x2D; #x2E; #x2F; #x30; #x31; #x32; #x33; #x34;
#x35; #x36; #x37; #x38; #x39; #x3A; #x3B; #x3C; #x3D; #x3E;
#x3F; #x40; #x41; #x42; #x43; #x44; #x45; #x46; #x47; #x48;
#x49; #x4A; #x4B; #x4C; #x4D; #x4E; #x4F; #x50; #x51; #x52;
#x53; #x54; #x55; #x56; #x57; #x58; #x59; #x5A; #x5B; #x5C;
#x5D; #x5E; #x5F; #x60; #x61; #x62; #x63; #x64; #x65; #x66;
#x67; #x68; #x69; #x6A; #x6B; #x6C; #x6D; #x6E; #x6F; #x70;
#x71; #x72; #x73; #x74; #x75; #x76; #x77; #x78; #x79; #x7A;
#x7B; #x7C; #x7D; #x7E; #xA1; #xA2; #xA3; #xA4; #xA5; #xA6;
#xA7; #xA8; #xA9; #xAA; #xAB; #xAC; #xAE; #xAF; #xB0; #xB1;
#xB2; #xB3; #xB4; #xB5; #xB6; #xB7; #xB8; #xB9; #xBA; #xBB;
#xBC; #xBD; #xBE; #xBF; #xC0; #xC1; #xC2; #xC3; #xC4; #xC5;
#xC6; #xC7; #xC8; #xC9; #xCA; #xCB; #xCC; #xCD; #xCE; #xCF;
#xD0; #xD1; #xD2; #xD3; #xD4; #xD5; #xD6; #xD7; #xD8; #xD9;
#xDA; #xDB; #xDC; #xDD; #xDE; #xDF; #xE0; #xE1; #xE2; #xE3;
#xE4; #xE5; #xE6; #xE7; #xE8; #xE9; #xEA; #xEB; #xEC; #xED;
#xEE; #xEF; #xF0; #xF1; #xF2; #xF3; #xF4; #xF5; #xF6; #xF7;
#xF8; #xF9; #xFA; #xFB; #xFC; #xFD; #xFE; #xFF; #x0152;
#x0153; #x0160; #x0161; #x0178; #x017D; #x017E; #x0192;
#x02DC; #x2013; #x2014; #x2018; #x2019; #x201A;
#x201C; #x201D; #x201E; #x2020; #x2021; #x2022; #x2026;
#x2030; #x2039; #x203A; #x2122;
  /fo:block

  fo:block font-family=Helvetica  font-size=14pt
Courier
  /fo:block
  fo:block space-after.optimum=10pt font-family=Courier
#x21; #x22; #x23; #x24; #x25; #x26; #x27; #x28; #x29; #x2A;
#x2B; #x2C; #x2D; #x2E; #x2F; #x30; #x31; #x32; #x33; #x34;
#x35; #x36; #x37; #x38; #x39; #x3A; #x3B; #x3C; #x3D; #x3E;
#x3F; #x40; #x41; #x42; #x43; #x44; #x45; #x46; #x47; #x48;
#x49; #x4A; #x4B; #x4C; #x4D; #x4E; #x4F; #x50; #x51; #x52;
#x53; #x54; #x55; #x56; #x57; #x58; #x59; #x5A; #x5B; #x5C;
#x5D; #x5E; #x5F; #x60; #x61; #x62; #x63; #x64; #x65; #x66;
#x67; #x68; #x69; #x6A; #x6B; #x6C; #x6D; #x6E; #x6F; #x70;
#x71; #x72; #x73; #x74

Re: text-align = justify not working correctly with - (minus) characters

2001-10-23 Thread Rainer Garus

Hallo Corinna,

I have studied the problem in the last week with the following result:

There is an error in the font metrik files in org/apache/fop/render/pdf/fonts. In the 
WinAnsiEncoding the hyphen has the code point 0x002D. In the font metrik files for 
Helvetica, Times and Courier there are two entries for this index. For example in 
Helvetica.java there is width[0x002D] = 333 and width[0x2D] = 324.

But the font metrik files are generated. So the generation is not correct. For 
generating Helvetica.java the files Helvetica.xml, charlist.xml und font-file.xsl from 
the directory src/codegen are used. In charlist.xml you find two entries with 
win-ansi=0x002D: one for adobe-name hyphen in the win-ansi section with unicode 
0x002D and another for adobe-name minus in the symbol section with unicode 0x2212. 
Only the entry of the win-ansi section should be used.

I think the best way is to split charlist.xml in three files: one for win-ansi 
encoding, one for zapfdingbats encoding and one for symbol encoding. For generating 
the metrik files for the fonts with win-ansi encoding charlist-win-ansi.xml is used, 
for the zapfdingbats metrik file charlist-zapfdingbats.xml is used and for the symbol 
metrik file charlist-symbol.xml is used.

So there is for each font a file with a mapping (adobe-name - width) and for each 
encoding a file with a mapping (adobe-name - code point). Then it is possible to 
generate the font metrik file with mapping (code point - width). Now we need only a 
file with a mapping (unicode - adobe-name) to build for each encoding the mapping 
(unicode - code point).

Another way is to use *.pfm files of the standard fonts Helvetica ,... to build the 
font metrik files.

The ps renderer don't use the WinAnsiEncoding but IsoLatin1Encoding. But I have not 
found a Unicode to IsoLatin1 mapping. I think it is an encoding problem. In Isolatin1 
the hyphen has the code point 0xAD. So the character with value 0x2D must be mapped on 
0xAD.

Another point: In the files Helvetica.xml, ... (the files with the mapping adobe-name 
- width) there are no entries for the euro, see bug 2105.

Rainer Garus

-
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, email: [EMAIL PROTECTED]




[Patch] fo:leader with start indent

2001-10-07 Thread Rainer Garus

It is possible to insert and commit the patch sended on 2001-09-02 to the problem 
described by Ivan Demakov (2001-08-27) to CVS?

Rainer Garus

-
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, email: [EMAIL PROTECTED]




text-align = justify not working correctly with - (minus) characters

2001-09-30 Thread Rainer Garus

Lines containing - (minus) characters are not justified correctly in fop 0.20.1. The 
line in the pdf file is longer then specified (see attached files).

The area tree is correct. It seems that the width of the - character used by the 
layouter is different from the width of the - character in the pdf file. 

Another Problem: the width of the - character in the ps output file is different 
from the width of the - character in the pdf output file of fop.

What are the reasons?

Rainer Garus

?xml version=1.0 encoding=utf-8?

fo:root xmlns:fo=http://www.w3.org/1999/XSL/Format;

  fo:layout-master-set
fo:simple-page-master master-name=simple
  page-height=29.7cm
  page-width=21cm
  margin-top=2cm
  margin-bottom=2cm
  margin-left=4cm
  margin-right=4cm
  fo:region-body/
/fo:simple-page-master
  /fo:layout-master-set


  fo:page-sequence master-name=simple
fo:flow flow-name=xsl-region-body

fo:block font-size=12pt font-family=Helvetica text-align=justify
-- -- -- -- -- -- -- 
-- 
-- -- -- -- -- -- -- 
-- 
0123456789 0123456789 0123456789 0123456789 0123456789 0123456789 0123456789 
0123456789 
0123456789 0123456789 0123456789 0123456789 0123456789 0123456789 0123456789 
0123456789 
/fo:block

/fo:flow !-- closes the flow element--
  /fo:page-sequence !-- closes the page-sequence --
/fo:root

 simple.pdf
 simple.ps

-
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, email: [EMAIL PROTECTED]


[Patch] fo:leader with start indent

2001-09-02 Thread Rainer Garus

If start-indent  0 the computed value of the remaining width of a line area is not 
correct, because the value of getContentWidth contains start-indent and end-indent. I 
have changed the public method getRemainingWidth in LineArea.java but only tested with 
the following fo-file.

Rainer Garus



fo:root xmlns:fo=http://www.w3.org/1999/XSL/Format;
 xmlns:svg=http://www.w3.org/2000/svg;
 font-family=Courier
 font-size=10pt
  fo:layout-master-set
fo:simple-page-master master-name=one
   page-height=297mm
   page-width=210mm
  fo:region-body/
/fo:simple-page-master
  /fo:layout-master-set
  fo:page-sequence master-name=one
fo:flow flow-name=xsl-region-body

!-- Test 1 --
fo:block start-indent=0cm end-indent=0cm
start-indent = 0 cm, end-indent = 0 cm
fo:leader leader-pattern=dots
   leader-pattern-width=8pt
   leader-alignment=reference-area
   leader-length.maximum=21cm/
/fo:block

!-- Test 2 --
fo:block start-indent=1.9cm end-indent=0cm
start-indent = 2 cm, end-indent = 0 cm
fo:leader leader-pattern=dots
   leader-pattern-width=8pt
   leader-alignment=reference-area
   leader-length.maximum=21cm/
/fo:block

!-- Test 3 --
fo:block start-indent=4cm end-indent=0cm
start-indent = 4 cm, end-indent = 0 cm
fo:leader leader-pattern=dots
   leader-pattern-width=8pt
   leader-alignment=reference-area
   leader-length.maximum=21cm/
/fo:block

!-- Test 4 --
fo:block start-indent=0cm end-indent=2cm
start-indent = 0 cm, end-indent = 2 cm
fo:leader leader-pattern=dots
   leader-pattern-width=8pt
   leader-alignment=reference-area
   leader-length.maximum=21cm/
/fo:block

!-- Test 5 --
fo:block start-indent=0cm end-indent=4cm
start-indent = 0 cm, end-indent = 4 cm
fo:leader leader-pattern=dots
   leader-pattern-width=8pt
   leader-alignment=reference-area
   leader-length.maximum=21cm/
/fo:block

!-- Test 6 --
fo:block start-indent=2cm end-indent=2cm
start-indent = 2 cm, end-indent = 2 cm
fo:leader leader-pattern=dots
   leader-pattern-width=8pt
   leader-alignment=reference-area
   leader-length.maximum=21cm/
/fo:block

!-- Test 7 --
fo:block start-indent=4cm end-indent=2cm
start-indent = 4 cm, end-indent = 2 cm
fo:leader leader-pattern=dots
   leader-pattern-width=8pt
   leader-alignment=reference-area
   leader-length.maximum=21cm/
/fo:block

!-- Test 8 --
fo:block start-indent=2cm end-indent=4cm
start-indent = 2 cm, end-indent = 4 cm
fo:leader leader-pattern=dots
   leader-pattern-width=8pt
   leader-alignment=reference-area
   leader-length.maximum=21cm/
/fo:block

!-- Test 9 --
fo:block start-indent=4cm end-indent=4cm
start-indent = 4 cm, end-indent = 4 cm
fo:leader leader-pattern=dots
   leader-pattern-width=8pt
   leader-alignment=reference-area
   leader-length.maximum=21cm/
/fo:block

/fo:flow
  /fo:page-sequence
/fo:root






--- Fop-0.20.1/src/org/apache/fop/layout/LineArea.java  Mon Aug 13 23:28:29 2001
+++ Fop-0.20.1/build/src/org/apache/fop/layout/LineArea.javaSun Sep  2 18:39:01 
+2001
@@ -507,8 +507,7 @@
 int whitespaceWidth =
 currentFontState.width(currentFontState.mapChar(whitespaceIndex));
 
-int remainingWidth = this.getContentWidth()
- - this.getCurrentXPosition();
+int remainingWidth = this.getRemainingWidth();
 
 /**
  * checks whether leaderLenghtOptimum fits into rest of line;
@@ -1008,7 +1007,7 @@
 }
 
 public int getRemainingWidth() {
-return this.getContentWidth() - this.getCurrentXPosition();
+return this.getContentWidth() + startIndent - this.getCurrentXPosition();
 }
 
 public void setLinkSet(LinkSet ls) {}
@@ -1031,8 +1030,7 @@
  */
 public int addCharacter(char data, LinkSet ls, boolean ul) {
 WordArea ia = null;
-int remainingWidth = this.getContentWidth()
- - this.getCurrentXPosition();
+int remainingWidth = this.getRemainingWidth();
 int width =
 this.currentFontState.width(currentFontState.mapChar(data));
 // if it doesn't fit, return

--- Fop-0.20.1/src/org/apache/fop/layout/LineArea.java  Mon Aug 13 23:28:29 2001
+++ Fop-0.20.1/build/src/org/apache/fop/layout/LineArea.javaSun Sep  2 18:39:01 
+2001
@@ -507,8 +507,7 @@
 int whitespaceWidth =
 currentFontState.width(currentFontState.mapChar(whitespaceIndex));
 
-int remainingWidth = this.getContentWidth()
- - this.getCurrentXPosition();
+int remainingWidth = this.getRemainingWidth();
 
 /**
  * checks

[Patch] bug 2243 - extra space at the beginning of next line after line feed

2001-07-23 Thread Rainer Garus

Is it possible to insert and commit the patch sended on 2001-06-28 to CVS?

Rainer Garus

-
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, email: [EMAIL PROTECTED]




Patch for bug 2243 - extra space at the beginning of next line after line feed

2001-06-28 Thread Rainer Garus

In the case of white-space-collapse=false in LineArea.AddText the position of
the line feed character is returned. So the next line starts at the position of
the line feed character (bug 1). All white space characters at the begin of a
line are handled as spaces (bug 2). Another bug is that lines with only white
space characters are suppressed. This is a problem in source code listings.

In the fo-file Test 1 - Test 4 and Test 9 are ok, but textdecoration
does not work as expected.



--- Fop-0.19.0-CVS/src/org/apache/fop/layout/LineArea.java  Fri Jun 15 23:25:49 
2001
+++ LineArea.java   Thu Jun 28 21:42:01 2001
@@ -202,7 +202,16 @@
 spaceWidth += whitespaceWidth;
 } else if (c == '\n') {
 // force line break
-return i;
+if (spaceWidth  0) {
+  InlineSpace is = new InlineSpace(spaceWidth);
+  is.setUnderlined(textState.getUnderlined());
+  is.setOverlined(textState.getOverlined());
+  is.setLineThrough(textState.getLineThrough());
+  addChild(is);
+  finalWidth += spaceWidth;
+  spaceWidth = 0;
+}
+return i+1;
 } else if (c == '\t') {
 spaceWidth += 8 * whitespaceWidth;
 }
@@ -308,7 +317,7 @@
 WhiteSpaceCollapse.FALSE) {
 if (c == '\n') {
 // force a line break
-return i;
+return i+1;
 } else if (c == '\t') {
 spaceWidth = whitespaceWidth;
 }
@@ -320,8 +329,19 @@
 
 if (this.whiteSpaceCollapse ==
 WhiteSpaceCollapse.FALSE) {
-prev = WHITESPACE;
-spaceWidth = whitespaceWidth;
+if (c == ' ') {
+prev = WHITESPACE;
+spaceWidth = whitespaceWidth;
+} else if (c == '\n') {
+// force line break
+// textdecoration not used because spaceWidth is 0
+InlineSpace is = new InlineSpace(spaceWidth);
+addChild(is);
+return i+1;
+} else if (c == '\t') {
+ prev = WHITESPACE;
+ spaceWidth = 8 * whitespaceWidth;
+}
 } else {
 // skip over it
 wordStart++;



fo:root xmlns:fo=http://www.w3.org/1999/XSL/Format;
 xmlns:svg=http://www.w3.org/2000/svg;
 font-family=Courier
 font-size=10pt
  fo:layout-master-set
fo:simple-page-master master-name=one
   page-height=297mm
   page-width=210mm
  fo:region-body/
/fo:simple-page-master
  /fo:layout-master-set
  fo:page-sequence master-name=one
fo:flow flow-name=xsl-region-body



!-- Test 1 --
fo:block1234567890123456789012345678901234567890 Test 1 text-align=start/fo:block
fo:block white-space-collapse=false text-align=start background-color=yellow
Start in column 1, one empty line before this line. Line ends with 3 spaces.   


Start in column 9 (one tab), two empty lines before this line.
Start in column 17 (two tab), no empty line before this line.

   
  Start in column 3, one empty line and one with three spaces before this line.
Start in column 1, no empty line after this line.
/fo:block
fo:block1234567890123456789012345678901234567890 Test 1/fo:block




!-- Test 2 --
fo:block1234567890123456789012345678901234567890 Test 2 text-align=end/fo:block
fo:block white-space-collapse=false text-align=end background-color=yellow
Start in column 1, one empty line before this line. Line ends with 3 spaces.   


Start in column 9 (one tab), two empty lines before this line.
Start in column 17 (two tab), no empty line before this line.

  
  Start in column 3, one empty line and one with three spaces before this line.
Start in column 1, no empty line after this line.
/fo:block
fo:block1234567890123456789012345678901234567890 Test 2/fo:block




!-- Test 3 --
fo:block1234567890123456789012345678901234567890 Test 3 text-align=start/fo:block
fo:block white-space-collapse=false text-align=start