You're right, Manuel. I took this as an opportunity to reread the parts
in the spec about the line allocation rectangles. This also showed me
that line-stacking-strategy="line-height" would be the best way to go
here. Therefore, my former "ideal" example was wrong. It should have
been:

<fo:block background-color="yellow" line-stacking-strategy="line-height">
  <fo:external-graphic content-height="40pt" 
src="url('http://www.apache.org/images/asf_logo_wide.gif')"
    alignment-baseline="after-edge"/>
</fo:block>

But as you said, the "line-height" strategy isn't implemented, yet. But
at least, we've got a temporary work-around. :-)

Thanks, Manuel!

On 12.12.2005 13:01:04 Manuel Mall wrote:
> On Mon, 12 Dec 2005 12:07 am, Jeremias Maerki wrote:
> >
> > The gaps above and below of the images come from line-building, i.e.
> > from the line-height property among other factors. I was asked about
> > the same problem by the manufacturer of an FO editor. I still owe him
> > a reponse. :-( Anyway, I think we still have a bug in line-building.
> > I'll have to investigate a little further to come up with a test
> > case. But I think I found a work-around that works for now:
> >
> >       <fo:block background-color="yellow" font-size="0pt">
> >         <fo:external-graphic content-height="40pt"
> > src="url('http://www.apache.org/images/asf_logo_wide.gif')"/>
> > </fo:block>
> >
> > Setting font-size to 0pt does the trick because it doesn't create any
> > half-leading trait, or rather a "0mpt" value.
> >
> > In theory, the problem should be solved like this, I think:
> >
> >       <fo:block background-color="yellow" line-height="1.0">
> >         <fo:external-graphic content-height="40pt"
> > src="url('http://www.apache.org/images/asf_logo_wide.gif')"
> > alignment-baseline="after-edge"/> </fo:block>
> >
> > If I'm not mistaken, line-height="1.0" should in theory not lead to a
> > half-leading trait but that doesn't seem to happen right now. The
> > alignment-baseline is optional here as there are no characters in
> > this block that could have a descender because external-graphic is
> > normally aligned with the "baseline" AFAIK. But if there were
> > additional characters, this might be necessary depending on the
> > expectations. Maybe Manuel has some additional insight here. I'm not
> > the line-building specialist.
> >
> A line-height of 1 means line-height == font-size. The half-leading 
> trait is calculated according to XSL-FO as (line-height - text-altitude 
> + text-depth) / 2. For most fonts (and that applies to our default 
> fonts as well) text-altitude + text-depth < font-size. Therefore you do 
> get a non-zero half-leading value if line-height is 1. For our default 
> font at 12pt the half-leading value with line-height of 1 is 0.45pt. 
> That is enough to be visible in a PDF.
> 
> So I think we are not doing anything wrong.
> 
> There may be other workarounds (in theory) than the one Jeremias 
> suggested, like explicitly setting the text-altitude/depth properties, 
> or setting the line-stacking-strategy to line-height or setting some 
> conditionality on the line-height property. However, none of these are 
> currently implemented in fop. Therefore forcing the half-leading trait 
> to zero by setting the font-size to zero seems the way to go.


Jeremias Maerki


---------------------------------------------------------------------
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]

Reply via email to