From ch-lisp at bobobeach.com Sun Dec 2 17:47:29 2007 From: ch-lisp at bobobeach.com (Cyrus Harmon) Date: Sun, 2 Dec 2007 09:47:29 -0800 Subject: [cl-pdf-devel] alpha png support? Message-ID: before I go digging any deeper, I figured I'd check in with the list. Has anyone looked at adding 4 channel RGBA png image support to cl- pdf? Right now we handle cases 1,2 and 3, but not 4 (greyscale alpha) or 6 (rgb alpha). Any ideas on what it would take to do this? Thanks, Cyrus From archimag at gmail.com Sat Dec 29 12:48:35 2007 From: archimag at gmail.com (Andrey Moskvitin) Date: Sat, 29 Dec 2007 12:48:35 +0000 Subject: [cl-pdf-devel] Unicode issue Message-ID: >>* The example uses a unicode font and simply puts a string into the *>>* output document which contains #\Space #\( #\) and a few other *>>* characters. Both parenthesis and space are needed to produce the wrong *>>* pdf.* > Unfortunately, the unicode integration is still in an alpha state as > I've never found the time to continue it :( > I will look at your example to see if I can make a fix for it. I encountered the same problem with unbalanced parentheses in text. Sample code (Gentoo Linux, sbcl-1.0.12): (pdf:load-ttu-font #P"/usr/local/fonts/arial.ufm" #P"/usr/local/fonts/arial.ttf") (with-open-file (out #P"/tmp/bad.pdf" :direction :output :if-exists :supersede :element-type :default :external-format :latin-1) (pdf:with-document () (pdf:with-page () (pdf:in-text-mode (pdf:move-text 20 20) (pdf:set-font (pdf:get-font "ArialMT") 12) (pdf::show-text "hello ("))) (pdf:write-document out))) The problem in the function of write-cid-string. I change it and solved the problem: --- /usr/share/common-lisp/source/cl-pdf/pdf-base.lisp 2007-10-10 12:50:45.000000000 +0000 +++ pdf-base.lisp 2007-12-29 16:38:18.000000000 +0000 @@ -25,11 +25,14 @@ (write-char #\( *page-stream*) (if (and *font* (typep (font-metrics *font*) 'ttu-font-metrics)) (loop for c across string do - (let* ((code (char-code c)) - (hi (ldb (byte 8 8) code)) - (lo (ldb (byte 8 0) code))) - (write-char (code-char hi) *page-stream*) - (write-char (code-char lo) *page-stream*))) + (let* ((code (char-code c)) + (hi (ldb (byte 8 8) code)) + (lo (ldb (byte 8 0) code)) + (is-bracket (or (eql c #\() (eql c #\))))) + (if is-bracket (write-char #\\ *page-stream*)) + (write-char (code-char hi) *page-stream*) + (if is-bracket (write-char #\\ *page-stream*)) + (write-char (code-char lo) *page-stream*))) (princ string *page-stream*)) (write-string ") " *page-stream*)) Andrey -------------- next part -------------- An HTML attachment was scrubbed... URL: