[cl-typesetting-devel] Unicode support feedback needed

Dmitriy Ivanov divanov at aha.ru
Wed Nov 9 14:28:53 UTC 2005


"Marc Battyani" <marc.battyani at fractalconcept.com> wrote:

|> To open the document stream in binary mode, the following works for
|> me.
|>
|> (in-package pdf)
|>
|> (defmethod write-document ((filename pathname) &optional (document
|> *document*))
|>    (with-open-file (stream filename
|>                            :direction :output :if-exists :supersede
|>                          :element-type #+pdf-binary '(unsigned-byte 8)
|>                                          #-pdf-binary 'base-char
|>                            :external-format +external-format+)
|>      (write-document stream document)))
|>
|> ;;; Works with CID fonts, not for code-page encoded.
|> (defmethod write-stream-content ((content string))
|>    (loop for char across content
|>            do (write-byte (char-code char) pdf::*pdf-stream*)))
|
| Are you sure it's enough ? I mean there are lots of #'format,
| #'write-line, etc. in the #'write-object methods.

As a matter of fact, that is enough for LW provided all lw:text-string's are
already "packed" into streams, which are about to be output in byte-by-byte
manner. Base characters are written automatically as *pdf-stream* is
bivalent.

For other implementation, that can be problematic...
--
Sincerely,
Dmitriy Ivanov
lisp.ystok.ru




More information about the cl-typesetting-devel mailing list