Re: Font Awesome & Dompdf

3,570 views
Skip to first unread message

Fabien Ménager

unread,
Feb 25, 2013, 10:14:38 AM2/25/13
to dom...@googlegroups.com
Did you try with @font-face, with the TTF file ?
Or you can use the font installer in www/fonts.php (via web, at the bottom of the page).

On Monday, February 25, 2013 2:13:04 PM UTC+1, westage wrote:
Hey there, 

is there a way to use Fontawesome in Dompdf? I tried to import it in the dompdf fonts folder but the font is not displayed. :( 

reference:

westage

unread,
Feb 25, 2013, 10:43:05 AM2/25/13
to dom...@googlegroups.com

I used the fontinstaller and it generated 3 files within the fonts folder "fontawesome-webfont.ttf", "fontawesome-webfont.ufm" and "fontawesome-webfont.umf.php. 

As a result of that, the codes(f.e.) standing for a character, disappeared  but were not replaced with one of the icons of fontawesome.

what do you mean with @font-face?

thanks for the quick reply.

Fabien Ménager

unread,
Feb 25, 2013, 11:10:44 AM2/25/13
to dom...@googlegroups.com
By @font-face I mean this : http://pxd.me/dompdf/www/test/css_at_font_face.html (see http://pxd.me/dompdf/www/test/css_at_font_face.html).
Do you specify the right font-family ?

BrianS

unread,
Feb 25, 2013, 1:07:38 PM2/25/13
to dom...@googlegroups.com
If you've installed the font then something like the following should be sufficient:

<p style="font-family: FontAwesome, sans-serif">icon-music (&#xf001;)</p>

Of course, make sure your font-family name matches whatever you used to name the font when you installed it. If you're not sure you can look it up in dompdf/lib/fonts/dompdf_font_family_cache.php (or dompdf_font_family_cache.dist.php).

westage

unread,
Feb 26, 2013, 4:03:39 AM2/26/13
to dom...@googlegroups.com
Ah okay this one worked for me: <i class="icon-ok green">icon-ok (&#xf00c;)</i> Thanks for your Help! Great tool!
Reply all
Reply to author
Forward
0 new messages