[cl-pdf-devel] Unicode font metrics rewrite

Marc Battyani marc.battyani at fractalconcept.com
Wed Nov 2 00:03:30 UTC 2005


I've commited the latest version of cl-pdf to the cl-pdf repository.

I've made a modified version of tt2pt1 which merges the unicode encoding
with the char metrics in a .ufm file.
The parsing of the ufm files is changed to be able to use those new .ufm
files

To use Unicode fonts you need to have the font metrics and the character
encoding of the font. For this you must have an unicode font metrics (.ufm
file).

You can generate it with a special version of afm2pt1:
http://www.fractalconcept.com/fcweb/download/ttf2pt1-src.zip

I've put a windows executable here:
http://www.fractalconcept.com/fcweb/download/ttf2pt1.zip

You can get the original version here:
http://ttf2pt1.sourceforge.net/

Use it like this (using the times font as an example):
ttf2pt1 -a -F times.ttf times
This will generate the needed times.ufm file.

You can then load the font:
(pdf:load-ttu-font #P"times.ufm" #P"times.ttf")

And now you can use it:
PDF 222 > (pdf:get-font "TimesNewRomanPSMT")
#<pdf:font timesnewromanpsmt 25558C54>

To see the exact name of the font, just look inside the .ufm file.

If you only need some characters of a font, you can use fontforge to tweak
it.

The full repository is here:
http://www.fractalconcept.com:8000/public/open-source/
(It's a subversion 1.0 repository.)

The cl-pdf part:
http://www.fractalconcept.com:8000/public/open-source/cl-pdf/

The cl-typesetting part:
http://www.fractalconcept.com:8000/public/open-source/cl-typesetting/

The mod_lisp part:
http://www.fractalconcept.com:8000/public/open-source/mod_lisp/

There are also tarballs for cl-pdf and cl-typesetting:

http://www.fractalconcept.com/download/cl-pdf-current.tgz
http://www.fractalconcept.com/download/cl-typesetting-current.tgz

BTW the (somewhat outdated) home pages for these projects are here:
http://www.fractalconcept.com/asp/html/cl-pdf.html
http://www.fractalconcept.com/asp/html/cl-typesetting.html
http://www.fractalconcept.com/asp/html/mod_lisp.html

Marc




More information about the cl-pdf-devel mailing list