[cl-pdf-devel] Re: [cl-typesetting-devel] Unicode?

Marc Battyani marc.battyani at fractalconcept.com
Mon Sep 10 22:15:50 UTC 2007


Peter Seibel wrote:
> Okay, I can't get unicode-hello to work on Allegro 8.1 on GNU/Linux
> with any Unicode fonts I have. Perhaps I'm generating bad .ufm files?
> (I tried to build your special ttf2ufm program Marc but couldn't
> figure out how so used another one I found on the web.) Maybe to
> remove at least one variable we can use the same font. I just tried
> with Gentium, a free Unicode font which you can get here:
>
> http://scripts.sil.org/cms/scripts/page.php?site_id=nrsi&item_id=Gentium_download
>
>
> Whenever I use Gentium in the place of TimesNewRomanPSMT I get this
> error, even when I set the *unicode-test-string* to something as
> simple as "abc".
OK I downloaded it and it works for me with LWW5. (Windows)
I will send you the pdf and the ufm off-list.

TYPESET 27 > (pdf:load-ttu-font #P"d:/tmp/gentium102/GenAI102.ufm"
#P"d:/tmp/gentium102/GenAI102.ttf")
#<pdf::ttu-font-metrics GentiumAlt Italic 22B3A343>

TYPESET 28 > (defparameter *unicode-test-string* (map
unicode-string-type 'code-char
     '(382 65 124 250 251 252 253)))
*unicode-test-string*

TYPESET 29 >
(defun unicode-hello (&optional (file #P"d:/tmp/hello-u.pdf"))
  (pdf:with-document ()
    (pdf:with-page ()
      (pdf:with-outline-level ("Unicode Example"
(pdf:register-page-reference))
    (pdf:set-line-width 0.1)
    (let ((content
           (compile-text ()
                 (vspace 100)
         (paragraph (:h-align :center :font "Helvetica-Bold" :font-size
50 :color '(0.0 0 0.8))
                "cl-typesetting" :eol
                (vspace 2)
                (hrule :dy 1)
                (with-style (:font "Times-Italic" :font-size 26)
                  "The cool Common Lisp typesetting system")
                (vspace 50)
                (with-style (:font "GentiumAlt-Italic" :font-size 72)
                  (put-string *unicode-test-string*))))))
      (draw-block content 20 800 545 700))))
    (pdf:write-document file)))
unicode-hello

TYPESET 30 > (unicode-hello)
nil

Marc




More information about the cl-pdf-devel mailing list