Some time ago i use this construction

                        <fo:table-column font-weight="bold">
                                <xsl:attribute name="column-width">
                                        <xsl:value-of
select="4*(string-length(order/code)+1)" />pt
                                </xsl:attribute>
                        </fo:table-column>

the number 4 in select =".... is the average width of char in font i use.
This was ok for me, because it don't must be too much precise. 

When you need an more presice width of line, you must compute the with by
importing width of chars from other xml file.

see XSLT functions
document, substring, string-length, value-of, etc.

I wrote this "from hand", i don't try it. There is posibility, that XSLT
functions are not too complex to solve this, so you may need write some
script/extension to XSLT parser. Ask some XSLT gurus for this.

Michal


-----Original Message-----
From: Unger, Joachim [mailto:[EMAIL PROTECTED]
Sent: Thursday, February 06, 2003 10:39 AM
To: '[EMAIL PROTECTED]'
Subject: AW: calculate the length of a text 


Hi Michal !

Thank You. What You describe is the aim. But how can I do that? (The Way?)

Best regards

Joachim


-----Ursprüngliche Nachricht-----
Von: "Buchtík, Michal" [mailto:[EMAIL PROTECTED]
Gesendet: Donnerstag, 6. Februar 2003 07:45
An: '[EMAIL PROTECTED]'
Betreff: RE: calculate the length of a text 


This depending on font-size. You can calculate it from font-size,
font-metrics (generated by TTF or PFM Reader) and length of line (in chars).
You must do this in XSLT.

Best regards

Michal

-----Original Message-----
From: Unger, Joachim [mailto:[EMAIL PROTECTED]
Sent: Wednesday, February 05, 2003 5:02 PM
To: '[EMAIL PROTECTED]'
Subject: How: calculate the length of a text 


How can I calculate the length (in mm) of a text before output?

Is there a solution für FOP?

Regards,

Joachim


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

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

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

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

Reply via email to