You are viewing a plain text version of this content. The canonical link for it is here.
Posted to batik-users@xmlgraphics.apache.org by coen <co...@yahoo.co.jp> on 2006/03/18 11:46:11 UTC

about FONT in case of SVG to JPEG

Hi,
I try to transcode SVG to JPGE by JPEGTranscoder Class.
But, the font is not correctly converted. (It returns to
the system font...)

my source-----------------------------------
		JPEGTranscoder trans = new JPEGTranscoder();
		trans.addTranscodingHint(JPEGTranscoder.KEY_QUALITY, new
Float(1.0));
		File file = new File(svgFilePath);

		TranscoderInput input = new TranscoderInput("file:" +
file.getAbsolutePath());
		
		try {
			OutputStream outStream = new
FileOutputStream("test.jpg");
			TranscoderOutput output = new
TranscoderOutput(outStream);
			trans.transcode(input, output);
			outStream.flush();
			outStream.close();
		} catch (IOException e) {
			e.printStackTrace();
		} catch (TranscoderException e) {
			e.printStackTrace();
		}
-----------------------------------


When SVG file, its font is correctly displayed by SVG
Viewr. 
What should I set special one in transcoding?

regards
Coen

--------------------------------------
TSUKAME EIKOU! KAGAYAKE EGAO!
Yahoo! JAPAN JPC OFFICIAL PARTNER INTERNET PORTAL SITE
http://pr.mail.yahoo.co.jp/wintergames/

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


Re: about FONT in case of SVG to JPEG

Posted by coen <co...@yahoo.co.jp>.
Hi, Thomas

I understood why it cannot be displayed correctly.
I make SVG File by "adboe Illustrator CS".
Its font definition is wrong.
When I changed like CSS, it got good one.

Thanx.

