[cl-typesetting-devel] Unicode support feedback needed
Marc Battyani
marc.battyani at fractalconcept.com
Wed Nov 9 12:52:26 UTC 2005
"Dmitriy Ivanov" <divanov at aha.ru> wrote:
> "Marc Battyani" <marc.battyani at fractalconcept.com> wrote:
>
> |> AFAIR, we should also open *page-stream* in binary mode - this needs
> |> further
> |> elaboration. I am trying to figure out at the moment.
> |
> | Why would you want to do that ? The content streams are in ASCII
> | normally. Excepted for the characters in strings but they can be
> | encoded if needed. The Unicode ones are already encoded.
>
> I see. No need to touch *page-stream*.
> 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.
Marc
More information about the cl-typesetting-devel
mailing list