[cl-pdf-devel] Unicode/ISO-8859-2
Levente Mészáros
levente.meszaros at mailbox.hu
Sat Sep 24 21:30:26 UTC 2005
Hello,
I'm new to this list and to both cl-pdf and cl-typesetting, and unforunately I could really use some help. Until now I was using docbook and XSLT processors for generating documents, but I found out that it is a bad solution (and well I was really kind saying this), so I decided to use lisp. I'm hungarian guy and I would like to generate documents in my national language. I tried really hard, but I could not manage to generate a pdf file with unicode (or iso-8859-2) characters in it, although all tests shipped with the packages worked very well.
I have attached a unicode xml file which I was trying to use as an example and a small program which I was hacking with. I'm using the newest clisp under cygwin and windows XP.
I have patched deflate-stream-interface.lisp not to use ASCII encoding, but utf-8. Perhaps I was wrong on this:
77c77
< (ext:convert-string-to-bytes string charset:ascii :start start :end end)
---
> (ext:convert-string-to-bytes string charset:utf-8 :start start :end end)
Unfortunately I get error messages like:
*** - AREF: index 337 for #(#<PDF:CHAR-METRICS VoidChar> #<PDF:CHAR-METRICS SOH> #<PDF:CHAR-METRICS STX> #<PDF:C...................
stack:
<1> #<SYSTEM-FUNCTION SHOW-STACK>
<2> #<COMPILED-CLOSURE SYSTEM::DEBUG-BACKTRACE>
<3> #<SYSTEM-FUNCTION SYSTEM::READ-EVAL-PRINT>
<4> #<COMPILED-CLOSURE SYSTEM::BREAK-LOOP-2-1>
<5> #<SYSTEM-FUNCTION SYSTEM::SAME-ENV-AS>
<6> #<COMPILED-CLOSURE SYSTEM::BREAK-LOOP-2>
<7> #<SYSTEM-FUNCTION SYSTEM::DRIVER>
<8> #<COMPILED-CLOSURE SYSTEM::BREAK-LOOP>
<9> #<SYSTEM-FUNCTION INVOKE-DEBUGGER>
<10> #<SYSTEM-FUNCTION AREF> 1
<11> #<COMPILED-CLOSURE PDF:GET-CHAR-WIDTH>
<12> #<COMPILED-CLOSURE TYPESET::MAKE-CHAR-BOX>
<13> #<COMPILED-CLOSURE TYPESET:PUT-STRING>
and while loading some fonts I get:
(AND (= (AREF PDF::DATA PDF::START) PDF::+PFB-MARKER+) (= (AREF PDF::DATA (1+ PDF::START)) PDF::MARKER)) must evaluate to a non-NIL value.
stack:
<1> #<SYSTEM-FUNCTION EXT:SHOW-STACK>
<2> #<COMPILED-CLOSURE SYSTEM::DEBUG-BACKTRACE>
<3> #<SYSTEM-FUNCTION SYSTEM::READ-EVAL-PRINT>
<4> #<COMPILED-CLOSURE SYSTEM::BREAK-LOOP-2-1>
<5> #<SYSTEM-FUNCTION SYSTEM::SAME-ENV-AS>
<6> #<COMPILED-CLOSURE SYSTEM::BREAK-LOOP-2>
<7> #<SYSTEM-FUNCTION SYSTEM::DRIVER>
<8> #<COMPILED-CLOSURE SYSTEM::BREAK-LOOP>
<9> #<SYSTEM-FUNCTION INVOKE-DEBUGGER>
<10> #<SYSTEM-FUNCTION ERROR> 1
<11> #<COMPILED-CLOSURE PDF::READ-PFB-SEG-SIZE>
<12> #<COMPILED-CLOSURE PDF::READ-PFB-FILE>
<13> #<COMPILED-CLOSURE PDF:LOAD-T1-FONT>
EVAL frame for form (SETQ *FONT* (PDF:LOAD-T1-FONT "~/MonospaceRoman.afm" "~/MonospaceRoman.pfa"))
<14> #<SPECIAL-OPERATOR SETQ>
EVAL frame for form (LOAD "~/document.lisp")
<15> #<SYSTEM-FUNCTION EVAL>
<16> #<COMPILED-CLOSURE LOAD>
and the worst is sometimes segfault...
Could somebody help me and show how could I generate a document with that text or with any central european or unicode (utf-8) text?
And is there any documentation of cl-pdf and cl-typesetting? I mean other than the source code?
I also had problems running kw-extensions.lisp examples. They produce empty documents, but I would really need something like that. It looks much closer to what docbook offers and still I get all the flexibility of the framework and lisp.
Thank you for reading this letter... ;-)
Regards,
levy
-------------- next part --------------
A non-text attachment was scrubbed...
Name: document.xml.utf
Type: application/octet-stream
Size: 135 bytes
Desc: not available
URL: <https://mailman.common-lisp.net/pipermail/cl-pdf-devel/attachments/20050924/674cab28/attachment.obj>
-------------- next part --------------
A non-text attachment was scrubbed...
Name: document.lisp
Type: application/octet-stream
Size: 3127 bytes
Desc: not available
URL: <https://mailman.common-lisp.net/pipermail/cl-pdf-devel/attachments/20050924/674cab28/attachment-0001.obj>
More information about the cl-pdf-devel
mailing list