DO NOT REPLY [Bug 31206] - [PATCH] Improvements over the new line breaking algorithm

2004-11-13 Thread bugzilla
DO NOT REPLY TO THIS EMAIL, BUT PLEASE POST YOUR BUG 
RELATED COMMENTS THROUGH THE WEB INTERFACE AVAILABLE AT
http://issues.apache.org/bugzilla/show_bug.cgi?id=31206.
ANY REPLY MADE TO THIS MESSAGE WILL NOT BE COLLECTED AND 
INSERTED IN THE BUG DATABASE.

http://issues.apache.org/bugzilla/show_bug.cgi?id=31206

[PATCH] Improvements over the new line breaking algorithm

[EMAIL PROTECTED] changed:

   What|Removed |Added

 Status|NEW |RESOLVED
 Resolution||FIXED



--- Additional Comments From [EMAIL PROTECTED]  2004-11-13 20:39 ---
Applied. 

I made BasicLinkLM also extend InlineLM.

Thanks. Simon Pepping


DO NOT REPLY [Bug 31206] - [PATCH] Improvements over the new line breaking algorithm

2004-11-12 Thread bugzilla
DO NOT REPLY TO THIS EMAIL, BUT PLEASE POST YOUR BUG 
RELATED COMMENTS THROUGH THE WEB INTERFACE AVAILABLE AT
http://issues.apache.org/bugzilla/show_bug.cgi?id=31206.
ANY REPLY MADE TO THIS MESSAGE WILL NOT BE COLLECTED AND 
INSERTED IN THE BUG DATABASE.

http://issues.apache.org/bugzilla/show_bug.cgi?id=31206

[PATCH] Improvements over the new line breaking algorithm





--- Additional Comments From [EMAIL PROTECTED]  2004-11-12 15:35 ---
I have created a new patch against HEAD.
I have tested it and it seems to work, but at the moment I'm not yet ready to 
commit it, sorry; maybe someone could do this in my place?

A few points which may need further work:

- I renamed the new interface from InlineLM to InlineLevelLM. Merging it with 
the new InlineLM class would involve having TextLM and LeafNodeLM extend 
InlineLM instead of AbstractLM, and this seems a bit strange to me

- the offset of the areas is set according to the value of the vertical-align 
property instead of alignment-baseline

- the offset of the viewport area generated by svg graphics is not set, 
because I couldn't find its height

- the offset of textAreas is set by the TextLM, which creates them; but 
vertical-align is a property of inline level formatting objects only, so the 
TextLM checks if the parent node is an Inline

- the main problem in applying the changes to the new code involved leaders 
with use-content; in the old code, the method LeaderLM.getLeaderInlineArea() 
created a ContentLM and an InlineStackingLM:
LeaderLM
|
|
ContentLM
|
|
 InlineStackingLM
|
|   |   |
 (LMs handling the use-content)
but now InlineStackingLM does no more implement getNextKnuthElements(), and 
the InlineLM constructor requires an Inline node; I temporarily fixed this by 
adding a constructor for InlineLM with a Leader parameter, but I don't like 
this very much.

Regards,
Luca


DO NOT REPLY [Bug 31206] - [PATCH] Improvements over the new line breaking algorithm

2004-11-12 Thread bugzilla
DO NOT REPLY TO THIS EMAIL, BUT PLEASE POST YOUR BUG 
RELATED COMMENTS THROUGH THE WEB INTERFACE AVAILABLE AT
http://issues.apache.org/bugzilla/show_bug.cgi?id=31206.
ANY REPLY MADE TO THIS MESSAGE WILL NOT BE COLLECTED AND 
INSERTED IN THE BUG DATABASE.

http://issues.apache.org/bugzilla/show_bug.cgi?id=31206

[PATCH] Improvements over the new line breaking algorithm





--- Additional Comments From [EMAIL PROTECTED]  2004-11-12 15:37 ---
Created an attachment (id=13415)
updated patch to existing files


DO NOT REPLY [Bug 31206] - [PATCH] Improvements over the new line breaking algorithm

2004-11-06 Thread bugzilla
DO NOT REPLY TO THIS EMAIL, BUT PLEASE POST YOUR BUG 
RELATED COMMENTS THROUGH THE WEB INTERFACE AVAILABLE AT
http://issues.apache.org/bugzilla/show_bug.cgi?id=31206.
ANY REPLY MADE TO THIS MESSAGE WILL NOT BE COLLECTED AND 
INSERTED IN THE BUG DATABASE.

