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

RE: Using Java in XSLT to determine font metrics

Subject: RE: Using Java in XSLT to determine font metrics
From: Hermann Stamm-Wilbrandt <STAMMW@xxxxxxxxxx>
Date: Tue, 23 Dec 2008 11:24:56 +0100
RE:  Using Java in XSLT to determine font metrics
> This is my first attempt at calling an external Java method
> to do work on behalf of  a stylesheet. I'm not a Java
> developer so I think I need a fairly complete "cookbook"
>  description of how to do this. My objective is to determine
> the exact length, in pixels,  of a given string based on the
> font and font size in play.
> ...
> ...
> <?xml version="1.0" encoding="UTF-8"?>
> <xsl:stylesheet
> xmlns:xsl="http://www.w3.org/1999/XSL/Transform" version="2.0"
>     xmlns:FontMetrics="ext://java.awt.FontMetrics">
>     <xsl:output indent="yes"/>.
> ...

Your <xsl:output> statement does not contain a method attribute
and therefore defaults to 'html'.

Your objective might perhaps be solved alternatively on the
client side if relying on JavaScript is an option to you.

http://www.faqts.com/knowledge_base/view.phtml/aid/15770/fid/53
("How can you determine the width in pixels a string will
  occupy on screen?")


Hermann Stamm-Wilbrandt
Developer, XML Compiler
WebSphere DataPower SOA Appliances
----------------------------------------------------------------------
IBM Deutschland Research & Development GmbH
Vorsitzender des Aufsichtsrats: Martin Jetter
Geschdftsf|hrung: Erich Baier
Sitz der Gesellschaft: Bvblingen
Registergericht: Amtsgericht Stuttgart, HRB 243294

Current Thread

PURCHASE STYLUS STUDIO ONLINE TODAY!

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.
Email
First Name
Last Name
Company
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-2011 All Rights Reserved.