Coen
> Hi Coen,
> 
> coen <co...@yahoo.co.jp> wrote on 03/18/2006
> 08:56:53 PM:
> 
> > >Did you try building a correct URL as I
> suggested?
> > 
> > Yes. I did what you say, but result was same
> one...
> > ('File.toURL().toString()')
> > I used 'True Type Font'.
> > I think if svg one can be displayd collectly in
> SVG
> > Viewer, setting is OK...why?
> 
>    The way the viewer constructs the URL is
> different
> from how you built the URL.
> 
>    How do you reference the Font? 
> 
>         Do you use CSS to point at the Font file?
>         Do you just use the font name and assume
> it's 
> installed on system?
>                 Are you running the transcoder on
> the
>                 same system as the viewer?
> 
>    Can you send an example of how you reference the
> font?
> 
> > 
> > thanks
> > 
> > Coen
> > 
> > > Hi Coen,
> > > 
> > >    So did you read the rest of my message?  Did
> you
> > > try building a correct
> > > URL as I suggested?  Can you include some of the
> SVG
> > > where you 
> > > reference/define the font?  What kind of font
> are
> > > you referencing?
> > > 
> > > coen <co...@yahoo.co.jp> wrote on 03/18/2006
> > > 02:00:56 PM:
> > > 
> > > > > I suspect it just can't find the font file.
> > > > 
> > > > Before transcode to JPEG, 
> > > > the font is displayed in the SVG File by SVG
> > > Viewer.
> > > > (I think it just can find the font file.)
> > > > <-->
> > > > but, after transcode to JPEG, the font isn't
> > > displayed
> > > > correctly...
> > > > 
> > > > Should I make config.xml like a fop PDF?
> > > 
> > >    There is no config.xml for Batik.  Any font
> > > configuration
> > > is done through CSS and would be identical for
> the
> > > Viewer
> > > and the transcoder.
> > > 
> > > > 
> > > > 
> > > > 
> > > > > Hi Coen,
> > > > > 
> > > > > coen <co...@yahoo.co.jp> wrote on
> 03/18/2006
> > > > > 05:46:11 AM:
> > > > > 
> > > > > > I try to transcode SVG to JPGE by
> > > JPEGTranscoder
> > > > > Class.
> > > > > > But, the font is not correctly converted.
> (It
> > > > > returns to
> > > > > > the system font...)
> > > > > 
> > > > >    There shouldn't be any real difference.
> > > > > 
> > > > > >       File file = new File(svgFilePath);
> > > > > >       TranscoderInput input = new
> > > > > TranscoderInput("file:" +
> > > > > > file.getAbsolutePath());
> > > > > 
> > > > >     This will not generate a "correct" file
> URL.
> > >  I
> > > > > would
> > > > > suggest using the 'File.toURL().toString()'
> > > method
> > > > > to construct
> > > > > the file URL.  It is possible that this URL
> > > works
> > > > > for opening the
> > > > > document but is a problem when it tries to
> > > locate
> > > > > the font.
> > > > > 
> > > > >    If this does't help a little more
> information
> > > on
> > > > > how the font
> > > > > is referenced would help (like sample SVG
> > > content).
> > > > > 
> > > > > > When SVG file, its font is correctly
> displayed
> > > by
> > > > > SVG
> > > > > > Viewr. 
> > > > > > What should I set special one in
> transcoding?
> > > > > 
> > > > >    There isn't anything special to set for
> > > > > transcoding, 
> > > > > I suspect it just can't find the font file.
> > > > > 
> > > > >
> > > >
> > >
> >
>
---------------------------------------------------------------------
> > > > > To unsubscribe, e-mail:
> > > > >
> batik-users-unsubscribe@xmlgraphics.apache.org
> > > > > For additional commands, e-mail:
> > > > > batik-users-help@xmlgraphics.apache.org
> > > > > 
> > > > > 
> > > > 
> > > > --------------------------------------
> > > > TSUKAME EIKOU! KAGAYAKE EGAO!
> > > > Yahoo! JAPAN JPC OFFICIAL PARTNER INTERNET
> PORTAL
> > > SITE
> > > > http://pr.mail.yahoo.co.jp/wintergames/
> > > > 
> > > >
> > >
> >
>
---------------------------------------------------------------------
> > > > To unsubscribe, e-mail:
> > > batik-users-unsubscribe@xmlgraphics.apache.org
> > > > For additional commands, e-mail:
> > > batik-users-help@xmlgraphics.apache.org
> > > > 
> > > 
> > > 
> > >
> >
>
---------------------------------------------------------------------
> > > To unsubscribe, e-mail:
> > > batik-users-unsubscribe@xmlgraphics.apache.org
> > > For additional commands, e-mail:
> > > batik-users-help@xmlgraphics.apache.org
> > > 
> > > 
> > 
> > --------------------------------------
> > TSUKAME EIKOU! KAGAYAKE EGAO!
> > Yahoo! JAPAN JPC OFFICIAL PARTNER INTERNET PORTAL
> SITE
> > http://pr.mail.yahoo.co.jp/wintergames/
> > 
> >
>
---------------------------------------------------------------------
> > To unsubscribe, e-mail:
> batik-users-unsubscribe@xmlgraphics.apache.org
> > For additional commands, e-mail:
> batik-users-help@xmlgraphics.apache.org
> > 
> 
> 
>
---------------------------------------------------------------------
> To unsubscribe, e-mail:
> batik-users-unsubscribe@xmlgraphics.apache.org
> For additional commands, e-mail:
> batik-users-help@xmlgraphics.apache.org
> 
> 

--------------------------------------
TSUKAME EIKOU! KAGAYAKE EGAO!
Yahoo! JAPAN JPC OFFICIAL PARTNER INTERNET PORTAL SITE
http://pr.mail.yahoo.co.jp/wintergames/

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


Re: about FONT in case of SVG to JPEG

Posted by th...@kodak.com.
Hi Coen,

coen <co...@yahoo.co.jp> wrote on 03/18/2006 08:56:53 PM:

> >Did you try building a correct URL as I suggested?
> 
> Yes. I did what you say, but result was same one...
> ('File.toURL().toString()')
> I used 'True Type Font'.
> I think if svg one can be displayd collectly in SVG
> Viewer, setting is OK...why?

   The way the viewer constructs the URL is different
from how you built the URL.

   How do you reference the Font? 

        Do you use CSS to point at the Font file?
        Do you just use the font name and assume it's 
installed on system?
                Are you running the transcoder on the
                same system as the viewer?

   Can you send an example of how you reference the font?

