xmlgraphics-batik-users mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Jerry Barber <jbar...@photoaccess.com>
Subject Re: Problems Using Fonts in SVG
Date Fri, 18 Oct 2002 18:21:43 GMT
Here is what I found out, hopefully, since I would think this is fairly 
common, it will help someone else.

If you render text using Graphics2D.setFont and Graphics2D.drawString Java 
apparently uses the underlying X window system to access the font.

However, if you need to get to the glyph outline (which is what Batik uses) 
apparently Java needs access to the font file directly.  You need to add 
the font file to <java_home>/jre/lib/fonts and update 

At 04:25 PM 10/16/2002 -0700, you wrote:
>I'm having trouble using fonts in SVG under Linux (Mandrake 8.1), Batik 
>version 1.5beta4.
>When I use the browser or the renderer very few of the fonts I have 
>installed on the system are recognized (~ 4 or 5).
>I wrote a little java program to lists the available fonts and display 
>them on the screen, it is able to recognize all the fonts (about 70 or 
>so).  It seems to have 2 failure modes, in one case nothing is displayed, 
>in the other the wrong font is displayed.
>On windows as well, all seems to work well.
>They svg file is below, the first string displays the second one 
>doesn't.  Thanks for any help.
><?xml version="1.0" encoding="utf-8"?>
>1.0//EN"    "http://www.w3.org/TR/2001/REC-SVG-20010904/DTD/svg10.dtd" >
><svg  xmlns="http://www.w3.org/2000/svg"
>         width="800" height="400" viewBox="0 0 800 400"
>         overflow="visible" enable-background="new 0 0 800 400" 
> xml:space="preserve">
>                         <g>
>                                 <text transform="matrix(1 0 0 1 200 50)" 
> enable-background="new    ">
>                                   <tspan x="0" y="0" fill="#99A399" 
> font-family="lucidabright" font-size="48">A Test String</tspan>
>                                 </text>
>                                 <text transform="matrix(1 0 0 1 200 
> 300.584)"  fill="#99A399" font-family="Actionis" font-size="48">A Second 
> Test String</text>
>                         </g>
>To unsubscribe, e-mail: batik-users-unsubscribe@xml.apache.org
>For additional commands, e-mail: batik-users-help@xml.apache.org

Jerry Barber
President and CEO
PhotoAccess Corporation
206 902-1401

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

View raw message