eZ Community » Forums » Extensions » ParadoxPDF and font-family
expandshrink

ParadoxPDF and font-family

ParadoxPDF and font-family

Wednesday 09 February 2011 2:40:49 pm - 11 replies

Hi,

I use the paradoxpdf extension and I would like to know if there is a way to modify the default font-family used in the PDFs ?

I've tried to change it in the print-core.css file without success (while I can modify some other css elements).

Pascal

PS: Isn't it possible to ensure that the extension ParadoxPDF is displayed on the first page of results when doing a «PDF» search at the project.ez.no site ?

Modified on Wednesday 09 February 2011 2:41:10 pm by Pascal France

Wednesday 09 February 2011 4:59:06 pm

Hi Pascal,

The solution I found was to declare the font using font-face declaration :

@font-face { font-family : "Arial"; src: url(../fonts/arial.ttf); -fs-pdf-font-embed: embed;}

body {font-family:"Arial";}

Of course you need to upload the .ttf of the font.

Modified on Wednesday 09 February 2011 5:02:33 pm by Sébastien Antoniotti

Wednesday 09 February 2011 7:13:41 pm

Thanks for your reply Sébastien,

Could you explain me where you put you déclaration ?

I'm trying to use Google web Fonts. This one for testing:

http://code.google.com/webfonts/f...Dancing+Script&subset=latin#code

(other fonts are here: http://code.google.com/webfonts)

So, I put the «@font-face» declaration in many places in the print-core.css file without success.
I've tried the:

<link href='http://fonts.googleapis.com/css?family=Dancing+Script' rel='stylesheet' type='text/css'>

declaration too in paradoxpdf_layout.tpl. But the font is not used.

Thursday 10 February 2011 9:59:34 am

Here is my print-core.css :

@page {    size: a4 portrait;    margin: 0.25in;        padding: 1em;       padding-top:130px;    @top-left {       content: element(header);    }     @bottom-right {        content: element(footer);      }  }
 @font-face {      font-family : "Arial"; /*put here font family name example Arial*/      src: url(../fonts/arial.ttf);   /*put here relative path to your font*/      -fs-pdf-font-embed: embed;        /* defaults to auto (i.e. not embedded) */  }
body {font-size:13px;font-family:"Arial";}

... sorry for the non-indentation blunk.gif Emoticon

Modified on Thursday 10 February 2011 10:00:41 am by Sébastien Antoniotti

Thursday 10 February 2011 6:35:18 pm

I don't know why but this doen't work for me.

Thanks again blunk.gif Emoticon

Friday 11 February 2011 10:40:42 am

Maybe the path to arial.ttf (or your_font.ttf) is wrong or has bad permissions ?

Wednesday 07 September 2011 10:51:19 am

Hi,

This post is rather old, but I have a problem.
The font doesn't apply to my PDF by using this code:

 @font-face {      
    font-family : "Arial";       
    src: url(../fonts/arial.ttf) format('truetype');      
    -fs-pdf-font-embed: embed;
    -fs-pdf-font-encoding: Identity-H;  
}
body {
    font-size:11px;
    font-family:"Arial";
}

Have you an idea ?

Thanks

Modified on Wednesday 07 September 2011 10:52:06 am by Dominique LEVERBE

Friday 09 September 2011 10:33:04 am

Hi Dominique, 

While i can not answer your question directly, i recommend to drop the link to your question in the ParadoxPDF forums out there : http://projects.ez.no/paradoxpdf/forum/issues . This might trigger notifications to the project team and get you an answer more quickly.

Cheers,

Friday 09 September 2011 11:45:43 am

Hi Dominique,

Maybe you should try one or combinaison of this :

1) replace 

src: url(../fonts/arial.ttf) format('truetype');

by

src: url(../fonts/arial.ttf);

2) try to apply the font on another element : 

p, div.myclass, h1 {   font-family:"Arial";}

3) be sure of the font path

Hope it can help !

Modified on Friday 09 September 2011 11:47:04 am by Sébastien Antoniotti

Wednesday 14 September 2011 4:37:39 pm

Hi Sébastien,

I replace the url, and apply the font on another element, but no success.

the font path is correct.

Another idea ?

Thursday 15 September 2011 8:44:13 am

Hi,

- Maybe try with an another font (new font file, new font name) ?

- take a look at paradoxpdf.log...

- disable the PDF generation (comments in paradoxpdf_layout.tpl) and call the url of your PDF to see if the XHTML rendered is well styled by your font in the browser...

Thursday 15 September 2011 3:53:08 pm

I found my problem.
In the rewriterules in the virtualhost, the folder "fonts" was not accepted.

So replace :

 Rewriterule ^/extension/[^/]+/design/[^/]+/(stylesheets|images|javascripts?|flash)/.* - [L]

By :

 Rewriterule ^/extension/[^/]+/design/[^/]+/(stylesheets|images|fonts|javascripts?|flash)/.* - [L]

Modified on Thursday 15 September 2011 3:54:37 pm by Dominique LEVERBE

expandshrink

You must be logged in to post messages in this topic!

36 542 Users on board!

Forums menu

Proudly Developed with from