> 
> thanks
> 
> Coen
> 
> > Hi Coen,
> > 
> >    So did you read the rest of my message?  Did you
> > try building a correct
> > URL as I suggested?  Can you include some of the SVG
> > where you 
> > reference/define the font?  What kind of font are
> > you referencing?
> > 
> > coen <co...@yahoo.co.jp> wrote on 03/18/2006
> > 02:00:56 PM:
> > 
> > > > I suspect it just can't find the font file.
> > > 
> > > Before transcode to JPEG, 
> > > the font is displayed in the SVG File by SVG
> > Viewer.
> > > (I think it just can find the font file.)
> > > <-->
> > > but, after transcode to JPEG, the font isn't
> > displayed
> > > correctly...
> > > 
> > > Should I make config.xml like a fop PDF?
> > 
> >    There is no config.xml for Batik.  Any font
> > configuration
> > is done through CSS and would be identical for the
> > Viewer
> > and the transcoder.
> > 
> > > 
> > > 
> > > 
> > > > Hi Coen,
> > > > 
> > > > coen <co...@yahoo.co.jp> wrote on 03/18/2006
> > > > 05:46:11 AM:
> > > > 
> > > > > I try to transcode SVG to JPGE by
> > JPEGTranscoder
> > > > Class.
> > > > > But, the font is not correctly converted. (It
> > > > returns to
> > > > > the system font...)
> > > > 
> > > >    There shouldn't be any real difference.
> > > > 
> > > > >       File file = new File(svgFilePath);
> > > > >       TranscoderInput input = new
> > > > TranscoderInput("file:" +
> > > > > file.getAbsolutePath());
> > > > 
> > > >     This will not generate a "correct" file URL.
> >  I
> > > > would
> > > > suggest using the 'File.toURL().toString()'
> > method
> > > > to construct
> > > > the file URL.  It is possible that this URL
> > works
> > > > for opening the
> > > > document but is a problem when it tries to
> > locate
> > > > the font.
> > > > 
> > > >    If this does't help a little more information
> > on
> > > > how the font
> > > > is referenced would help (like sample SVG
> > content).
> > > > 
> > > > > When SVG file, its font is correctly displayed
> > by
> > > > SVG
> > > > > Viewr. 
> > > > > What should I set special one in transcoding?
> > > > 
> > > >    There isn't anything special to set for
> > > > transcoding, 
> > > > I suspect it just can't find the font file.
> > > > 
> > > >
> > >
> >
> ---------------------------------------------------------------------
> > > > To unsubscribe, e-mail:
> > > > batik-users-unsubscribe@xmlgraphics.apache.org
> > > > For additional commands, e-mail:
> > > > batik-users-help@xmlgraphics.apache.org
> > > > 
> > > > 
> > > 
> > > --------------------------------------
> > > TSUKAME EIKOU! KAGAYAKE EGAO!
> > > Yahoo! JAPAN JPC OFFICIAL PARTNER INTERNET PORTAL
> > SITE
> > > http://pr.mail.yahoo.co.jp/wintergames/
> > > 
> > >
> >
> ---------------------------------------------------------------------
> > > To unsubscribe, e-mail:
> > batik-users-unsubscribe@xmlgraphics.apache.org
> > > For additional commands, e-mail:
> > batik-users-help@xmlgraphics.apache.org
> > > 
> > 
> > 
> >
> ---------------------------------------------------------------------
> > To unsubscribe, e-mail:
> > batik-users-unsubscribe@xmlgraphics.apache.org
> > For additional commands, e-mail:
> > batik-users-help@xmlgraphics.apache.org
> > 
> > 
> 
> --------------------------------------
> TSUKAME EIKOU! KAGAYAKE EGAO!
> Yahoo! JAPAN JPC OFFICIAL PARTNER INTERNET PORTAL SITE
> http://pr.mail.yahoo.co.jp/wintergames/
> 
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: batik-users-unsubscribe@xmlgraphics.apache.org
> For additional commands, e-mail: batik-users-help@xmlgraphics.apache.org
> 


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


Re: about FONT in case of SVG to JPEG

Posted by coen <co...@yahoo.co.jp>.
Hi,

>Did you try building a correct URL as I suggested?

Yes. I did what you say, but result was same one...
('File.toURL().toString()')
I used 'True Type Font'.
I think if svg one can be displayd collectly in SVG
Viewer, setting is OK...why?

thanks

Coen

