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

Peter Seibel peter at gigamonkeys.com
Tue Sep 11 19:52:42 UTC 2007


Marc Battyani wrote:
> 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>

Okay, so I figured out how to compile your version of ttf2pt1 (I just 
needed to chmod +x the unhtml script to get the make to complete) and 
now have things more or less working. One mystery still remaining is 
that when I generate PDFs using Cochin, the font I got from my Mac and 
converted from .dfont to .ttf using fontforge, it works except when I 
render the string "hello, world!" it comes out as "helloworld". Strange. 
But it works fine using Gentium with .ufm files produced with your 
ttf2pt1. So I'm going to assume something went awry with fontforge.

Using Gentium I still have two problems. One is when I try to include 
the characters U+6e05 and U+6167 (Chinese characters) it succeeds in 
rendering but the characters are not displayed. Is that becauseGentium 
doesn't support those characters?

And finally, when I try to run unicode-hello using Gentium on the full 
*unicode-test-string* I get this error.

Index(s) to array function is/are out of the range of the array.
    [Condition of type TYPE-ERROR]

Restarts:
  0: [ABORT] Return to SLIME's top level.
  1: [ABORT] Abort entirely from this (lisp) process.

Backtrace:
   0: (SWANK:SWANK-DEBUGGER-HOOK #<TYPE-ERROR @ #x74a9b8f2>
        #<Function SWANK-DEBUGGER-HOOK>)
   1: (ERROR TYPE-ERROR :DATUM NIL :EXPECTED-TYPE FIXNUM :FORMAT-CONTROL
             "Index(s) to array function is/are out of the range of the 
array."
             :FORMAT-ARGUMENTS (NIL))
   2: ((METHOD PDF::GET-CHAR-METRICS (T T T)) #\?
       #<PDF:FONT gentium @ #x739c9942>
       #<PDF::UNICODE-ENCODING UnicodeEncoding @ #x71625512>)
   3: (PDF:GET-KERNING #\? #\? #<PDF:FONT gentium @ #x739c9942> 36)
   4: (PUT-STRING "??????????????????? ?????????????? A???????????????? 
B????????????????????? ?????????????????? ????????????? ???????????????? ")
   5: (UNICODE-HELLO "Gentium")

-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/
-------------- next part --------------
An embedded and charset-unspecified text was scrubbed...
Name: GenAI102.ufm.MINE
URL: <https://mailman.common-lisp.net/pipermail/cl-typesetting-devel/attachments/20070911/238172a1/attachment.ksh>


More information about the cl-typesetting-devel mailing list