You are viewing a plain text version of this content. The canonical link for it is here.
Posted to fop-users@xmlgraphics.apache.org by Barry Whiting <ba...@londonmarketing.com> on 2008/11/11 11:20:01 UTC

Embeded SVG fonts

Hi

 

I wondered if somebody could help with an svg font.  Does the font have
to be embedded into the svg or do I simply add the font to the fop
config to embed into the pdf?

 

Thanks

 

Barry


RE: Embeded SVG fonts

Posted by Barry Whiting <ba...@londonmarketing.com>.
Hi Jeremias

The font is installed on my local machine but not on the server so I
guess I will have to install it on there then?

Thanks

Barry

-----Original Message-----
From: Jeremias Maerki [mailto:dev@jeremias-maerki.ch] 
Sent: 11 November 2008 13:56
To: fop-users@xmlgraphics.apache.org
Subject: Re: Embeded SVG fonts

Barry,

for SVG the whole font story is sometimes a bit special. Did you install
the Arial fonts in the operating system, too? The thing is: When you use
a font in SVG it is primarily handled by Batik which uses the operating
system's fonts. If it's not installed, the font is likely to get
substituted. Only when rendering to PDF, FOP's font library kicks in and
tries to find a matching font for the one reported by Batik. So if Batik
substitutes with a fallback font, your ArialMT might not get picked up.
I'm not sure if it's that but it's my best bet.

On 11.11.2008 13:26:15 Barry Whiting wrote:
> Hi Vincent
> 
> We are using fop 0.95.  The svg image has to be added as a background
image to a block container so that we can overlay another svg on top of
this like a pointer on a map so Im not sure if thats my problem or not?
> 
>  I have know changed my config as your suggestion which is cool but
hasn't helped yet.
> 
> I have attached an example fo, fop-config and svg image for you
hopefully this will help.
> 
> Thanks
> 
> Barry
<snip/>



Jeremias Maerki


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


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


Re: Embeded SVG fonts

Posted by Jeremias Maerki <de...@jeremias-maerki.ch>.
Barry,

for SVG the whole font story is sometimes a bit special. Did you install
the Arial fonts in the operating system, too? The thing is: When you use
a font in SVG it is primarily handled by Batik which uses the operating
system's fonts. If it's not installed, the font is likely to get
substituted. Only when rendering to PDF, FOP's font library kicks in and
tries to find a matching font for the one reported by Batik. So if Batik
substitutes with a fallback font, your ArialMT might not get picked up.
I'm not sure if it's that but it's my best bet.

On 11.11.2008 13:26:15 Barry Whiting wrote:
> Hi Vincent
> 
> We are using fop 0.95.  The svg image has to be added as a background image to a block container so that we can overlay another svg on top of this like a pointer on a map so Im not sure if thats my problem or not?
> 
>  I have know changed my config as your suggestion which is cool but hasn't helped yet.
> 
> I have attached an example fo, fop-config and svg image for you hopefully this will help.
> 
> Thanks
> 
> Barry
<snip/>



Jeremias Maerki


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


RE: Embeded SVG fonts

Posted by Barry Whiting <ba...@londonmarketing.com>.
Hi Vincent

We are using fop 0.95.  The svg image has to be added as a background image to a block container so that we can overlay another svg on top of this like a pointer on a map so Im not sure if thats my problem or not?

 I have know changed my config as your suggestion which is cool but hasn't helped yet.

I have attached an example fo, fop-config and svg image for you hopefully this will help.

Thanks

Barry

-----Original Message-----
From: Vincent Hennebert [mailto:vhennebert@gmail.com] 
Sent: 11 November 2008 12:10
To: fop-users@xmlgraphics.apache.org
Subject: Re: Embeded SVG fonts

Hi Barry,

Barry Whiting wrote:
> Ok Jeremias I have managed to generate the metrics file for the 3 fonts
> I need to embed and have added this to my config file
> 
> 
> 	<font
> metrics-url="/data/webroot/www.londontown.com/HotelPrintMap/fonts/arial.
> xml" kerning="yes"
> embed-url="/data/webroot/www.londontown.com/HotelPrintMap/fonts/arial.tt
> f">
> 		<font-triplet name="ArialMT" style="normal"
> weight="normal"/>
> 	</font>
<snip/>
> 
> For some reason these 3 fonts are not being embedded how ever which I
> don't understand as I have other fonts in this config file that does
> embed correctly.
> 
> I wondered if you could see if there is anything I have done from this
> config?

