xmlgraphics-batik-users mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Thomas DeWeese <Thomas.DeWe...@Kodak.com>
Subject Re: Rasterizer Only Displays the Default Java Font
Date Mon, 17 Jan 2005 20:53:02 GMT
Hi Dave,

     Wouldn't it be better to figure out how to get the JVM to
recognize the installed fonts?

Dave Austin wrote:

> If I were to edit the SVG on the fly with my rasterizing code.  How
> would I put the style tag into the SVGDoc?  Here is the code that I
> have:
> 
>  Element mergeNode1 = SVGDoc.createElementNS(svgNS, "style");

    I usually create a Text Node (doc.createTextNode) and append
that to the element, According to the DOM Level 2 specs this shouldn't
work!

>    mergeNode1.setNodeValue("<![CDATA[\n "+
                               ^^^^^^^^^^^^
    You don't need (can't have) the CDATA decl.  Just set pass the
string as the parameter to createTextNode.  If you really want a
CDATA section you can call 'doc.createCDATASection(String)' instead
of createTextNode.

>       " @font-face {\n"+
>      "  font-family: 'Times';\n"+
>           "  src: url('times.ttf');\n"+
>           " }  ]]>");
                  ^^^^   Obviously don't do this if you don't do
the CDATA dec.

>     //create MergeDef and append its children

     This looks right off the top of my head.


---------------------------------------------------------------------
To unsubscribe, e-mail: batik-users-unsubscribe@xml.apache.org
For additional commands, e-mail: batik-users-help@xml.apache.org


Mime
View raw message