Summary: | Right aligned text within table cells is not correctly aligned using PCL | ||
---|---|---|---|
Product: | Fop - Now in Jira | Reporter: | Wyatt <olsonw> |
Component: | pcl | Assignee: | fop-dev |
Status: | CLOSED WORKSFORME | ||
Severity: | regression | CC: | olsonw |
Priority: | P2 | ||
Version: | trunk | ||
Target Milestone: | --- | ||
Hardware: | All | ||
OS: | All | ||
Attachments: |
Test file for right alignment issue
Some demo output (made from PCL output by GhostPCL) |
Description
Wyatt
2008-03-25 12:06:53 UTC
Created attachment 21713 [details]
Test file for right alignment issue
This is the test file which demonstrates the right alignment issue in PCL output.
Created attachment 21714 [details] Some demo output (made from PCL output by GhostPCL) I can't see exactly what you described. In my tests some of the right-most characters are slightly shifted to the right and into the border I made around the table to get some boundaries. I've enhanced your example a bit and attached the resulting TIFF here. This first part uses "Helvetica" which is mapped to a PCL standard font (text-rendering set to "auto") and the second part uses a TrueType font ("DejaVu Serif") which is painted using bitmaps. You can see that in the second part there are no such effects. The problem is the following: We don't have the exact font metrics of those native PCL fonts. They may even be different from printer to printer which would explain your different results. So the result is just an approximation for the case where a native PCL font is used. The good thing about the native font is a smaller PCL file but obviously, it comes with a downside. Fortunately, there is a setting where you can force FOP to output all fonts using bitmaps which should make your problem go away. See the "text-rendering" setting in http://xmlgraphics.apache.org/fop/0.95/output.html#pcl-configuration (you need to switch from "auto" to "bitmap") The alternative would be to implement TrueType font embedding support for the PCL renderer but I've looked into this and it looks very complicated. As a side-note: Even most Windows PCL printer drivers generate all text as bitmaps rather than PCL text. Anyway, you've asked for pointers into the code: org.apache.fop.render.pcl.PCLRenderer, method renderText(TextArea) The local variable "pclFont" determines whether the text is painted as PCL text or as bitmaps. HTH That makes perfect sense about not knowing the font metrics for each device, and explains why we are seeing different results. I have tried using the bitmap output, and it works perfectly. As far as I am concerned, this is a valid workaround, and I agree with you that it would be just about impossible to get this to work for all printers without some more information. I'm still not sure why 0.20.5 works; perhaps it defaults to bitmapped output? I would be fine with closing this ticket as a successful workaround. If there is nothing else which anyone wants to add, I will go ahead and do so. Thanks again for your speedy and excellent response! Cheers (In reply to comment #3) <snip/> > I'm still > not sure why 0.20.5 works; perhaps it defaults to bitmapped output? No, it always uses native PCL text. Not sure why it's good there. Maybe the lack of kerning support reduces the negative effects. <snip/> batch transition to closed remaining pre-FOP1.0 resolved bugs |