[XSL-LIST Mailing List Archive Home] [By Thread] [By Date] [Recent Entries] [Reply To This Message]

Re: evaluate rendered text lenght

Subject: Re: evaluate rendered text lenght
From: Eliot Kimber <ekimber@xxxxxxxxxxxx>
Date: Tue, 24 May 2011 11:03:51 -0500
Re:  evaluate rendered text lenght
The renderedTextLength extension was pretty simple. It uses the Java 2D
package (which is part of the standard Java distribution) to take the text
string, the font size, and the font to render the text string and thus get
the approximate rendered length. It can only be approximate of course
because it doesn't perform kerning or interword-space tuning or anything),
but it's good enough for short text strings and is very accurate for
monospace fonts, which was my primary use case (figuring out how much to
drop the font of literal examples so they would fit within the available
rendition space).

It would be hard for someone to reimplement the extension but it's not
something I can do at the moment.

Also, the original extension was written as a Saxon 6 extension, so it would
not work with current Saxon versions.



On 5/24/11 5:05 AM, "Giuseppe Briotti" <g.briotti@xxxxxxxxx> wrote:

> Hi all, I would like to evalutate the lenght of a string as it will be
> rendered in FOP. Of course, because of FOP formatting strategy, this
> info can be just an approximation, but for my purpouse can be enough.
> I've seen the Eliot Kimber extension (Function "renderedTextLength")
> but it is no longer available on Innodata Isogen web site. There are
> other alternatives?
> Giuseppe Briotti

Eliot Kimber
Senior Solutions Architect
"Bringing Strategy, Content, and Technology Together"
Main: 512.554.9368

Current Thread


Purchasing Stylus Studio from our online shop is Easy, Secure and Value Priced!

Buy Stylus Studio Now

Download The World's Best XML IDE!

Accelerate XML development with our award-winning XML IDE - Download a free trial today!

Don't miss another message! Subscribe to this list today.
First Name
Last Name
Subscribe in XML format
RSS 2.0
Atom 0.3
Site Map | Privacy Policy | Terms of Use | Trademarks
Free Stylus Studio XML Training:
W3C Member
Stylus Studio® and DataDirect XQuery ™are products from DataDirect Technologies, is a registered trademark of Progress Software Corporation, in the U.S. and other countries. © 2004-2013 All Rights Reserved.