Which FOP version are you using? This should work fine with the latest
0.95 one. Also, with that version you don’t need to generate XML metrics
any more, just specifying the embed-url attribute is enough.

Make sure the URIs giving access to the fonts are correct. In the
example you provided they are absolute and there’s no scheme (http:,
file: or whatever). Are you sure this is what you want?

Also, make sure the value you give to the ‘name’ attribute of
font-triplet matches the font-family value in the SVG file.

If all of that fail, please provide us with small XSL-FO and SVG samples
and your config file, so that we can have a closer look.

<snip/>

HTH,
Vincent

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


Re: Embeded SVG fonts

Posted by Vincent Hennebert <vh...@gmail.com>.
Hi Barry,

Barry Whiting wrote:
> Ok Jeremias I have managed to generate the metrics file for the 3 fonts
> I need to embed and have added this to my config file
> 
> 
> 	<font
> metrics-url="/data/webroot/www.londontown.com/HotelPrintMap/fonts/arial.
> xml" kerning="yes"
> embed-url="/data/webroot/www.londontown.com/HotelPrintMap/fonts/arial.tt
> f">
> 		<font-triplet name="ArialMT" style="normal"
> weight="normal"/>
> 	</font>
<snip/>
> 
> For some reason these 3 fonts are not being embedded how ever which I
> don't understand as I have other fonts in this config file that does
> embed correctly.
> 
> I wondered if you could see if there is anything I have done from this
> config?

Which FOP version are you using? This should work fine with the latest
0.95 one. Also, with that version you don’t need to generate XML metrics
any more, just specifying the embed-url attribute is enough.

Make sure the URIs giving access to the fonts are correct. In the
example you provided they are absolute and there’s no scheme (http:,
file: or whatever). Are you sure this is what you want?

Also, make sure the value you give to the ‘name’ attribute of
font-triplet matches the font-family value in the SVG file.

If all of that fail, please provide us with small XSL-FO and SVG samples
and your config file, so that we can have a closer look.

<snip/>

HTH,
Vincent

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


RE: Embeded SVG fonts

Posted by Barry Whiting <ba...@londonmarketing.com>.
Ok Jeremias I have managed to generate the metrics file for the 3 fonts
I need to embed and have added this to my config file


	<font
metrics-url="/data/webroot/www.londontown.com/HotelPrintMap/fonts/arial.
xml" kerning="yes"
embed-url="/data/webroot/www.londontown.com/HotelPrintMap/fonts/arial.tt
f">
		<font-triplet name="ArialMT" style="normal"
weight="normal"/>
	</font>
	<font
metrics-url="/data/webroot/www.londontown.com/HotelPrintMap/fonts/swiss7
21bt.xml" kerning="yes"
embed-url="/data/webroot/www.londontown.com/HotelPrintMap/fonts/Swiss_72
1_BT.ttf">
		<font-triplet name="Swiss721BT-Roman" style="normal"
weight="normal"/>
	</font>
	<font
metrics-url="/data/webroot/www.londontown.com/HotelPrintMap/fonts/swiss7
21bt_bold.xml" kerning="yes"
embed-url="/data/webroot/www.londontown.com/HotelPrintMap/fonts/Swiss_72
1_Bold_Italic_BT.ttf">
		<font-triplet name="Swiss721BT-Roman" style="italic"
weight="bold"/>
	</font>

For some reason these 3 fonts are not being embedded how ever which I
don't understand as I have other fonts in this config file that does
embed correctly.

I wondered if you could see if there is anything I have done from this
config?

Thanks

Barry

-----Original Message-----
From: Jeremias Maerki [mailto:dev@jeremias-maerki.ch] 
Sent: 11 November 2008 10:50
To: fop-users@xmlgraphics.apache.org
Subject: Re: Embeded SVG fonts

Yes.

On 11.11.2008 11:46:40 Barry Whiting wrote:
> Hi Jeremias
> 
> Thanks for your speedy response.
> 
> If I understand correct then I can take a type 1 font or truetype font
> and embed into the pdf fine for the svg to display correctly?
> 
> Thanks
> 
> Barry
> 
> -----Original Message-----
> From: Jeremias Maerki [mailto:dev@jeremias-maerki.ch] 
> Sent: 11 November 2008 10:26
> To: fop-users@xmlgraphics.apache.org
> Subject: Re: Embeded SVG fonts
> 
> PDF Output can't deal with SVG fonts. They would need to be converted
> into Type 3 fonts internally which we don't support, yet. SVG fonts
will
> be painted as shapes (i.e. no copy/paste functionality in Acrobat).
SVG
> fonts, AFAIK, can be embedded in or referenced from the SVG file.
> Therefore, there's also no way to configure it. Batik will handle the
> SVG font transparently for FOP.
> 
> If you need copy/paste functionality, you currently need to use a
> TrueType or Type 1.
> 
> On 11.11.2008 11:20:01 Barry Whiting wrote:
> > Hi
> >  
> > I wondered if somebody could help with an svg font.  Does the font
> have
> > to be embedded into the svg or do I simply add the font to the fop
> > config to embed into the pdf?
> >  
> > Thanks
> >  
> > Barry
> 
> 
> 
> 
> Jeremias Maerki
> 
> 




