[cl-typesetting-devel] Unicode?

Peter Seibel peter at gigamonkeys.com
Sat Sep 8 15:16:22 UTC 2007


Marc Battyani wrote:
> 
> Peter Seibel wrote:
> 
> [...]
>> Anyway, after some more investigation, I think the problem goes much
>> deeper than just a font metric issue. I looked at the PDF file
>> generated when I made the text was (format nil "A~cB" (code-char
>> #x2014). In the PDF there's a:
>>
>>   (A?B) Tj
>>
>> where the ? is actually the character #x14, i.e. the bottom byte of
>> the #x2014 character. It conceivable that through some proper
>> manipulation of external-formats somewhere I could fix that but it
>> wouldn't help because, as far as I understand the PDF spec, (...)
>> strings can only contain ASCII characters. There is obviously some way
>> to include Unicode text (uncoded in UTF-16BE, I believe) in PDFs but
>> it's much more involved than just throwing some text between ()'s. I
>> think the relevant sections of the PDF spec may be 5.6 Composite Fonts
>> and following.
> I'm just catching up. So do you still have the problem? If that's the
> case, I will have a look at it this WE.

Yes, as far as I can tell some moderately significant surgery needs to 
be done to really support arbitrary Unicode characters. For another test 
case, you can use:

   (pdf:draw-text (format nil "~c~c" (code-char #x6e05) (code-char #x6167)))

Which are the two Chinese characters you can see on this web page:

   <http://www.gigamonkeys.com/amelia/>

-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