I am currently looking at adding the missing background and 
border/padding support to fo:character and have run into a co-ordinate 
system issue. In fop text areas and character areas are positioned in 
the bpd direction using the "offset" attribute which refers to the 
character baseline position. However, border/padding and backgrounds 
are positioned everywhere relative to the top left (or should I say 
before/start) corner of the area rectangle. However, in the renderer 
based on the area traits (for a text or character area) I cannot easily 
determine the before edge position of the rectangle based on the 
baseline offset unless I go to the font and ask for its ascender size 
etc.. But that is really stuff for the layout system.

I see two options:

a) We can wrap the character area into an inlineParent area and put the 
background/border/padding for the character on the inlineParent.
b) We add another attribute to the generic fop area being the baseline 
offset called "lead". The meaning of the attributes is then that 
"offset" refers to the distance between the before edge of the parent 
area to the before edge of the area to be rendered and "lead" is the 
distance from the before edge to the baseline for character placement.

Comments please?


Reply via email to