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
* 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