You are viewing a plain text version of this content. The canonical link for it is here.
Posted to fop-users@xmlgraphics.apache.org by Frank Niedermann <fb...@thelogic.org> on 2008/11/05 13:35:32 UTC

Horizontal and Vertical Alignment with region-start

Hi,

I'm new to XSL-FO and I try to center a rotated text horizontally and
vertically in the region-start area.

This is the FO-file:

<?xml version="1.0" encoding="UTF-8"?>
<fo:root xmlns:fo="http://www.w3.org/1999/XSL/Format">
<fo:layout-master-set>
<fo:simple-page-master margin="0mm" page-width="70.0mm" page-height="38.0mm"
master-name="kanban">
<fo:region-body background-color="#EEEEEE" margin-left="8mm"/>
<fo:region-start reference-orientation="270" background-color="#DDDDDD"
extent="8mm"/>
</fo:simple-page-master>
</fo:layout-master-set>
<fo:page-sequence master-reference="kanban">
<fo:static-content flow-name="xsl-region-start">
<fo:block text-align="center">Hello</fo:block>
</fo:static-content>
<fo:flow flow-name="xsl-region-body">
<fo:block>World</fo:block>
</fo:flow>
</fo:page-sequence>
</fo:root>

The rotated text is centered horizontally (from text view) but not
vertically. What do I need to add to center vertically and horizontally?

Thanks,
  Frank
-- 
View this message in context: http://www.nabble.com/Horizontal-and-Vertical-Alignment-with-region-start-tp20340905p20340905.html
Sent from the FOP - Users mailing list archive at Nabble.com.


---------------------------------------------------------------------
To unsubscribe, e-mail: fop-users-unsubscribe@xmlgraphics.apache.org
For additional commands, e-mail: fop-users-help@xmlgraphics.apache.org


Re: Horizontal and Vertical Alignment with region-start

Posted by Chris Bowditch <bo...@hotmail.com>.
Frank Niedermann wrote:

> Hi,
> 
> I'm new to XSL-FO and I try to center a rotated text horizontally and
> vertically in the region-start area.
> 
> This is the FO-file:
> 
> <?xml version="1.0" encoding="UTF-8"?>
> <fo:root xmlns:fo="http://www.w3.org/1999/XSL/Format">
> <fo:layout-master-set>
> <fo:simple-page-master margin="0mm" page-width="70.0mm" page-height="38.0mm"
> master-name="kanban">
> <fo:region-body background-color="#EEEEEE" margin-left="8mm"/>
> <fo:region-start reference-orientation="270" background-color="#DDDDDD"
> extent="8mm"/>
> </fo:simple-page-master>
> </fo:layout-master-set>
> <fo:page-sequence master-reference="kanban">
> <fo:static-content flow-name="xsl-region-start">
> <fo:block text-align="center">Hello</fo:block>
> </fo:static-content>
> <fo:flow flow-name="xsl-region-body">
> <fo:block>World</fo:block>
> </fo:flow>
> </fo:page-sequence>
> </fo:root>
> 
> The rotated text is centered horizontally (from text view) but not
> vertically. What do I need to add to center vertically and horizontally?

You can specify display-align="center" on region-start element.

Regards,

Chris



---------------------------------------------------------------------
To unsubscribe, e-mail: fop-users-unsubscribe@xmlgraphics.apache.org
For additional commands, e-mail: fop-users-help@xmlgraphics.apache.org


Re: Horizontal and Vertical Alignment with region-start

Posted by Jeremias Maerki <de...@jeremias-maerki.ch>.
On 05.11.2008 15:31:24 Frank Niedermann wrote:
> 
> Eric,
> 
> I've tried that but I don't see any changes, this is what I have now:
> 
>   <fo:static-content flow-name="xsl-region-start">
>     <fo:block-container display-align="center">
>       <fo:block text-align="center">Hello</fo:block>
>     </fo:block-container> 
> </fo:static-content>
> 
> Could the reference-orientation be the reason that it won't align in center?

No. The reason: the block-container has no explicit
block-prgression-dimension/height and therefore is exactly as high as
its contents, so it can't do any centering.

> <fo:region-start extent="8mm" background-color="#1e90ff"
> reference-orientation="270" />
> 
> Frank
> -- 
> View this message in context: http://www.nabble.com/Horizontal-and-Vertical-Alignment-with-region-start-tp20340905p20342800.html
> Sent from the FOP - Users mailing list archive at Nabble.com.



