Hi Thomas,

You were right the issue is coming from the src URL not pointing to the
file. 

Since I'm using a servlet deployed to a complex app server I've switched my
src URL to use an absolute URL in the SVG code like this:
        <defs>
                <style type="text/css">
                        <![CDATA[
                        @font-face {
                                font-family: "simsun";
                                src: 
url("http://www.example.com:8888/fonts/simsun.ttf";);
                        }
                        ]]>
                </style>
        </defs>

Then my servlet and the Batik transcoder are doing the job perfectly.

Thanks for the help,

Thomas


thomas.deweese wrote:
> 
> Hi Thomas,
> 
> "Thomas Pifre" wrote on 05/27/2008 11:20:07 AM:
> 
>> On my local MS Windows XP it transforms nicely the SVG into JPG.
>> However on my SUSE Linux 9 SP3 machine I'm getting squares instead 
>> of chinese characters. So I guess it has something to do with the 
>> fonts installed on this server.
> 
>    Correct, getting squares means Batik couldn't find a font
> to provide the glyph for a particular code point.
> 
>> *transform my MS Windows TTF (SimSun) into SVG using batik-ttf2svg.
>> jar then call it from my SVG using <font-face /> this didn't work
> 
>    This is not ideal as you lose some potentially nice things like
> font hinting (although very few Chinese fonts are hinted).  Also it
> is worth noting that I think you need to provide some command line 
> args so that it generates the Chinese glyphs.
> 
>> *call my TTF from a <font-face> this didn't work
>> <defs>
>>     <style type="text/css">
>>         <![CDATA[
>>           @font-face {
>>             font-family: 'SimSunLocal';
>>             src: url("font/simsun.ttf") format(svg)
>>           }
>>         ]]>
>>     </style>
>> </defs>
> 
>     This looks fairly good, but I would drop the 
> quotes from the url, and remember that the url is 
> relative to the document (so if the document doesn't
> have a base url because it's constructed in memory
> you need to use an absolute url).  Also I would
> drop the 'format(svg)' (especially since in this case 
> the format is clearly True Type and not SVG).
> 
>> What could be wrong?
> 
>    My guess is that the font-face src url isn't
> pointing to the font file.
> 
> 

-- 
View this message in context: 
http://www.nabble.com/Batik-1.7---Transcoder---Chinese-Font-tp17531524p17553188.html
Sent from the Batik - Users mailing list archive at Nabble.com.


---------------------------------------------------------------------
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]

Reply via email to