[cl-typesetting-devel] Unicode?
Peter Seibel
peter at gigamonkeys.com
Fri Sep 7 00:22:12 UTC 2007
So looking at the .ufm file for LMRoman12-Regular, it seemed that there
was no metric for #x2014 (a.k.a. 8212). So I used fontforge and ttf2pt1
to generate a .ttf and .ufm pair from one of the .dfont files on my mac.
That font had a metric for 8212 but when I use it instead of
LMRoman12-Regular I get boxes for all the characters. I do get a box for
the emdash character, so that's progress in some sense. What am I doing
wrong?
-Peter
Peter Seibel wrote:
> I've got this simple test program which, as you can see, attempts to use
> one of the LatinModern unicode fonts and tries to render some text that
> contains a unicode emdash (code-point #x2014).
>
> (defpackage :foo (:use :cl :cl-pdf))
>
> (in-package :foo)
>
> (defun test-unicode (&optional (file #P"foo.pdf"))
> (pdf:with-document ()
> (pdf:with-page ()
> (pdf:with-outline-level ("Example" (pdf:register-page-reference))
> (let ((font (pdf:get-font "LMRoman12-Regular")))
> (pdf:in-text-mode
> (pdf:set-font font 14.0)
> (pdf:move-text 100 800)
> (pdf:draw-text
> (format nil "This ~c is a test." (code-char #x2014)))))))
> (pdf:write-document file)
> file))
>
>
> When I run this function in generates a file without error but the
> emdash is nowhere to be seen. Is this a problem with the font (which was
> loaded from an .afm file not a .ufm) or with cl-pdf or with something
> I'm doing wrong?
>
> -Peter
>
--
Peter Seibel : peter at gigamonkeys.com
A Billion Monkeys Can't be Wrong : http://www.gigamonkeys.com/blog/
Practical Common Lisp : http://www.gigamonkeys.com/book/
Coders at Work : http://www.codersatwork.com/
More information about the cl-typesetting-devel
mailing list