Re: [xsl] Decimal alignment using fo:leader

Subject: Re: [xsl] Decimal alignment using fo:leader
From: Abel Braaksma <abel.online@xxxxxxxxx>
Date: Thu, 23 Aug 2007 18:42:25 +0200
Angela Williams wrote:

Although, I could if that is the only other alternative... In that case,
I think I would need to calculate the width of the decimal part column
to limit it to the actual width of the decimal value with the highest
precision and the largest font size. Otherwise, I might still have an
issue fudging right alignment? Both columns would need to fit within
the defined column width for the original single column... Or am I
making it too complicated?

I think so, yes, too complicated. But here's more If you want the "best" solution, you can augment your current solution with a rendered-string-size calculator function. You probably only want to do that in XSLT 2.0. You should apply it to a second phase (i.e., the xsl-fo output you already have) and as ingredients for a success story, you need to have the glyph XML files of each font you can use (Apache provides a fine tool for getting the glyphs dimensions as XML). The rest is fairly easy: just calculate the length based on the width you find for each letter in the glyphs file (granted, you are almost creating a font rendering engine). (if you want a solid solution and don't want to do this yourself, I'm happy to help you with some professional services).


The question you should ask yourself: is this cosmetic change really worth all the trouble? The other question you should ask is: how easy is it to create an extension function for XEP and use that instead? Or to call them and to demand this feature?

I'm really hoping that I am close in my current solution and someone
with advanced xsl-fo skills will see some tiny detail I am overlooking
in the alignment. :-)

Your best bet is a processor that supports XSL-FO 1.0 better. Unfortunately, the only processor that seems to support text-align="somestring" is PassiveTeX and that one really does a bad job on many other things so cannot currently be considered a good alternative for XEP: http://www.diderottrack.nl/en/article/xslfo.en-se14.xml


You can call RenderX and ask for this feature.... ;)

Cheers,
-- Abel Braaksma

PS: I too am hoping that somebody proofs me wrong and says that there's an easier solution here....G. Ken Holman? ;)

Current Thread