Web-based font preparation tool

2,636 views
Skip to first unread message

BrianS

unread,
Feb 24, 2010, 12:51:42 PM2/24/10
to dompdf
A number of people have had problems installing fonts so that DOMPDF
can embed them into a PDF document. Since the files that result from
processing a font (*.afm, *.ufm, dompdf_font_family_cache) are not
specific to a single installation this is a process that can be done
on any system. In order to make font embedding available to a wider
audience we have set up a web-based font preparation tool. Anyone can
use this tool to create all the files necessary to install a font into
their DOMPDF installation.

The steps for using this tools are:
1) Go to the URL indicated below:
2) Provide a font name. This should match the name you use when
referencing the font in your document stylesheet
3) Select each of the four files that represent the font variants
(normal, bold, italic, bold-italic)
4) Submit the form and save the resulting ZIP file to your computer.
5) Upload the contents of the ZIP file to your DOMPDF font folder,
typically located in dompdf/lib/fonts
6a) If you *have not* previously installed any fonts into your copy of
DOMPDF you can rename dompdf_font_family_cache.sample to
dompdf_font_family_cache.
6b) If you *have* previously loaded fonts into your copy of DOMPDF,
see the sample file for hints on how to modify
dompdf_font_family_cache.

Please provide any feedback and/or questions about this tool here.

You can find the tool at the following location:
http://eclecticgeek.com/dompdf/load_font.php

Fabien Ménager

unread,
Mar 8, 2010, 4:28:45 PM3/8/10
to dompdf
I just tested your tool with the FreeFont fonts (http://
savannah.gnu.org/projects/freefont/) and it worked pretty well !
The font generation time is very short, the font family cache sample
is useful.
One suggestion I would make, even not related to this tool is to embed
more fonts in the DOMPDF package. There are a few open fonts I'm
thinking of : DejaVu, FreeFont, and others :
http://en.wikipedia.org/wiki/Free_software_Unicode_typefaces
This would be very good for lazy people like me ;) and DOMPDF would
support UTF8 quite natively.

BrianS

unread,
Mar 11, 2010, 1:41:34 PM3/11/10
to dompdf
On Mar 8, 4:28 pm, Fabien Ménager <fabien.mena...@gmail.com> wrote:
> I just tested your tool with the FreeFont fonts (http://
> savannah.gnu.org/projects/freefont/) and it worked pretty well !
> The font generation time is very short, the font family cache sample
> is useful.

Glad to hear you found it useful.

> One suggestion I would make, even not related to this tool is to embed
> more fonts in the DOMPDF package. There are a few open fonts I'm
> thinking of : DejaVu, FreeFont, and others :http://en.wikipedia.org/wiki/Free_software_Unicode_typefaces
> This would be very good for lazy people like me ;) and DOMPDF would
> support UTF8 quite natively.

That's a good suggestion. I think once we tackle some of the bugs on
our list we'll spend some more time looking into other fonts we can
include with the package.

Shamharoth

unread,
Mar 24, 2010, 5:28:30 AM3/24/10
to dompdf