Jeremias Maerki


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


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


Re: Embeded SVG fonts

Posted by Jeremias Maerki <de...@jeremias-maerki.ch>.
Yes.

On 11.11.2008 11:46:40 Barry Whiting wrote:
> Hi Jeremias
> 
> Thanks for your speedy response.
> 
> If I understand correct then I can take a type 1 font or truetype font
> and embed into the pdf fine for the svg to display correctly?
> 
> Thanks
> 
> Barry
> 
> -----Original Message-----
> From: Jeremias Maerki [mailto:dev@jeremias-maerki.ch] 
> Sent: 11 November 2008 10:26
> To: fop-users@xmlgraphics.apache.org
> Subject: Re: Embeded SVG fonts
> 
> PDF Output can't deal with SVG fonts. They would need to be converted
> into Type 3 fonts internally which we don't support, yet. SVG fonts will
> be painted as shapes (i.e. no copy/paste functionality in Acrobat). SVG
> fonts, AFAIK, can be embedded in or referenced from the SVG file.
> Therefore, there's also no way to configure it. Batik will handle the
> SVG font transparently for FOP.
> 
> If you need copy/paste functionality, you currently need to use a
> TrueType or Type 1.
> 
> On 11.11.2008 11:20:01 Barry Whiting wrote:
> > Hi
> >  
> > I wondered if somebody could help with an svg font.  Does the font
> have
> > to be embedded into the svg or do I simply add the font to the fop
> > config to embed into the pdf?
> >  
> > Thanks
> >  
> > Barry
> 
> 
> 
> 
> Jeremias Maerki
> 
> 




Jeremias Maerki


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


RE: Embeded SVG fonts

Posted by Barry Whiting <ba...@londonmarketing.com>.
Hi Jeremias

Thanks for your speedy response.

If I understand correct then I can take a type 1 font or truetype font
and embed into the pdf fine for the svg to display correctly?

Thanks

Barry

-----Original Message-----
From: Jeremias Maerki [mailto:dev@jeremias-maerki.ch] 
Sent: 11 November 2008 10:26
To: fop-users@xmlgraphics.apache.org
Subject: Re: Embeded SVG fonts

PDF Output can't deal with SVG fonts. They would need to be converted
into Type 3 fonts internally which we don't support, yet. SVG fonts will
be painted as shapes (i.e. no copy/paste functionality in Acrobat). SVG
fonts, AFAIK, can be embedded in or referenced from the SVG file.
Therefore, there's also no way to configure it. Batik will handle the
SVG font transparently for FOP.

If you need copy/paste functionality, you currently need to use a
TrueType or Type 1.

On 11.11.2008 11:20:01 Barry Whiting wrote:
> Hi
>  
> I wondered if somebody could help with an svg font.  Does the font
have
> to be embedded into the svg or do I simply add the font to the fop
> config to embed into the pdf?
>  
> Thanks
>  
> Barry




Jeremias Maerki


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


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


Re: Embeded SVG fonts

Posted by Jeremias Maerki <de...@jeremias-maerki.ch>.
PDF Output can't deal with SVG fonts. They would need to be converted
into Type 3 fonts internally which we don't support, yet. SVG fonts will
be painted as shapes (i.e. no copy/paste functionality in Acrobat). SVG
fonts, AFAIK, can be embedded in or referenced from the SVG file.
Therefore, there's also no way to configure it. Batik will handle the
SVG font transparently for FOP.

If you need copy/paste functionality, you currently need to use a
TrueType or Type 1.

On 11.11.2008 11:20:01 Barry Whiting wrote:
> Hi
>  
> I wondered if somebody could help with an svg font.  Does the font have
> to be embedded into the svg or do I simply add the font to the fop
> config to embed into the pdf?
>  
> Thanks
>  
> Barry




Jeremias Maerki


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