http://issues.apache.org/bugzilla/show_bug.cgi?id=31206

[PATCH] Improvements over the new line breaking algorithm





--- Additional Comments From [EMAIL PROTECTED]  2004-11-06 14:24 ---
Luca,

Leaders with content: in the test file leaders.fo I get PDF errors in
the SVG parts.

I have not checked the calculations of the vertical alignment. The
provided test fo files, and some test files I created myself, behave
well under the new code. I trust the code is OK.

As Finn pointed out, vertical-align is a shorthand property in
XSL. The values top, bottom, middle and baseline map to the values
before-edge, after-edge, middle and baseline of the property
alignment-baseline, with the properties alignment-adjust,
baseline-shift and dominant-baseline being at their default
values. Therefore I think if the current property vertical-align is
renamed to alignment-baseline, the code will keep working fine, and
the way is free to implement vertical-align as a shorthand property.

InlineLM is now a class (created by Finn on Oct. 19). The hierarchy
is:

InlineStackingLM
- InlineLM
- LineLM

The class InlineLM is at the position in the hierarchy where I think
InlineLM interface should be. Therefore I think InlineLM class can
well be merged with the proposed InlineLM interface.

I think the code in this patch is OK for committing to CVS. The items
noted above can be addressed over time.  However, the patch as it is
cannot be applied to the current version of CVS HEAD, due to the newly
created InlineLM class and extensive changes in property retrieval. If
you submit a patch of the same code against the current CVS HEAD, I
will commit it. Or you can keep it until you have write access to CVS
yourself.

Regards, Simon


Re: DO NOT REPLY [Bug 31206] - [PATCH] Improvements over the new line breaking algorithm

2004-10-26 Thread Simon Pepping
Luca,

I will try to look at your patch later this week.

Regards, Simon

-- 
Simon Pepping
home page: http://www.leverkruid.nl



Re: DO NOT REPLY [Bug 31206] - [PATCH] Improvements over the new line breaking algorithm

2004-10-15 Thread Luca Furini

Simon Pepping wrote:

 1. InlineStackingLM implements InlineLM.  LineLM extends
 InlineStackingLM and thus implements InlineLM. IMHO it should
 not. Implementing InlineLM should be equivalent to
 generatesInlineAreas returning true.

You are right, it's quite strange, but the LineLM still uses a few methods
inherited from InlineStackingLM. This was not due to the new algorithm, it
was already in the old code; I'm going to see if they still do something
useful ...

 2. TextLM now extends LeafNodeLM instead of AbstractLM. What is the
 gain?  I see no related changes in TextLM.

There isn't at the moment any practical gain, I just thought that, as a
text node has no children, a TextLM is a (special case of) LeafNodeLM.

 3. In LineLM:
 // this constant is used to create elements when text-align is center:
 // every TextLM descendant of LineLM must use the same value,
 // otherwise the line breaking algorithm does not find the right
 // break point
 public static final int DEFAULT_SPACE_WIDTH = 3336;
 private static final int INFINITE_RATIO = 1000;

 If these are static final, they might be better placed in
 InlineLM. Alternatively, they might be attributes of the LineLM
 object, which allows changing them per paragraph, e.g. depending on
 the font. But then the problem arises how to propagate them to the
 descendant LMs.

I decided to change and use a constant because the important thing is to
have the same value used by every LM, but this isn't the perfect solution;
if we try to center a short object (a single word, for example) in a long
line, it is likely that the algorithm fails because there isn't enough
stretchability in the line.
Maybe it's better to have the LineLM compute a value depending on the line
lenght and the maximum adjustment ratio; the child LM should ask the
LineLM for this value.

 4. The textheight of the large font is rather large. The property
 lineheight is not followed (reproduce existing behaviour).

 5. LineLayoutManager:675: line is always 3, so that firstElementIndex
 = 1 for the first line, and the first box is skipped in the line
 height calculation.

The second version of the patch, which I'm going to attach to the Bugzilla
issue, fixes these errors.

It also implement the vertical-align property: now the values of top,
bottom, middle and baseline should be supported.
I made a few tests with fo:inline, fo:character and fo:external-graphic,
and it seems to work.

IMPORTANT: I had to revert Finn Bock's changes to the PDFRenderer (dated
2004/09/22 13:22:16), otherwise leaders with svg use-content produce
errors in the pdf output.
There isn't any run-time error, but when I try to open the pdf file, I get
these warnings:
 - There was an error processing a page. Wrong operand type.
 - Illegal operation 'q' inside a text object.
 - Wrong operand type.
