ASE Home Page Products Download Purchase Support About ASE
ChartDirector General
Forum HomeForum Home   SearchSearch

Message ListMessage List     Post MessagePost Message

  SVG FONT tags
Posted by Chris Conrad on Jan-09-2013 04:08
Hello,

Could you please offer an option to display the FONT tags in SVG using the more verbose method? The app I'm using doesn't like the way the fonts are being described, so I'm having to replace the text in the SVG file.

Example:

Instead of this: "font:5px Arial;"

Can you make it like this: "font-weight:normal;font-size:5px;font-family:Arial;"

Thanks,

-Chris

  Re: SVG FONT tags
Posted by Peter Kwan on Jan-10-2013 00:51
Hi Chris,

ChartDirector is current designed to output SVG in standard compliant format. The font specification are always output as "font:5px Arial;", and this is supported in all major browsers.

I am aware some software only supports a subset of SVG which specifies the font as "font-weight:normal;font-size:5px;font-family:Arial;". In this case, the only solution is to write some code to modify the SVG (which is just text). Basically, the code can read the font specification from the SVG output, obtain the size, family, and bold/italic style, and replace that font specification with the equivalent specification that the software supports. Depending on your exact requirements and programmng environment, it can be as simple as using a regex, or some custom text search and replace code, or using an XML parser to parse the SVG and rewrite it.

Regards
Peter Kwan