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 FJMan <da...@gmx.net> on 2013/11/26 10:35:50 UTC

Custom fonts in Apache FOP (used with Saxon in Eclipse)

Hello!

I tried scubscribing to the mailing list a couple of times now but every
time I get a mailer daemon. So i hope this even gets posted.

I downloaded Apache FOP 1.1 and Saxon9he and included Saxon as XSLT
processor into FOP (instead of Xalan) and then built it with ant. I then
included the fop.jar (and other necessary jars) into Eclipse to use FOP as
fo-processor in my Java-file. The problem now is that I need to use custom
fonts (Arial, Courier New). I have tried getting FOP to use custom fonts but
so far, without luck.

My fop.xonf looks like this:

<renderers>
    <renderer mime="application/pdf">
      <filterList>
        
        <value>flate</value>
  
        
        
  
        
        
      </filterList>

      <fonts>
	  
        
       
	  
        <font-triplet name="Arial" style="normal" weight="normal"/>
			 
				   
        <font-triplet name="Arial,Italic" style="italic" weight="normal"/>
			 
			
        <font-triplet name="Courier New" style="normal" weight="normal"/>
			
       

		  <auto-detect/>
      </fonts>

I tried to transform via the command line with the -c fop.xonf as a
parameter.
Neither the autodetect nor telling fop the location of the fonts works. It
just uses Helvetica and other default fonts. And what is more, I cannot use
the fop.xonf file as a paramater in the command line in my Java programme.




--
View this message in context: http://apache-fop.1065347.n5.nabble.com/Custom-fonts-in-Apache-FOP-used-with-Saxon-in-Eclipse-tp39692.html
Sent from the FOP - Users mailing list archive at Nabble.com.

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


Re: Custom fonts in Apache FOP (used with Saxon in Eclipse)

Posted by Luis Bernardo <lm...@gmail.com>.
Do not use auto-detect. Instead configure the fonts as shown here: 
http://xmlgraphics.apache.org/fop/trunk/fonts.html#register.

The instructions are for trunk but this works the same in 1.1.

On 11/26/13, 9:38 AM, FJMan wrote:
> The fop.xconf looks like this:
>
>
> <renderers>
>      <renderer mime="application/pdf">
>        <filterList>
>          <value>flate</value>
>        </filterList>
>
>        <fonts>
> 	
>          <font-triplet name="Arial" style="normal" weight="normal"/>
> 			
> 				
>          <font-triplet name="Arial,Italic" style="italic" weight="normal"/>
> 			
> 			
>          <font-triplet name="Courier New" style="normal" weight="normal"/>
> 			
> 		  <auto-detect/>
>        </fonts>
>
>
>
> --
> View this message in context: http://apache-fop.1065347.n5.nabble.com/Custom-fonts-in-Apache-FOP-used-with-Saxon-in-Eclipse-tp39692p39693.html
> Sent from the FOP - Users mailing list archive at Nabble.com.
>
> ---------------------------------------------------------------------
> 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: Custom fonts in Apache FOP (used with Saxon in Eclipse)

Posted by FJMan <da...@gmx.net>.
The fop.xconf looks like this:


<renderers>
    <renderer mime="application/pdf">
      <filterList>
        <value>flate</value>
      </filterList>

      <fonts>
	  
        <font-triplet name="Arial" style="normal" weight="normal"/>
			 
				   
        <font-triplet name="Arial,Italic" style="italic" weight="normal"/>
			 
			
        <font-triplet name="Courier New" style="normal" weight="normal"/>
			
		  <auto-detect/>
      </fonts>



--
View this message in context: http://apache-fop.1065347.n5.nabble.com/Custom-fonts-in-Apache-FOP-used-with-Saxon-in-Eclipse-tp39692p39693.html
Sent from the FOP - Users mailing list archive at Nabble.com.

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


Re: Custom fonts in Apache FOP (used with Saxon in Eclipse)

Posted by Registar Man <sz...@gmail.com>.
Hi,

The <auto-detect/> option is always detect the operating system's 
installed fonts as described here: 
http://xmlgraphics.apache.org/fop/1.1/fonts.html#bulk.
Use <directory> instead under <fonts> section, and may can use 
<font-base> ( http://xmlgraphics.apache.org/fop/1.1/configuration.html) 
under root node to specify the custom font's path for use with the exact 
font configuration by <font> node's embed-url attribute! The exact 
configuration may need only if rendering your font's have some failure. 
For other custom fonts simply use the <directory> option.

Bye, Csaba

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