[cl-pdf-devel] Greek letters?

Marc Battyani marc.battyani at fractalconcept.com
Tue Nov 30 18:54:16 UTC 2004


"Björn Lindberg" <d95-bli at nada.kth.se> wrote:
"Marc Battyani" <marc.battyani at fractalconcept.com> writes:

>> "Björn Lindberg" <d95-bli at nada.kth.se> wrote:
>>
>>
>> >Is it possible to somehow incorporate greek letters in the PDFs
>> >created by cl-pdf? More specifically, I need to use a few mathematical
>> >symbols in the legend of a histogram, such as \theta, \kappa &
>> >\omega. I'm using CMUCL, so I only have latin1 in my lisp.
>>
>> Yes, just use the "Symbol" font and look at the *symbol-encoding* in
>> encodings.lisp. (code-char 97) should give you "alpha". If you need more
>> math symbols, just use a TeX math font for instance.
>
>Something is wrong, and I cannot figure out what. The simple test case
>below prints the expected when the font is "Helvetica", but when the
>font is "Symbol", the page is blank:

>  (pdf:with-document ()
>    (pdf:with-page ()
>      (let ((font (pdf:get-font "Symbol")))
>        (pdf:in-text-mode
>          (pdf:set-font font 36.0)
>          (pdf:move-text 100 800)
>          (pdf:draw-text "abcdefghABCDEFGH"))))
>    (pdf:write-document "foo.pdf"))
>
>When I look in *font-cache* and *font-metrics*, at least to my
>untrained eyes it looks like the font is loaded OK.

This example works for me. Look at the attached foo.pdf

Marc
-------------- next part --------------
A non-text attachment was scrubbed...
Name: foo.pdf
Type: application/pdf
Size: 884 bytes
Desc: not available
URL: <https://mailman.common-lisp.net/pipermail/cl-pdf-devel/attachments/20041130/a8d89bf5/attachment.pdf>


More information about the cl-pdf-devel mailing list