and the page with the svg leaders is left empty.
I think it could be something involving the saveGraphicsState() method.

Still to be done:
  - remove unused methods and variables
  - simplify InlineStackingLM methods as suggested by Simon
I'll try and fix these points as soon as possible.

Regards
Luca




DO NOT REPLY [Bug 31206] - [PATCH] Improvements over the new line breaking algorithm

2004-10-15 Thread bugzilla
DO NOT REPLY TO THIS EMAIL, BUT PLEASE POST YOUR BUG 
RELATED COMMENTS THROUGH THE WEB INTERFACE AVAILABLE AT
http://issues.apache.org/bugzilla/show_bug.cgi?id=31206.
ANY REPLY MADE TO THIS MESSAGE WILL NOT BE COLLECTED AND 
INSERTED IN THE BUG DATABASE.

http://issues.apache.org/bugzilla/show_bug.cgi?id=31206

[PATCH] Improvements over the new line breaking algorithm





--- Additional Comments From [EMAIL PROTECTED]  2004-10-15 16:22 ---
I'm going to attach a revised version of the improvement patch:

- it fixes the line-height calculation errors
- better handling of preserved linefeed

I'm going to attach some test files too.

Regards
Luca


DO NOT REPLY [Bug 31206] - [PATCH] Improvements over the new line breaking algorithm

2004-10-15 Thread bugzilla
DO NOT REPLY TO THIS EMAIL, BUT PLEASE POST YOUR BUG 
RELATED COMMENTS THROUGH THE WEB INTERFACE AVAILABLE AT
http://issues.apache.org/bugzilla/show_bug.cgi?id=31206.
ANY REPLY MADE TO THIS MESSAGE WILL NOT BE COLLECTED AND 
INSERTED IN THE BUG DATABASE.

http://issues.apache.org/bugzilla/show_bug.cgi?id=31206

[PATCH] Improvements over the new line breaking algorithm





--- Additional Comments From [EMAIL PROTECTED]  2004-10-15 16:22 ---
Created an attachment (id=13099)
revised patch


DO NOT REPLY [Bug 31206] - [PATCH] Improvements over the new line breaking algorithm

2004-10-15 Thread bugzilla
DO NOT REPLY TO THIS EMAIL, BUT PLEASE POST YOUR BUG 
RELATED COMMENTS THROUGH THE WEB INTERFACE AVAILABLE AT
http://issues.apache.org/bugzilla/show_bug.cgi?id=31206.
ANY REPLY MADE TO THIS MESSAGE WILL NOT BE COLLECTED AND 
INSERTED IN THE BUG DATABASE.

http://issues.apache.org/bugzilla/show_bug.cgi?id=31206

[PATCH] Improvements over the new line breaking algorithm





--- Additional Comments From [EMAIL PROTECTED]  2004-10-15 16:24 ---
Created an attachment (id=13100)
leaders with pattern = rule, dots and use-content with svg graphics


DO NOT REPLY [Bug 31206] - [PATCH] Improvements over the new line breaking algorithm

2004-10-15 Thread bugzilla
DO NOT REPLY TO THIS EMAIL, BUT PLEASE POST YOUR BUG 
RELATED COMMENTS THROUGH THE WEB INTERFACE AVAILABLE AT
http://issues.apache.org/bugzilla/show_bug.cgi?id=31206.
ANY REPLY MADE TO THIS MESSAGE WILL NOT BE COLLECTED AND 
INSERTED IN THE BUG DATABASE.

http://issues.apache.org/bugzilla/show_bug.cgi?id=31206

[PATCH] Improvements over the new line breaking algorithm





--- Additional Comments From [EMAIL PROTECTED]  2004-10-15 16:24 ---
Created an attachment (id=13101)
vertical alignment (top, bottom, middle, baseline) of inlines


DO NOT REPLY [Bug 31206] - [PATCH] Improvements over the new line breaking algorithm

2004-10-15 Thread bugzilla
DO NOT REPLY TO THIS EMAIL, BUT PLEASE POST YOUR BUG 
RELATED COMMENTS THROUGH THE WEB INTERFACE AVAILABLE AT
http://issues.apache.org/bugzilla/show_bug.cgi?id=31206.
ANY REPLY MADE TO THIS MESSAGE WILL NOT BE COLLECTED AND 
INSERTED IN THE BUG DATABASE.