Jeremias Maerki


---------------------------------------------------------------------
To unsubscribe, e-mail: fop-users-unsubscribe@xmlgraphics.apache.org
For additional commands, e-mail: fop-users-help@xmlgraphics.apache.org


RE: Horizontal and Vertical Alignment with region-start

Posted by Frank Niedermann <fb...@thelogic.org>.
Eric,

I've tried that but I don't see any changes, this is what I have now:

  <fo:static-content flow-name="xsl-region-start">
    <fo:block-container display-align="center">
      <fo:block text-align="center">Hello</fo:block>
    </fo:block-container> 
</fo:static-content>

Could the reference-orientation be the reason that it won't align in center?
<fo:region-start extent="8mm" background-color="#1e90ff"
reference-orientation="270" />

Frank
-- 
View this message in context: http://www.nabble.com/Horizontal-and-Vertical-Alignment-with-region-start-tp20340905p20342800.html
Sent from the FOP - Users mailing list archive at Nabble.com.


---------------------------------------------------------------------
To unsubscribe, e-mail: fop-users-unsubscribe@xmlgraphics.apache.org
For additional commands, e-mail: fop-users-help@xmlgraphics.apache.org


RE: Horizontal and Vertical Alignment with region-start

Posted by "Amick, Eric" <Er...@mail.house.gov>.
Wrap the block(s) in a block-container and use the display-align
property:

<fo:block-container display-align="center">
<fo:block text-align="center">Hello</fo:block>
</fo:block-container>


Eric Amick
Legislative Computer Systems
Office of the Clerk

-----Original Message-----
From: Frank Niedermann [mailto:fbn@thelogic.org] 
Sent: Wednesday, November 5, 2008 7:36
To: fop-users@xmlgraphics.apache.org
Subject: Horizontal and Vertical Alignment with region-start


Hi,

I'm new to XSL-FO and I try to center a rotated text horizontally and
vertically in the region-start area.

This is the FO-file:

<?xml version="1.0" encoding="UTF-8"?>
<fo:root xmlns:fo="http://www.w3.org/1999/XSL/Format">
<fo:layout-master-set>
<fo:simple-page-master margin="0mm" page-width="70.0mm"
page-height="38.0mm"
master-name="kanban">
<fo:region-body background-color="#EEEEEE" margin-left="8mm"/>
<fo:region-start reference-orientation="270" background-color="#DDDDDD"
extent="8mm"/>
</fo:simple-page-master>
</fo:layout-master-set>
<fo:page-sequence master-reference="kanban"> <fo:static-content
flow-name="xsl-region-start"> <fo:block
text-align="center">Hello</fo:block>
</fo:static-content>
<fo:flow flow-name="xsl-region-body">
<fo:block>World</fo:block>
</fo:flow>
</fo:page-sequence>
</fo:root>

The rotated text is centered horizontally (from text view) but not
vertically. What do I need to add to center vertically and horizontally?

Thanks,
  Frank
--
View this message in context:
http://www.nabble.com/Horizontal-and-Vertical-Alignment-with-region-star
t-tp20340905p20340905.html
Sent from the FOP - Users mailing list archive at Nabble.com.


---------------------------------------------------------------------
To unsubscribe, e-mail: fop-users-unsubscribe@xmlgraphics.apache.org
For additional commands, e-mail: fop-users-help@xmlgraphics.apache.org


---------------------------------------------------------------------
To unsubscribe, e-mail: fop-users-unsubscribe@xmlgraphics.apache.org
For additional commands, e-mail: fop-users-help@xmlgraphics.apache.org


Re: Horizontal and Vertical Alignment with region-start

Posted by Frank Niedermann <fb...@thelogic.org>.
Hi Chris,


cbowditch wrote:
> 
> You can specify display-align="center" on region-start element.
> 

that did the trick - thanks!

Frank
-- 
View this message in context: http://www.nabble.com/Horizontal-and-Vertical-Alignment-with-region-start-tp20340905p20356109.html
Sent from the FOP - Users mailing list archive at Nabble.com.


---------------------------------------------------------------------
To unsubscribe, e-mail: fop-users-unsubscribe@xmlgraphics.apache.org
For additional commands, e-mail: fop-users-help@xmlgraphics.apache.org