Hi all,
I'm trying to get custom fonts working in SVG (JSR-226).
All is fine with a static SVG document with an embedded font definition, but what I cant do is to create a text element dynamically (or change the value of an existing node) that uses this embedded font.
ie:
SVGElement textElem = (SVGElement) doc.createElementNS("http://www.w3.org/2000/svg", "text");
textElem.setTrait("font-family", "custom_font");
textElem.setTrait("#text","ληνικ");
or
textElem.setTrait("#text","\u03C1");
Also you can not get an existing text element and set its text
in SVG this is OK:
<text font-family="custom_font" id="test" x="10" y="100">ληνρ</text>
but in code this does not work:
SVGElement text = (SVGElement) (SVGElement)doc_.getElementById("test");
text.setTrail("#text","ληνικ");
Sun emulators work fine. Nokia emulator (S40 6th Ed.) and device (6303i) do not.
Has anyone got this to work?? If so how?
Cheers
Ed.

Reply With Quote

