Re: [XSL-FO] rotating text within a table-cell
- Harm Kok wrote:
> Somewhat, it did help me understanding the problem better. I still don'tIf you can get the length of the text in the XSLT process you can
> like the idea of having to put fixed values in the "width" attribute. It
> varies with the amount of text.
> If the processor cannot calculate the width, how can I calculate it?
probably define a reasonable guess algorithm to set a width, e.g.:
<xsl:variable name="conlen" select="length(string(.))"/>
<xsl:when test="$conlen < 100">2em</xsl:when>
<xsl:when test="$conlen < 400">6em</xsl:when>
<xsl:when test="$conlen < 600">8em</xsl:when>
<xsl:otherwise>10em<xsl:message>More text than expected.
I've started looking into using extension functions that can get
font-specific metrics to do more accurate content size guessing at XSLT
time, but so far have not found a Java font metrics implementation that
will work outside of an active AWT object (which is what the built-in
Java implementation requires). RenderX has said they will eventually
make their font metrics library publicly available, which would make it
possible to do much more accurate width guessing so you could solve
problems like this to a reasonable degree.
This requirement could also be addressed by the use of a general
"auxiliary data file" mechanism that let you capture rendition-time
values and put them out to a file for input into a second pass. This
would enable feedback from the rendering step to the XSLT step.
W. Eliot Kimber, eliot@...
Consultant, ISOGEN International
1016 La Posada Dr., Suite 240
Austin, TX 78752 Phone: 512.656.4139