Justified Text

1. Left and right justified text
2. Justfied, and with line breaks.

1.

Left and right justified text

MURAKAMI Shinyu

> I'm trying to format some text so part of it is
> left-aligned, and part of it is right-aligned. 
> For example:
> 
> Left-hand text               Right-hand text
> --------------------------------------------
	

Try the following:

  <fo:block text-align-last="justify">
    Left-hand text
    <fo:leader leader-pattern="space" />
    Right-hand text
  </fo:block>

2.

Justfied, and with line breaks.

Ken Holman


>Quick question: I have a snippet of xml that looks like this--
>
>------------------------------------------------------
><p>There was at the school to which I went,<lb/>
>a boy about twelve, the same age with myself.<lb/>
>His name was William Harding&mdash;he was the<lb/>
>only child of a widow lady, living a retired etc...</p>
>------------------------------------------------------
>
>What I want to do is render the paragraph as fully justified but also
>respect the line-breaks (indicated by the linebreak tag)
>
>I tried the following:
>
><xsl:template match="p">
>    <fo:block font-size="12pt"
>                 font-family="serif"
>                 line-height="22pt"
>                 text-align="justify">
>   &#160;&#160;&#160;<xsl:apply-templates />
>          </fo:block>
></xsl:template>
>
>with the secondary rule:
>
><xsl:template match="lb">
>      <fo:block />
></xsl:template>
>
>The result I get, unfortunately, is a paragraph respecting line breaks but
>not fully justified.  Anyone have any ideas?

Use text-align-last="justify" because the introduction of the empty block elements makes the line ahead of <lb/> the last line of the previous block.

The property text-align= applies to all lines for all values *except* justify, when it only applies to the lines that aren't the last line.

Keep the text-align="justify" only if any of your lines might wrap ... if they will never wrap, then you don't need this property.