Ureader.com  
Microsoft software help and Community
   home   |   control panel login   |   archive   |  
 
XML
data.xmlanalysis
mappoint.webservice
msf
msxml-webrelease
netmyservices.sdk
passport.sdk
soap
soapsdk
uddi.general
uddi.programming
uddi.specification
xml
xmlsqlwebrelease
xsl
  
 
date: Wed, 27 Aug 2008 09:07:38 -0700,    group: microsoft.public.xsl        back       


Wanted: XSLT example that computes size of text   
I am presently using emacs/elisp code to convert my SVG file to C++. In my 
C++ I call special GDI functions to center the text in a specified rectange.

My goal is to use define a common XML from which I will generate SVG and 
XAML using XSLT.

Does anyone have an example XSLT that uses a function like GetTextExtent and 
the font name to properly center their text? I know how to do this inside an 
OnDraw or OnPaint function where someone hands me a DC but I'm not sure how 
to do it where I have to create my own DC. Would I make it point to a 
bitmap?

I presume this would be done with custom XSLT extension written in C#.

Thanks,
Siegfried
date: Wed, 27 Aug 2008 09:07:38 -0700   author:   Siegfried Heintze

Re: Wanted: XSLT example that computes size of text   
* Siegfried Heintze wrote in microsoft.public.xsl:
>Does anyone have an example XSLT that uses a function like GetTextExtent and 
>the font name to properly center their text? I know how to do this inside an 
>OnDraw or OnPaint function where someone hands me a DC but I'm not sure how 
>to do it where I have to create my own DC. Would I make it point to a 
>bitmap?
>
>I presume this would be done with custom XSLT extension written in C#.

In .NET the Graphics class has e.g. MeasureCharacterRanges that allows
you to do this, that's what I used to find proper font sizes so text'd
fill a whole "box" in my SVG images. You should also be able to use GDI+
directly, and in either case you'd indeed get the graphics object from a
bitmap or metafile, as I recall. microsoft.public.win32.programmer.gdi
is a better place for GDI questions.
-- 
Björn Höhrmann · mailto:bjoern@hoehrmann.de · http://bjoern.hoehrmann.de
date: Wed, 27 Aug 2008 18:56:11 +0200   author:   Bjoern Hoehrmann

Google
 
Web ureader.com


    COPYRIGHT 2007, YARDI TECHNOLOGY LIMITED, ALL RIGHT RESERVE  |   contact us