[Manuel]
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.
Perhaps I misunderstand, but I think it would be better if we defined an
dominant-baseline on the inlines (or even better
dominant-baseline-identifier on inline and actual-baseline-table on the
fonts) and a baseline-start-point on the linearea. The semantics of
these traits are as described in [4.2.6] and [4.5].
Together with bpd, I think that would be enough to find the rest of the
different rectangles.
I guess it is the same as your suggestion b), but I would rather stick
with the terms used in the spec.
regards,
finn