> Hi Coen,
> 
>    So did you read the rest of my message?  Did you
> try building a correct
> URL as I suggested?  Can you include some of the SVG
> where you 
> reference/define the font?  What kind of font are
> you referencing?
> 
> coen <co...@yahoo.co.jp> wrote on 03/18/2006
> 02:00:56 PM:
> 
> > > I suspect it just can't find the font file.
> > 
> > Before transcode to JPEG, 
> > the font is displayed in the SVG File by SVG
> Viewer.
> > (I think it just can find the font file.)
> > <-->
> > but, after transcode to JPEG, the font isn't
> displayed
> > correctly...
> > 
> > Should I make config.xml like a fop PDF?
> 
>    There is no config.xml for Batik.  Any font
> configuration
> is done through CSS and would be identical for the
> Viewer
> and the transcoder.
> 
> > 
> > 
> > 
> > > Hi Coen,
> > > 
> > > coen <co...@yahoo.co.jp> wrote on 03/18/2006
> > > 05:46:11 AM:
> > > 
> > > > I try to transcode SVG to JPGE by
> JPEGTranscoder
> > > Class.
> > > > But, the font is not correctly converted. (It
> > > returns to
> > > > the system font...)
> > > 
> > >    There shouldn't be any real difference.
> > > 
> > > >       File file = new File(svgFilePath);
> > > >       TranscoderInput input = new
> > > TranscoderInput("file:" +
> > > > file.getAbsolutePath());
> > > 
> > >     This will not generate a "correct" file URL.
>  I
> > > would
> > > suggest using the 'File.toURL().toString()'
> method
> > > to construct
> > > the file URL.  It is possible that this URL
> works
> > > for opening the
> > > document but is a problem when it tries to
> locate
> > > the font.
> > > 
> > >    If this does't help a little more information
> on
> > > how the font
> > > is referenced would help (like sample SVG
> content).
> > > 
> > > > When SVG file, its font is correctly displayed
> by
> > > SVG
> > > > Viewr. 
> > > > What should I set special one in transcoding?
> > > 
> > >    There isn't anything special to set for
> > > transcoding, 
> > > I suspect it just can't find the font file.
> > > 
> > >
> >
>
---------------------------------------------------------------------
> > > To unsubscribe, e-mail:
> > > batik-users-unsubscribe@xmlgraphics.apache.org
> > > For additional commands, e-mail:
> > > batik-users-help@xmlgraphics.apache.org
> > > 
> > > 
> > 
> > --------------------------------------
> > TSUKAME EIKOU! KAGAYAKE EGAO!
> > Yahoo! JAPAN JPC OFFICIAL PARTNER INTERNET PORTAL
> SITE
> > http://pr.mail.yahoo.co.jp/wintergames/
> > 
> >
>
---------------------------------------------------------------------
> > To unsubscribe, e-mail:
> batik-users-unsubscribe@xmlgraphics.apache.org
> > For additional commands, e-mail:
> batik-users-help@xmlgraphics.apache.org
> > 
> 
> 
>
---------------------------------------------------------------------
> To unsubscribe, e-mail:
> batik-users-unsubscribe@xmlgraphics.apache.org
> For additional commands, e-mail:
> batik-users-help@xmlgraphics.apache.org
> 
> 

--------------------------------------
TSUKAME EIKOU! KAGAYAKE EGAO!
Yahoo! JAPAN JPC OFFICIAL PARTNER INTERNET PORTAL SITE
http://pr.mail.yahoo.co.jp/wintergames/

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


Re: about FONT in case of SVG to JPEG

Posted by th...@kodak.com.
Hi Coen,

   So did you read the rest of my message?  Did you try building a correct
URL as I suggested?  Can you include some of the SVG where you 
reference/define the font?  What kind of font are you referencing?

coen <co...@yahoo.co.jp> wrote on 03/18/2006 02:00:56 PM:

> > I suspect it just can't find the font file.
> 
> Before transcode to JPEG, 
> the font is displayed in the SVG File by SVG Viewer.
> (I think it just can find the font file.)
> <-->
> but, after transcode to JPEG, the font isn't displayed
> correctly...
> 
> Should I make config.xml like a fop PDF?

   There is no config.xml for Batik.  Any font configuration
is done through CSS and would be identical for the Viewer
and the transcoder.

