On Friday 13 July 2001 23:00, Brigette Muller wrote:
> Hi all,
>
> I am using a SVGGraphics2D to build my graphic from Java. When I
> use drawString(string, x, y) for drawing my text. I'm guessing I need
> to use the Font Converter to convert my TrueType font to SVG (which I
> have done). Now, where do I put the SVG so the setFont adds the font to
> the defs? Or do I need to add contents of the converted SVG (the <defs>
> <font ....> </font> </defs>) to the dom separately? Has anyone come up
> with a convention for storing svg fonts for embedding?
>
> I know I can use draw() instead, but I would rather have the fonts
> embedded - as this allows the text search facilities.
At this time, the SVGGraphics2D stores the drawString as text element. The
font CSS property will have the same font name, size and style than the font
you have specified on the SVGGraphics2D (using the setFont method).
The SVG file produced by the SVG generator (aka SVGGraphics2D) is standalone.
The only problem is that the document is not platform independant in terms of
font. Using system font, you can imagine producing an SVG document using
Arial and trying to display this document on linux (which does not have Arial
font). Your text will be displayed anyway but the metrics and for sure the
position might be wrong - and that could be a real problem.
To solve that issue, you have to embed the font (at least a subset) you are
using. There is no way to do that with the SVG generator at this time. This
is something we are working on and that might be available soon.
BTW: the font converter converts ttf font (from a file) to svg font. It does
not do exactly what we need here.
Any contributions/feedback are welcome :)
Thierry.
---------------------------------------------------------------------
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]