xmlgraphics-fop-users mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Vincent Hennebert <vincent.henneb...@anyware-tech.com>
Subject Re: Text Formatting Problem
Date Thu, 17 Jan 2008 11:11:43 GMT
Hi Eric,

Try something like the following:
    <block-container width="1.5in" space-after="-14.4pt">
      <block>Here is some really long text for testing.</block>
    </block-container>
    <table start-indent="1.5in" width="100%" table-layout="fixed">
      <table-column column-width="1.5in" number-columns-repeated="2"/>
      <table-body start-indent="0">
        <table-cell>
          <block>99999</block>
        </table-cell>
        <table-cell>
          <block>And now for some more text.</block>
        </table-cell>
      </table-body>
    </table>

The idea is to shift the table one line upwards by setting a negative 
margin on the block-container. This negative margin should have the 
value (font-size * 1.2) to match a regular line height.
A block-container is needed to set its width to 1.5in instead of the 
page width. The table is then used for the two remaining columns, with 
an appropriate start-indent to leave room to the first “column”.

HTH,
Vincent


Amick, Eric wrote:
> I should have pointed out that the first and third columns can both have
> more than two lines, and that I can't guarantee both columns will have
> the same number of lines. 
> 
> Here's what I'm currently trying; this is a greatly simplified test:
> 
> <?xml version="1.0"?>
> <root xmlns="http://www.w3.org/1999/XSL/Format">
>   <layout-master-set>
>     <simple-page-master page-height="11in" page-width="8.5in"
> margin-left="1in" margin-right="1in" margin-top="2in"
> margin-bottom="2in" master-name="foo">
>       <region-body/>
>     </simple-page-master>
>   </layout-master-set>
>   <page-sequence master-reference="foo">
>     <flow flow-name="xsl-region-body">
>       <table table-layout="fixed">
>         <table-column column-width="1.5in" number-columns-repeated="3"/>
>         <table-body display-align="after">
>           <table-row>
>             <table-cell>
>               <block>Here is some really long text for testing.</block>
>             </table-cell>
>             <table-cell>
>               <block>99999</block>
>             </table-cell>
>             <table-cell>
>               <block-container overflow="hidden" wrap-option="no-wrap">
>                 <block>And now for some more text.</block>
>               </block-container>
>             </table-cell>
>           </table-row>
>           <table-row>
>             <table-cell column-number="3">
>               <block-container overflow="hidden"
> text-indent="-from-table-column(column-width)">
>                 <block>And now for some more text.</block>
>               </block-container>
>             </table-cell>
>           </table-row>
>           <table-row>
>             <table-cell>
>               <block>foo</block>
>             </table-cell>
>             <table-cell>
>               <block>88888</block>
>             </table-cell>
>             <table-cell>
>               <block>Some text.</block>
>             </table-cell>
>           </table-row>
>         </table-body>
>       </table>
>     </flow>
>   </page-sequence>
> </root> 
> 
> 
> This is close to what I need, but it has two problems:
> 1) In the first table-row, the text in the third column gets clipped in
> the middle of a letter during my testing, which is obviously
> undesirable.
> 2) This method works only if you can generate the extra table-row for a
> given entry only when needed. I tried the empty-cells="hide" property on
> that extra row, but the spec says hide works only when there is no
> visible content, which they define as being completely empty or
> containing only whitespace. If you shorten the text going into the third
> column, you'll see the extra row still appears even though it contains
> nothing that prints on the page.
> 
> I wish there was some way to determine if a particular block was going
> to wrap, or to specify that only N lines of a wrapped block should be
> displayed.
> 
> 
> Eric Amick
> Legislative Computer Systems
> Office of the Clerk
> 
> -----Original Message-----
> From: Andreas L Delmelle [mailto:a_l.delmelle@pandora.be] 
> Sent: Tuesday, January 15, 2008 16:40
> To: fop-users@xmlgraphics.apache.org
> Subject: Re: Text Formatting Problem
> 
> On Jan 15, 2008, at 18:03, Amick, Eric wrote:
> 
> Hi
> 
>> I have a three-column listing of phone numbers, and most of the time, 
>> each column entry has only one line of text. Sometimes, however, I 
>> have entries that look like this:
>>
>> Text that spans
>>     two lines ...........  99999   More text that
>>                                              spans two lines
>>
>> In case the format gets garbled, the number in the second column 
>> should line up with the last line of text in the first column and the 
>> first line of text in the third column. I've tried using display-align
> 
>> and vertical-align, but I can't come up with a way that works. Does 
>> anyone have any suggestions?

-- 
Vincent Hennebert                            Anyware Technologies
http://people.apache.org/~vhennebert         http://www.anyware-tech.com
Apache FOP Committer                         FOP Development/Consulting

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


Mime
View raw message