thx for answer. I tried to generate a czech font (I downloaded the
font from here: http://www.kwintessential.co.uk/fonts/czech/download.html
- Font 4) but when I generate a new PDF with
ščřžýáíé
I got everytime
¹èø¾ýáíé
so there is a problem with the "inverted roof".
So I tried it with the font package from Martin Všetička for dompdf
( http://www.martinvseticka.eu/index.php?sekce=browse&page=159 ) but
the pdf is everytime the same.
What did I make wrong?

Toltec7

unread,
Apr 12, 2010, 9:06:11 AM4/12/10
to dompdf
I cannot get croatian characters čćđČĆĐ out of any font file that
includes those characters which makes me think you're filtering it
away.
Please set it up so that all the characters get included or give an
option to select the characters.
This way, i'll have to abandon dompdf...

BrianS

unread,
Apr 12, 2010, 10:22:38 AM4/12/10
to dompdf

The font prep tool doesn't filter out any characters. There are a few
issues with the tool that still need to be worked out. The main
problem is that ttf2ufm behaves differently when run in a batch mode
versus directly from the command line. I haven't had a chance to track
down the problem yet.

A few questions:
- Are you using DOMPDF 0.6.0 beta 1?
- Have you enabled Unicode support in dompdf_config.inc.php?
- Is the font correctly installed for DOMPDF (do other characters
display correctly)?

If you post the font where I can access it I will test it out and see
what's going on.

Đani Stojanov

unread,
Apr 12, 2010, 10:29:00 AM4/12/10
to dom...@googlegroups.com
I'm using utf-8 and certain specific characters are displayed correctly (ŠŽšž) and all the central european ones as well (german, danish etc...)
but čćđČĆĐ are hopeless.
I'm using standard windows Arial actually and i know for sure the characters are there, but they just display '?'
I am using the latest dompdf and font is installed correctly of course.



--
You received this message because you are subscribed to the Google Groups "dompdf" group.
To post to this group, send email to dom...@googlegroups.com.
To unsubscribe from this group, send email to dompdf+un...@googlegroups.com.
For more options, visit this group at http://groups.google.com/group/dompdf?hl=en.

BrianS

unread,
Apr 14, 2010, 1:50:23 PM4/14/10
to dompdf
I haven't tested with Arial, but Verdana displays these characters
fine so long as DOMPDF_UNICODE_ENABLED is set to true. There's a
chance that the web-based font prep tool isn't getting all the
characters out of the font. As I said, there are some issues that
haven't yet been addressed which could be affecting your rendering. If
you can send me your font I'll run some additional tests using it.


On Apr 12, 10:29 am, Đani Stojanov <dani.stoja...@gmail.com> wrote:
> I'm using utf-8 and certain specific characters are displayed correctly
> (ŠŽšž) and all the central european ones as well (german, danish etc...)
> but čćđČĆĐ are hopeless.
> I'm using standard windows Arial actually and i know for sure the characters
> are there, but they just display '?'
> I am using the latest dompdf and font is installed correctly of course.
>

> > dompdf+un...@googlegroups.com<dompdf%2Bunsu...@googlegroups.com>

Pavel Tyl

unread,
Apr 14, 2010, 1:59:04 PM4/14/10
to dom...@googlegroups.com
Hello!
Could you send these fonts or post them somewhere?
I am beggining to believe only tested fonts and not my own... čřďťň were
never correct in my PDF.
Regards
Pavel Tyl

BrianS napsal(a):

BrianS

unread,
Jul 25, 2012, 2:26:22 PM7/25/12
to dom...@googlegroups.com
Which version of dompdf? The web-based tool hasn't been updated for the latest 0.6.0 release, but you don't need it for that version anymore because we're bundling php-font-lib to handle creation of font metrics. You do have to enable Unicode support in dompdf for it to work, however.

At any rate, this sounds like a familiar problem, but I can't place the cause right now. Can you start a new thread and post a sample HTML and the output produced by dompdf?


On Wednesday, July 25, 2012 1:34:57 PM UTC-4, guesst wrote:
hello i tried to convert the Vollkorn (friedrichalthausen.de) Regular font to an afm file, but the words are all spread in the document, could you help me please? what do you think is the problem?

guesst

unread,
Jul 25, 2012, 2:47:02 PM7/25/12
to dom...@googlegroups.com
Ok i'll start a thread, thanks.

guesst

unread,
Aug 9, 2012, 11:03:00 AM8/9/12
to dom...@googlegroups.com
Im sorry to post here again but after testing i fixed my problem, first the Volkorn font family was incompatible in afm format so i transormed all the other fonts here (http://www.fontconverter.org/) and they worked great, after this i just modified the old load_font.php in the line define("_TTF2AFM", TTF2AFM . " -i"); loaded the changes, copy the afm in the font folder and goes excelent in debian squeeze, hope this help someone, bye.


El miércoles, 24 de febrero de 2010 11:51:42 UTC-6, BrianS escribió:

Sean Kelly

unread,
Sep 28, 2012, 10:57:04 AM9/28/12
to dom...@googlegroups.com
I had great success installing a font via this tool for my last project but now I'm having trouble with a different font.

I'm using dompdf 0.6 Beta 3 and when I upload my font to the tool it tells me that it's "not a valid font file".

This font installs fine in Windows and works fine with TypeKit.com for the html portion of the site. The font is a proprietary font trademarked by the client but I don't expect that has anything to do with the problem.

I have attempted to compare the non-working TTF file with the last project's working TTF file but they both open fine in any font editors I've tried. There doesn't seem to be anything different about this font at all, yet Dompdf insists that it's not a valid font file.

Any suggestions would be most welcome.

Thanks,
Sean

Sean Kelly

unread,
Sep 28, 2012, 11:06:57 AM9/28/12
to dom...@googlegroups.com
I re-read the original post here and realized that you weren't talking about the built-in font uploading tool at all.  

I used the form provided and now my font is happily showing in the list. Thanks DomPDF. Looking forward to watching this project mature even further! 

Time to send a donation, I think!

Sean

BrianS

unread,
Sep 30, 2012, 9:29:09 PM9/30/12
to dom...@googlegroups.com
Glad to hear. It is true that as of v0.6.0 beta 3 it is easier to use the included PHP-based font parsing library (php-font-lib). We'll be updating the relevant documentation in the future. The web-based tool will still be available for a while, but I don't know that I'll be updating it again.

Farias Maiquita

unread,
Aug 27, 2015, 9:30:46 AM8/27/15
to dompdf
"Sorry ... working out some kinks."

Hey Brian, is the tool going to be unavailable for long, I'm having problems installing a font and your tool might just be the answer.

Perhaps keep the old version available on some "older/load_font.php" link.

Thanks in advance...
Reply all
Reply to author
Forward
0 new messages