Lisp HUG Maillist Archive

Problems with cl-typesetting

Hi
 
Sorry my bothering you. I am heavy puzzled by using russian fonts in cl-typesetting.
I've just typed russian letters to one of strings in test.lisp's HELLO function, but GET-CHAR-SIZE function in cl-pdf's font.lisp called from MAKE-CHAR-BOX function in typo.lisp says that it cannot violate array bounds (character code is > 255):
 
;; (let* ((char (aref (characters font) (force-char-code char-or-code)))
So I write function that convert unicode string to cp-1251 code page and wrap string in it. So hello.pdf generated fine, but russian text was invisible. I tried to use all encodings from encodings.lisp in cl-pdf with no effect. I converted Arial.ttf to Arial.afm by ttf2afm.exe utility from Cygnus. The hello.pdf generated silently but Acrobat Reader said that Arial had bad \bbox or so. I've already spent many hours trying to solve this puzzle, looks like I need good advice from somebody more experienced (lucky).
 
Thanks in advance
Lisper

Re: Problems with cl-typesetting

lisptracker wrote:

>Sorry my bothering you. I am heavy puzzled by using russian fonts in
>cl-typesetting.

These questions should be sent to the cl-typesetting or cl-pdf mailing lists
rather than to lisp-hug. (I've put this email in copy to the cl-typesetting
list)
The mailing lists are here:
http://common-lisp.net/mailman/listinfo/cl-pdf-devel
http://common-lisp.net/mailman/listinfo/cl-pdf-devel

>I've just typed russian letters to one of strings in test.lisp's HELLO
>function, but GET-CHAR-SIZE function in cl-pdf's font.lisp called from
>MAKE-CHAR-BOX function in typo.lisp says that it cannot violate array
bounds
>(character code is > 255):

>; (let* ((char (aref (characters font) (force-char-code char-or-code)))

>So I write function that convert unicode string to cp-1251 code page and
>wrap string in it. So hello.pdf generated fine, but russian text was
>invisible. I tried to use all encodings from encodings.lisp in cl-pdf with
>no effect. I converted Arial.ttf to Arial.afm by ttf2afm.exe utility from
>Cygnus. The hello.pdf generated silently but Acrobat Reader said that Arial
>had bad \bbox or so. I've already spent many hours trying to solve this
>puzzle, looks like I need good advice from somebody more experienced
>(lucky).

To use cl-typesetting with Russian fonts, you should have a look at Dmitri
Ivanov's page here:
http://lisp.ystok.ru/cl-pdf.html
The cl-typesetting example with a paragraph in  Arial Cyrillic font is here:
http://lisp.ystok.ru/code/ex-1251.pdf

I plan to integrate Dmitri's modifications but some portability issues need
to be addressed (Dmitri's code is for LW only so far).
Unicode support should be added too.

Marc



Updated at: 2020-12-10 08:53 UTC