> 
> 
> 
> > Hi Coen,
> > 
> > coen <co...@yahoo.co.jp> wrote on 03/18/2006
> > 05:46:11 AM:
> > 
> > > I try to transcode SVG to JPGE by JPEGTranscoder
> > Class.
> > > But, the font is not correctly converted. (It
> > returns to
> > > the system font...)
> > 
> >    There shouldn't be any real difference.
> > 
> > >       File file = new File(svgFilePath);
> > >       TranscoderInput input = new
> > TranscoderInput("file:" +
> > > file.getAbsolutePath());
> > 
> >     This will not generate a "correct" file URL.  I
> > would
> > suggest using the 'File.toURL().toString()' method
> > to construct
> > the file URL.  It is possible that this URL works
> > for opening the
> > document but is a problem when it tries to locate
> > the font.
> > 
> >    If this does't help a little more information on
> > how the font
> > is referenced would help (like sample SVG content).
> > 
> > > When SVG file, its font is correctly displayed by
> > SVG
> > > Viewr. 
> > > What should I set special one in transcoding?
> > 
> >    There isn't anything special to set for
> > transcoding, 
> > I suspect it just can't find the font file.
> > 
> >
> ---------------------------------------------------------------------
> > To unsubscribe, e-mail:
> > batik-users-unsubscribe@xmlgraphics.apache.org
> > For additional commands, e-mail:
> > batik-users-help@xmlgraphics.apache.org
> > 
> > 
> 
> --------------------------------------
> TSUKAME EIKOU! KAGAYAKE EGAO!
> Yahoo! JAPAN JPC OFFICIAL PARTNER INTERNET PORTAL SITE
> http://pr.mail.yahoo.co.jp/wintergames/
> 
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: batik-users-unsubscribe@xmlgraphics.apache.org
> For additional commands, e-mail: batik-users-help@xmlgraphics.apache.org
> 


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


Re: about FONT in case of SVG to JPEG

Posted by coen <co...@yahoo.co.jp>.
Hi,

> I suspect it just can't find the font file.

Before transcode to JPEG, 
the font is displayed in the SVG File by SVG Viewer.
(I think it just can find the font file.)
<-->
but, after transcode to JPEG, the font isn't displayed
correctly...

Should I make config.xml like a fop PDF?



> Hi Coen,
> 
> coen <co...@yahoo.co.jp> wrote on 03/18/2006
> 05:46:11 AM:
> 
> > I try to transcode SVG to JPGE by JPEGTranscoder
> Class.
> > But, the font is not correctly converted. (It
> returns to
> > the system font...)
> 
>    There shouldn't be any real difference.
> 
> >       File file = new File(svgFilePath);
> >       TranscoderInput input = new
> TranscoderInput("file:" +
> > file.getAbsolutePath());
> 
>     This will not generate a "correct" file URL.  I
> would
> suggest using the 'File.toURL().toString()' method
> to construct
> the file URL.  It is possible that this URL works
> for opening the
> document but is a problem when it tries to locate
> the font.
> 
>    If this does't help a little more information on
> how the font
> is referenced would help (like sample SVG content).
> 
> > When SVG file, its font is correctly displayed by
> SVG
> > Viewr. 
> > What should I set special one in transcoding?
> 
>    There isn't anything special to set for
> transcoding, 
> I suspect it just can't find the font file.
> 
>
---------------------------------------------------------------------
> To unsubscribe, e-mail:
> batik-users-unsubscribe@xmlgraphics.apache.org
> For additional commands, e-mail:
> batik-users-help@xmlgraphics.apache.org
> 
> 

--------------------------------------
TSUKAME EIKOU! KAGAYAKE EGAO!
Yahoo! JAPAN JPC OFFICIAL PARTNER INTERNET PORTAL SITE
http://pr.mail.yahoo.co.jp/wintergames/

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


Re: about FONT in case of SVG to JPEG

Posted by th...@kodak.com.
Hi Coen,

coen <co...@yahoo.co.jp> wrote on 03/18/2006 05:46:11 AM:

> I try to transcode SVG to JPGE by JPEGTranscoder Class.
> But, the font is not correctly converted. (It returns to
> the system font...)

   There shouldn't be any real difference.

>       File file = new File(svgFilePath);
>       TranscoderInput input = new TranscoderInput("file:" +
> file.getAbsolutePath());

    This will not generate a "correct" file URL.  I would
suggest using the 'File.toURL().toString()' method to construct
the file URL.  It is possible that this URL works for opening the
document but is a problem when it tries to locate the font.

   If this does't help a little more information on how the font
is referenced would help (like sample SVG content).

> When SVG file, its font is correctly displayed by SVG
> Viewr. 
> What should I set special one in transcoding?

   There isn't anything special to set for transcoding, 
I suspect it just can't find the font file.

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