Re: [xep-support] Vertical alignment of inlinemediaobject

From: G. Ken Holman <>
Date: Thu Feb 21 2008 - 19:35:18 PST

At 2008-02-21 17:11 -0800, Peter Keung wrote:
>I've tried all sorts of combinations of alignment-baseline,
>alignment-adjust, baseline-shift, relative-align, vertical-align,
>display-align, etc.

Then I guess you didn't try the correct one! :{)}

>What I want for inline image alignment is this, which seems to be
>the default in FOP 0.24:
> +-+ Blahhhh, Blahhh, Blahhh, Blahhh, Blahhh,
> | |
> + +

That is an incorrect default ... the default is that the base of the
image sits on top of the text baseline.

>In XEP, I get this:
> +-+
> | |
> +-+ Blahhhh, Blahhh, Blahhh, Blahhh, Blahhh,


>Basically, I want the image to output from the top down, aligned
>with the top of the text with XEP. Is this possible?

Absolutely it is: in XSL-FO the alignment-adjust= specifies which
point of the object is to be used for alignment, while the
alignment-baseline= specifies the point of the line to which the
object is aligned.

So you want to align the before-edge of your image with the
before-edge of the line. Seems to work fine in XEP.

I hope the example below helps. Just plug in the name of your image
in place of "star.gif".

. . . . . . . . . . Ken

<?xml version="1.0" encoding="US-ASCII"?><!>
<root xmlns=""
       font-family="Times" font-size="20pt">

     <simple-page-master master-name="frame"
                         page-height="297mm" page-width="210mm"
                         margin-top="15mm" margin-bottom="15mm"
                         margin-left="15mm" margin-right="15mm">
       <region-body region-name="frame-body"/>

   <page-sequence master-reference="frame">
     <flow flow-name="frame-body" xmlns="">
         This is a test of image alignment; "Xy" is used
         to show the location of the top, baseline, and
         bottom of the character box.</block>
         Default: image sits on baseline
         Xy<external-graphic src='url("star.gif")'/>yX
         Aligning the base to the bottom of the line:
         Xy<external-graphic src='url("star.gif")'
         Aligning the top to the top of the line:
         Xy<external-graphic src='url("star.gif")'
       <block>End of test</block>

World-wide corporate, govt. & user group XML, XSL and UBL training
RSS feeds:     publicly-available developer resources and training
G. Ken Holman       
Crane Softwrights Ltd.
Box 266, Kars, Ontario CANADA K0A-2E0    +1(613)489-0999 (F:-0995)
Male Cancer Awareness Nov'07
Legal business disclaimers:
(*) To unsubscribe, send a message with words 'unsubscribe xep-support'
in the body of the message to from the address
you are subscribed from.
(*) By using the Service, you expressly agree to these Terms of Service
Received on Thu Feb 21 21:13:10 2008

This archive was generated by hypermail 2.1.8 : Thu Feb 21 2008 - 21:13:11 PST