[cl-typesetting-devel] Re: [cl-pdf-devel] Character encoding?

Peter Seibel peter at gigamonkeys.com
Mon Feb 25 23:11:52 UTC 2008


Marc Battyani wrote:
> Attila Lendvai wrote:
>>>  But my basic point is that cl-typesetting and/or cl-pdf should know what
>>>  encoding the Lisp is using (i.e. how should one interpret the values
>>>  returned by CHAR-CODE) and should know how to map those to the numeric
>>>     
>> the proper fix would be to refactor cl-pdf to write into binary
>> streams and do the character encoding itself (i'd use babel, but Marc
>> would prefer no external dependency). i've done that once (the branch
>> is still laying around on my harddrive), but after a day of work i
>> gave up. it produced a pdf that almost worked (the toc could display
>> unicode text) but i made a mistake somewhere in the process and it
>> produced corrupt files. as i don't know a bit about the pdf file
>> format, i gave up instead of debugging it.
>>   
> I think Peter is right here. It's a cl-typesetting issue and not a
> cl-pdf one because he wants to substitute another character that will
> result in the same glyph in the current selected font. So it's not an
> encoding problem and in fact other substitutions, such as ligatures for
> instance, would be useful.

So my two questions then are:

  1. Is there some machinery in cl-typesetting that can/should be 
adapted to do this.

  2. If not, is something like the patch I sent, about the right place 
to do it.

-Peter

P.S. Regarding ligatures it's a bit hairier because--as I'm sure you 
know--you want to map multiple characters in the string to one character 
in the output. You could imagine PUT-STRING and VERBATIM doing a bit of 
buffering between calls in order to detect sequences of characters that 
should be turned into a ligature in the output. Or you could semi-punt 
and say you're only going to render sequences of characters passed 
together in one call to those functions with ligatures.

-- 
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