DO NOT REPLY [Bug 49355] Text renderer does not output correctly when margin is set

2010-05-28 Thread bugzilla
https://issues.apache.org/bugzilla/show_bug.cgi?id=49355

--- Comment #1 from Vu  2010-05-28 11:24:00 EDT ---
Looking at the source file, I've noticed the following:

- The TXTRenderer uses TXTState as graphic state and TXTState implements as a
stack (LinkedList)
- The CTM is pushed on to this graphic state in 2 cases:
   1) TXTRenderer.startVPArea()
   2) TXTRenderer.concatenateTransformationMatrix()

- But the CTM is popped out from this graphic state only when:
   1) TXTRenderer.endVPArea() is called

- There is no counterpart for TXTRenderer.concatenateTransformationMatrix() to
popped the CTM out of the graphic state and that state accumulates all CTM and
causes issue when rendering content.

My proposed approach is:
In TXTRenderer, create a new variable to keep a stack trace of when CTM is
pushed, popped from the stack and whether it is pushed using the
concatenateTransformationMatrix() method call.  When it is time for popping the
CTM, check this new stack and pop the CTM out of the stack when the CTM is
pushed on it using the concatenateTransformationMatrix() call.

-- Code example:

private LinkedList ctmTransformStack = new LinkedList();

protected void startVParea(CTM ctm, Rectangle2D clippingRect) {
currentState.push(ctm);
ctmTransformStack.addLast(Boolean.FALSE);
}

protected void endVParea() {
currentState.pop();
Boolean transformMatrix = (Boolean) ctmTransformStack.removeLast();

/*
 * Perform compensation pop for concatenateTransformationMatrix()'s push
 */
while (transformMatrix.booleanValue()) {
 currentState.pop();
  transformMatrix = (Boolean) ctmTransformStack.removeLast();
   }
}

protected void concatenateTransformationMatrix(AffineTransform at) {
   currentState.push(new CTM(ptToMpt(at)));
   ctmTransformStack.addLast(Boolean.TRUE);
}

-- 
Configure bugmail: https://issues.apache.org/bugzilla/userprefs.cgi?tab=email
--- You are receiving this mail because: ---
You are the assignee for the bug.


DO NOT REPLY [Bug 49355] New: Text renderer does not output correctly when margin is set

2010-05-28 Thread bugzilla
https://issues.apache.org/bugzilla/show_bug.cgi?id=49355

   Summary: Text renderer does not output correctly when margin is
set
   Product: Fop
   Version: 0.95
  Platform: PC
OS/Version: Windows XP
Status: NEW
  Severity: major
  Priority: P2
 Component: general
AssignedTo: fop-dev@xmlgraphics.apache.org
ReportedBy: vu_k_t...@yahoo.com


Created an attachment (id=25493)
 --> (https://issues.apache.org/bugzilla/attachment.cgi?id=25493)
This file contains sample .fo files for margin-top and margin-bottom settings

1. Configure FO to use text/plain as the output format

2. Generates an .fo file with margin-top sets (to create header)
3. If multiple page is generated, the margin-top value is compounded on the
next pages and push the body text down until no more output for body text.

3. Generates an .fo file with margin-bottom sets (to create footer)
4. Body of text is not output


There are 2 attachments:
1) TextMarginTop.fo: This file contains 2 pages with header information set.
2) TextMarginBottom.fo: This file contains 2 pages with footer information set.

-- 
Configure bugmail: https://issues.apache.org/bugzilla/userprefs.cgi?tab=email
--- You are receiving this mail because: ---
You are the assignee for the bug.


Re: TrueType Fonts in PostScript

2010-05-28 Thread Jeremias Maerki
Hi Vincent,

I'll try to keep up as time allows. Good idea doing this in a branch.

On 28.05.2010 12:46:21 Vincent Hennebert wrote:
> Hi,
> 
> Following Jeremias’ notes about implementing support for TrueType fonts
> in PostScript:
> http://wiki.apache.org/xmlgraphics-fop/TrueTypeInPostScript
> I’d like to give it a go. I will create a branch shortly and work from
> there. Any help or comments would be most welcome, as I’m mostly
> inexperienced in that area.
> 
> 
> Thanks,
> Vincent




Jeremias Maerki



TrueType Fonts in PostScript

2010-05-28 Thread Vincent Hennebert
Hi,

Following Jeremias’ notes about implementing support for TrueType fonts
in PostScript:
http://wiki.apache.org/xmlgraphics-fop/TrueTypeInPostScript
I’d like to give it a go. I will create a branch shortly and work from
there. Any help or comments would be most welcome, as I’m mostly
inexperienced in that area.


Thanks,
Vincent