http://issues.apache.org/bugzilla/show_bug.cgi?id=31206

[PATCH] Improvements over the new line breaking algorithm





--- Additional Comments From [EMAIL PROTECTED]  2004-10-15 16:25 ---
Created an attachment (id=13102)
vertical alignment of images


DO NOT REPLY [Bug 31206] - [PATCH] Improvements over the new line breaking algorithm

2004-10-15 Thread bugzilla
DO NOT REPLY TO THIS EMAIL, BUT PLEASE POST YOUR BUG 
RELATED COMMENTS THROUGH THE WEB INTERFACE AVAILABLE AT
http://issues.apache.org/bugzilla/show_bug.cgi?id=31206.
ANY REPLY MADE TO THIS MESSAGE WILL NOT BE COLLECTED AND 
INSERTED IN THE BUG DATABASE.

http://issues.apache.org/bugzilla/show_bug.cgi?id=31206

[PATCH] Improvements over the new line breaking algorithm





--- Additional Comments From [EMAIL PROTECTED]  2004-10-15 16:26 ---
Created an attachment (id=13103)
file 15px.gif used in the test fo file


DO NOT REPLY [Bug 31206] - [PATCH] Improvements over the new line breaking algorithm

2004-10-15 Thread bugzilla
DO NOT REPLY TO THIS EMAIL, BUT PLEASE POST YOUR BUG 
RELATED COMMENTS THROUGH THE WEB INTERFACE AVAILABLE AT
http://issues.apache.org/bugzilla/show_bug.cgi?id=31206.
ANY REPLY MADE TO THIS MESSAGE WILL NOT BE COLLECTED AND 
INSERTED IN THE BUG DATABASE.

http://issues.apache.org/bugzilla/show_bug.cgi?id=31206

[PATCH] Improvements over the new line breaking algorithm





--- Additional Comments From [EMAIL PROTECTED]  2004-10-15 16:26 ---
Created an attachment (id=13104)
file 20px.gif used in the test fo file


DO NOT REPLY [Bug 31206] - [PATCH] Improvements over the new line breaking algorithm

2004-10-15 Thread bugzilla
DO NOT REPLY TO THIS EMAIL, BUT PLEASE POST YOUR BUG 
RELATED COMMENTS THROUGH THE WEB INTERFACE AVAILABLE AT
http://issues.apache.org/bugzilla/show_bug.cgi?id=31206.
ANY REPLY MADE TO THIS MESSAGE WILL NOT BE COLLECTED AND 
INSERTED IN THE BUG DATABASE.

http://issues.apache.org/bugzilla/show_bug.cgi?id=31206

[PATCH] Improvements over the new line breaking algorithm





--- Additional Comments From [EMAIL PROTECTED]  2004-10-15 16:26 ---
Created an attachment (id=13105)
file 30px.gif used in the test fo file


Re: DO NOT REPLY [Bug 31206] - [PATCH] Improvements over the new line breaking algorithm

2004-10-15 Thread Finn Bock
[Luca]
IMPORTANT: I had to revert Finn Bock's changes to the PDFRenderer (dated
2004/09/22 13:22:16), otherwise leaders with svg use-content produce
errors in the pdf output.
There isn't any run-time error, but when I try to open the pdf file, I get
these warnings:
 - There was an error processing a page. Wrong operand type.
 - Illegal operation 'q' inside a text object.
 - Wrong operand type.
and the page with the svg leaders is left empty.
I think it could be something involving the saveGraphicsState() method.
I've just now fixed this issue so that your patch work with the PDFRenderer.
regards,
finn


DO NOT REPLY [Bug 31206] - [PATCH] Improvements over the new line breaking algorithm

2004-09-20 Thread bugzilla
DO NOT REPLY TO THIS EMAIL, BUT PLEASE POST YOUR BUG 
RELATED COMMENTS THROUGH THE WEB INTERFACE AVAILABLE AT
http://issues.apache.org/bugzilla/show_bug.cgi?id=31206.
ANY REPLY MADE TO THIS MESSAGE WILL NOT BE COLLECTED AND 
INSERTED IN THE BUG DATABASE.

http://issues.apache.org/bugzilla/show_bug.cgi?id=31206

[PATCH] Improvements over the new line breaking algorithm

[EMAIL PROTECTED] changed:

   What|Removed |Added

Summary|Improvements over the new   |[PATCH] Improvements over
   |line breaking algorithm |the new line breaking
   ||algorithm