From marc.battyani at fractalconcept.com Tue Nov 1 12:49:52 2005 From: marc.battyani at fractalconcept.com (Marc Battyani) Date: Tue, 1 Nov 2005 13:49:52 +0100 Subject: [cl-pdf-devel] Ful Unicode support References: <074c01c503f3$13b432c0$0a02a8c0@marcxp><08b301c5198a$52a9fb20$0a02a8c0@marcxp> <010401c5dd86$555ecec0$0a02a8c0@marcxp> Message-ID: <05a801c5dee2$c081e2c0$0a02a8c0@marcxp> I've commited the latest version of cl-pdf to the cl-pdf repository. Now there is a full Unicode support (16 bits) with char box metrics, kerning, encoding, etc. The full repository is here: http://www.fractalconcept.com:8000/public/open-source/ (It's a subversion 1.0 repository.) The cl-pdf part: http://www.fractalconcept.com:8000/public/open-source/cl-pdf/ The cl-typesetting part: http://www.fractalconcept.com:8000/public/open-source/cl-typesetting/ The mod_lisp part: http://www.fractalconcept.com:8000/public/open-source/mod_lisp/ There are also tarballs for cl-pdf and cl-typesetting: http://www.fractalconcept.com/download/cl-pdf-current.tgz http://www.fractalconcept.com/download/cl-typesetting-current.tgz BTW the (somewhat outdated) home pages for these projects are here: http://www.fractalconcept.com/asp/html/cl-pdf.html http://www.fractalconcept.com/asp/html/cl-typesetting.html http://www.fractalconcept.com/asp/html/mod_lisp.html Marc From marc.battyani at fractalconcept.com Tue Nov 1 13:48:20 2005 From: marc.battyani at fractalconcept.com (Marc Battyani) Date: Tue, 1 Nov 2005 14:48:20 +0100 Subject: [cl-pdf-devel] Added unicode-readme.txt and an example References: <074c01c503f3$13b432c0$0a02a8c0@marcxp><08b301c5198a$52a9fb20$0a02a8c0@marcxp><010401c5dd86$555ecec0$0a02a8c0@marcxp> <05a801c5dee2$c081e2c0$0a02a8c0@marcxp> Message-ID: <066601c5deea$eb9bb190$0a02a8c0@marcxp> Added unicode-readme.txt to explain the use of unicode fonts and an example done with cl-typesetting: http://www.fractalconcept.com/fcweb/download/hello-u.pdf Marc From a_bakic at yahoo.com Tue Nov 1 20:37:31 2005 From: a_bakic at yahoo.com (Aleksandar Bakic) Date: Tue, 1 Nov 2005 12:37:31 -0800 (PST) Subject: [cl-pdf-devel] Added unicode-readme.txt and an example In-Reply-To: <066601c5deea$eb9bb190$0a02a8c0@marcxp> Message-ID: <20051101203731.66296.qmail@web34611.mail.mud.yahoo.com> Hi, I check out your new code, applied my sb-unicode/use-uffi-zlib related patches, and everything seems to work. I think the following needs some resolution, too: 1. I am not sure whether the generated PDF is correct if a TTF file argument is not provided to load-ttu-font. First, I don't think a file reference is generated in that case, and second, PDF Reference 1.6 mentions some cases when a font must be embedded (after around page 400; in particular, 416). 2. I didn't know the official ttf2pt1 could be used; it seemed to me that ttf2ufm was an extension of it (at least, that's what I read...). I used my previously generated fonts and did not try ttf2pt1. Alex __________________________________ Yahoo! Mail - PC Magazine Editors' Choice 2005 http://mail.yahoo.com From marc.battyani at fractalconcept.com Tue Nov 1 21:46:08 2005 From: marc.battyani at fractalconcept.com (Marc Battyani) Date: Tue, 1 Nov 2005 22:46:08 +0100 Subject: [cl-pdf-devel] Added unicode-readme.txt and an example References: <20051101203731.66296.qmail@web34611.mail.mud.yahoo.com> Message-ID: <00d201c5df2d$ab665560$0a02a8c0@marcxp> Aleksandar Bakic wrote: >I check out your new code, applied my sb-unicode/use-uffi-zlib related >patches, >and everything seems to work. Good >I think the following needs some resolution, too: > >1. I am not sure whether the generated PDF is correct if a TTF file argument >is >not provided to load-ttu-font. First, I don't think a file reference is >generated in that case, and second, PDF Reference 1.6 mentions some cases >when >a font must be embedded (after around page 400; in particular, 416). Embedding the font is a goodidea otherwise a Windows pdf can't be read on a Mac or Linux for example. >2. I didn't know the official ttf2pt1 could be used; it seemed to me that >ttf2ufm was an extension of it (at least, that's what I read...). I used my >previously generated fonts and did not try ttf2pt1. I just checked and it don't work. I will modify it to generate the encoding and the metrics in one file Using 2 files is not clean. Marc From marc.battyani at fractalconcept.com Wed Nov 2 00:03:30 2005 From: marc.battyani at fractalconcept.com (Marc Battyani) Date: Wed, 2 Nov 2005 01:03:30 +0100 Subject: [cl-pdf-devel] Unicode font metrics rewrite References: <074c01c503f3$13b432c0$0a02a8c0@marcxp><08b301c5198a$52a9fb20$0a02a8c0@marcxp><010401c5dd86$555ecec0$0a02a8c0@marcxp><05a801c5dee2$c081e2c0$0a02a8c0@marcxp> <066601c5deea$eb9bb190$0a02a8c0@marcxp> Message-ID: <015e01c5df40$dbf4c640$0a02a8c0@marcxp> I've commited the latest version of cl-pdf to the cl-pdf repository. I've made a modified version of tt2pt1 which merges the unicode encoding with the char metrics in a .ufm file. The parsing of the ufm files is changed to be able to use those new .ufm files To use Unicode fonts you need to have the font metrics and the character encoding of the font. For this you must have an unicode font metrics (.ufm file). You can generate it with a special version of afm2pt1: http://www.fractalconcept.com/fcweb/download/ttf2pt1-src.zip I've put a windows executable here: http://www.fractalconcept.com/fcweb/download/ttf2pt1.zip You can get the original version here: http://ttf2pt1.sourceforge.net/ Use it like this (using the times font as an example): ttf2pt1 -a -F times.ttf times This will generate the needed times.ufm file. You can then load the font: (pdf:load-ttu-font #P"times.ufm" #P"times.ttf") And now you can use it: PDF 222 > (pdf:get-font "TimesNewRomanPSMT") # To see the exact name of the font, just look inside the .ufm file. If you only need some characters of a font, you can use fontforge to tweak it. The full repository is here: http://www.fractalconcept.com:8000/public/open-source/ (It's a subversion 1.0 repository.) The cl-pdf part: http://www.fractalconcept.com:8000/public/open-source/cl-pdf/ The cl-typesetting part: http://www.fractalconcept.com:8000/public/open-source/cl-typesetting/ The mod_lisp part: http://www.fractalconcept.com:8000/public/open-source/mod_lisp/ There are also tarballs for cl-pdf and cl-typesetting: http://www.fractalconcept.com/download/cl-pdf-current.tgz http://www.fractalconcept.com/download/cl-typesetting-current.tgz BTW the (somewhat outdated) home pages for these projects are here: http://www.fractalconcept.com/asp/html/cl-pdf.html http://www.fractalconcept.com/asp/html/cl-typesetting.html http://www.fractalconcept.com/asp/html/mod_lisp.html Marc From marc.battyani at fractalconcept.com Wed Nov 2 09:46:15 2005 From: marc.battyani at fractalconcept.com (Marc Battyani) Date: Wed, 2 Nov 2005 10:46:15 +0100 Subject: [cl-pdf-devel] Unicode font metrics rewrite References: <074c01c503f3$13b432c0$0a02a8c0@marcxp><08b301c5198a$52a9fb20$0a02a8c0@marcxp><010401c5dd86$555ecec0$0a02a8c0@marcxp><05a801c5dee2$c081e2c0$0a02a8c0@marcxp><066601c5deea$eb9bb190$0a02a8c0@marcxp> <015e01c5df40$dbf4c640$0a02a8c0@marcxp> Message-ID: <028c01c5df92$443db080$0a02a8c0@marcxp> I wrote: > You can generate it with a special version of afm2pt1: > http://www.fractalconcept.com/fcweb/download/ttf2pt1-src.zip Sorry, bad URL, the correct one is: http://www.fractalconcept.com/fcweb/download/ttf2pt1-src-cl-pdf.zip Marc From marc.battyani at fractalconcept.com Thu Nov 3 08:39:39 2005 From: marc.battyani at fractalconcept.com (Marc Battyani) Date: Thu, 3 Nov 2005 09:39:39 +0100 Subject: [cl-pdf-devel] Unicode support feedback needed References: <074c01c503f3$13b432c0$0a02a8c0@marcxp><08b301c5198a$52a9fb20$0a02a8c0@marcxp><010401c5dd86$555ecec0$0a02a8c0@marcxp><05a801c5dee2$c081e2c0$0a02a8c0@marcxp><066601c5deea$eb9bb190$0a02a8c0@marcxp><015e01c5df40$dbf4c640$0a02a8c0@marcxp> <028c01c5df92$443db080$0a02a8c0@marcxp> Message-ID: <066501c5e052$21bc8430$0a02a8c0@marcxp> I didn't get much feedback so far about the Unicode support in cl-pdf/cl-typesetting. Anybody has tested this on several implementations? Any patches for implementations other than LW? (Just look at the unicode-readme.txt for how to use Unicode in cl-pdf) Marc From marc.battyani at fractalconcept.com Thu Nov 3 09:52:37 2005 From: marc.battyani at fractalconcept.com (Marc Battyani) Date: Thu, 3 Nov 2005 10:52:37 +0100 Subject: [cl-pdf-devel] Re: [cl-typesetting-devel] Unicode support feedback needed References: <074c01c503f3$13b432c0$0a02a8c0@marcxp><08b301c5198a$52a9fb20$0a02a8c0@marcxp><010401c5dd86$555ecec0$0a02a8c0@marcxp><05a801c5dee2$c081e2c0$0a02a8c0@marcxp><066601c5deea$eb9bb190$0a02a8c0@marcxp><015e01c5df40$dbf4c640$0a02a8c0@marcxp> <028c01c5df92$443db080$0a02a8c0@marcxp> <066501c5e052$21bc8430$0a02a8c0@marcxp> Message-ID: <06ca01c5e05c$52babcf0$0a02a8c0@marcxp> Andras Simon wrote: > On Thu, 3 Nov 2005, Marc Battyani wrote: > > > I didn't get much feedback so far about the Unicode support in > > cl-pdf/cl-typesetting. > > > > Anybody has tested this on several implementations? > > Any patches for implementations other than LW? > > (Just look at the unicode-readme.txt for how to use Unicode in cl-pdf) > > I got stuck first with general unicode problems (they've got nothing to do > with cl-typesetting, but mostly with my dumbness), and then with the missing > font problem. I'll try again in the weekend, using the instructions in > unicode-readme. Good. > ps. Should unicode-string-type return the most specific type for unicode > strings? If so, then I think it could return simple-string in sbcl and > simple-base-string in CLisp. It should return a string type which can accept 16 bits characters. So that (coerce (list (code-char 955)) 'string-type) is OK for instance. Marc From marc.battyani at fractalconcept.com Mon Nov 7 23:37:04 2005 From: marc.battyani at fractalconcept.com (Marc Battyani) Date: Tue, 8 Nov 2005 00:37:04 +0100 Subject: [cl-pdf-devel] Small fixes for Unicode. References: <091c01c4375f$dce93bb0$0a02a8c0@marcxp><04de01c495e9$e06f5dd0$0a02a8c0@marcxp> <059201c5dedd$efd0bba0$0a02a8c0@marcxp> Message-ID: <0d6801c5e3f4$289f48a0$0a02a8c0@marcxp> I've committed the latest small fixes. Marc From divanov at aha.ru Thu Nov 10 19:39:46 2005 From: divanov at aha.ru (Dmitriy Ivanov) Date: Thu, 10 Nov 2005 22:39:46 +0300 Subject: [cl-pdf-devel] Re: [cl-typesetting-devel] Unicode support feedback needed References: <074c01c503f3$13b432c0$0a02a8c0@marcxp><08b301c5198a$52a9fb20$0a02a8c0@marcxp><010401c5dd86$555ecec0$0a02a8c0@marcxp><05a801c5dee2$c081e2c0$0a02a8c0@marcxp><066601c5deea$eb9bb190$0a02a8c0@marcxp><015e01c5df40$dbf4c640$0a02a8c0@marcxp><028c01c5df92$443db080$0a02a8c0@marcxp> <066501c5e052$21bc8430$0a02a8c0@marcxp> <000701c5e3cf$f8ae6000$be01a8c0@digo> <0d6701c5e3f4$2466f620$0a02a8c0@marcxp> <000a01c5e452$f7b03a60$be01a8c0@digo> <000001c5e488$54278b10$0a02a8c0@marcxp> <000101c5e51d$b4f45190$be01a8c0@digo> <033601c5e52c$702aebf0$0a02a8c0@marcxp> Message-ID: <000d01c5e62e$85cb3b60$be01a8c0@digo> Hello folks, I am pleased to propose quite a big rewrite of CL-PDF. The purpose is two-fold: 1) Integrate Type0 (CID-keyed) and Type1 fonts based on custom-encoding. 2) Approach binary mode of output file. The attachment contains the two files: 1) di-encodings.lisp Slightly changed encoding class hierarchy. 2) di-contrib.lisp Patches for several source files. Please test. -- Sincerely, Dmitriy Ivanov lisp.ystok.ru -------------- next part -------------- A non-text attachment was scrubbed... Name: di-contrib.zip Type: application/x-zip-compressed Size: 8583 bytes Desc: not available URL: From marc.battyani at fractalconcept.com Thu Nov 10 23:38:18 2005 From: marc.battyani at fractalconcept.com (Marc Battyani) Date: Fri, 11 Nov 2005 00:38:18 +0100 Subject: [cl-pdf-devel] Re: [cl-typesetting-devel] Unicode support feedbackneeded References: <074c01c503f3$13b432c0$0a02a8c0@marcxp><08b301c5198a$52a9fb20$0a02a8c0@marcxp><010401c5dd86$555ecec0$0a02a8c0@marcxp><05a801c5dee2$c081e2c0$0a02a8c0@marcxp><066601c5deea$eb9bb190$0a02a8c0@marcxp><015e01c5df40$dbf4c640$0a02a8c0@marcxp><028c01c5df92$443db080$0a02a8c0@marcxp><066501c5e052$21bc8430$0a02a8c0@marcxp><000701c5e3cf$f8ae6000$be01a8c0@digo><0d6701c5e3f4$2466f620$0a02a8c0@marcxp><000a01c5e452$f7b03a60$be01a8c0@digo><000001c5e488$54278b10$0a02a8c0@marcxp><000101c5e51d$b4f45190$be01a8c0@digo><033601c5e52c$702aebf0$0a02a8c0@marcxp> <000d01c5e62e$85cb3b60$be01a8c0@digo> Message-ID: <0a1401c5e64f$d4525ea0$0a02a8c0@marcxp> Dmitriy Ivanov wrote: > > I am pleased to propose quite a big rewrite of CL-PDF. The purpose is two-fold: > > 1) Integrate Type0 (CID-keyed) and Type1 fonts based on custom-encoding. > 2) Approach binary mode of output file. > > The attachment contains the two files: > > 1) di-encodings.lisp > Slightly changed encoding class hierarchy. > > 2) di-contrib.lisp > Patches for several source files. Thanks Dmitriy, I will test this as soon I can find some time to do it. As for the binary mode of the pdf file, I'm starting to wonder if it's a good idea after all. In any case the pdf format is a mixed char/byte one and there are advantages and drawback to using each mode in Lisp. Marc From edi at agharta.de Mon Nov 14 20:08:19 2005 From: edi at agharta.de (Edi Weitz) Date: Mon, 14 Nov 2005 21:08:19 +0100 Subject: [cl-pdf-devel] Concatenating PDF files Message-ID: Hi! I need to concatenate a couple of PDF files, i.e. if I have PDF A with 10 pages, PDF B with 5 pages, and PDF C with 8 pages, then the resulting PDF should have 23 pages where page 1 is page 1 of PDF A, page 11 is page 1 of PDF B, and so on. The pages are supposed to remain unchanged /except/ for the page numbers which should be updated accordingly. I talked about this briefly with Arthur Lemmens and he said that the part with the page numbers will probably be hard and that there's no general solution for it. (I had na?vely assumed that the PDF format had some mechanism to abstract away page numbers like Word but now that I think of it this is most likely nonsense.) Nevertheless, at the moment I don't even know enough of CL-PDF to be able to concatenate the files without wading through the source code for a couple of hours. So, if someone could provide me with some lines of example code to get me started I'd be /very/ thankful. I know about this tool but I'd rather do it all in Lisp if possible. Thanks in advance, Edi. PS: Marc, Arthur is not in contributors.txt - I think he provided the parser, didn't he? From marc.battyani at fractalconcept.com Mon Nov 14 20:58:28 2005 From: marc.battyani at fractalconcept.com (Marc Battyani) Date: Mon, 14 Nov 2005 21:58:28 +0100 Subject: [cl-pdf-devel] Concatenating PDF files References: Message-ID: <01ff01c5e95e$2a354920$0a02a8c0@marcxp> Edi Weitz wrote: >I need to concatenate a couple of PDF files, i.e. if I have PDF A with >10 pages, PDF B with 5 pages, and PDF C with 8 pages, then the >resulting PDF should have 23 pages where page 1 is page 1 of PDF A, >page 11 is page 1 of PDF B, and so on. The pages are supposed to >remain unchanged /except/ for the page numbers which should be updated >accordingly. > >I talked about this briefly with Arthur Lemmens and he said that the >part with the page numbers will probably be hard and that there's no >general solution for it. (I had na?vely assumed that the PDF format >had some mechanism to abstract away page numbers like Word but now >that I think of it this is most likely nonsense.) > >Nevertheless, at the moment I don't even know enough of CL-PDF to be >able to concatenate the files without wading through the source code >for a couple of hours. So, if someone could provide me with some >lines of example code to get me started I'd be /very/ thankful. Indeed, a pdf file is just a bunch or recorded graphical commands. It has lost all structure except for some meta information. But it should work anyway! ;-) Tim Daly Jr has sent the code for the transformation of pdf pages into XObject, which can be printed on a page like any graphical element. (It's in the current cl-pdf version, look at pdf-template.lisp) So you just have to write the pages and then draw the new page numbers above the existing ones. If it's on a plain background it's easy. >I know about this tool > > > >but I'd rather do it all in Lisp if possible. Sure. >PS: Marc, Arthur is not in contributors.txt - I think he provided the > parser, didn't he? Oops, thanks for pointing this. I'm very sorry Arthur :-( I had a cl-yacc based parser but replaced it by Arthur's one which is nicer. (Arthur is credited in the lisp file though) This will show up in the next commit. I have to test and merge Dmitriy's code before. BTW if I've forgotten to mention other people, please tell it to me. Cheers, Marc From tim at tenkan.org Mon Nov 14 22:07:55 2005 From: tim at tenkan.org (Tim Daly Jr.) Date: Mon, 14 Nov 2005 23:07:55 +0100 Subject: [cl-pdf-devel] Concatenating PDF files In-Reply-To: References: Message-ID: <1132006075.16220.337.camel@beer.intern> On Mon, 2005-11-14 at 21:08 +0100, Edi Weitz wrote: ... > Nevertheless, at the moment I don't even know enough of CL-PDF to be > able to concatenate the files without wading through the source code > for a couple of hours. So, if someone could provide me with some > lines of example code to get me started I'd be /very/ thankful. Something like this would be a start, I think: (require :cl-pdf) (require :cl-pdf-parser) (in-package :pdf) (defun concat-pdfs (out-file &rest in-files) (with-document () (dolist (in-file in-files) (let* ((doc (read-pdf-file in-file)) (root (root-page doc))) (loop for page across (pages root) do (with-page () (let ((template (make-template-from-page page))) (add-templates-to-page template) (draw-template template)))))) (write-document out-file))) > but I'd rather do it all in Lisp if possible. Amen, brother Maynard! -- -Tim From marc.battyani at fractalconcept.com Mon Nov 14 22:12:56 2005 From: marc.battyani at fractalconcept.com (Marc Battyani) Date: Mon, 14 Nov 2005 23:12:56 +0100 Subject: [cl-pdf-devel] Concatenating PDF files References: <01ff01c5e95e$2a354920$0a02a8c0@marcxp> Message-ID: <026101c5e968$914adbc0$0a02a8c0@marcxp> Arthur Lemmens wrote: > Marc Battyani wrote: > > > Tim Daly Jr has sent the code for the transformation of pdf pages into > > XObject, which can be printed on a page like any graphical element. (It's in > > the current cl-pdf version, look at pdf-template.lisp) So you just have to > > write the pages and then draw the new page numbers above the existing ones. > > That's more or less what I told Edi (without the technical details ;-). > But doesn't this have the problem that you have to know the position > of the page numbers on the page? In other words, this is not a general > solution but would only work for documents where you figure out the page > number position by looking at the document (with your eyes, not with the > pdf parser), right? Yes. In the tool mentionned by Edi, you give the x,y, font, font size for the new number on the command line. The next thing to do would be to parse the content of the content-streams to modify them. But even simple text can be ouput in separated commands (one for each letter or letter group). And then there is the encoding etc. > >> PS: Marc, Arthur is not in contributors.txt - I think he provided the > >> parser, didn't he? > > > > Oops, thanks for pointing this. I'm very sorry Arthur :-( > > No problem Marc. I thought you gave me special treatment by mentioning > me in the file itself instead of in contributors.txt like everybody else ;-) No, when people send me some new functionality I credit them in the file -and- in the contributors file. When I don't forgot to do it that is... ;-) When it's some scattered code then only in the contributors file. Marc From alemmens at xs4all.nl Mon Nov 14 21:36:41 2005 From: alemmens at xs4all.nl (Arthur Lemmens) Date: Mon, 14 Nov 2005 22:36:41 +0100 Subject: [cl-pdf-devel] Concatenating PDF files In-Reply-To: <01ff01c5e95e$2a354920$0a02a8c0@marcxp> References: <01ff01c5e95e$2a354920$0a02a8c0@marcxp> Message-ID: Marc Battyani wrote: > Tim Daly Jr has sent the code for the transformation of pdf pages into > XObject, which can be printed on a page like any graphical element. (It's in > the current cl-pdf version, look at pdf-template.lisp) So you just have to > write the pages and then draw the new page numbers above the existing ones. That's more or less what I told Edi (without the technical details ;-). But doesn't this have the problem that you have to know the position of the page numbers on the page? In other words, this is not a general solution but would only work for documents where you figure out the page number position by looking at the document (with your eyes, not with the pdf parser), right? >> PS: Marc, Arthur is not in contributors.txt - I think he provided the >> parser, didn't he? > > Oops, thanks for pointing this. I'm very sorry Arthur :-( No problem Marc. I thought you gave me special treatment by mentioning me in the file itself instead of in contributors.txt like everybody else ;-) Arthur From marc.battyani at fractalconcept.com Mon Nov 14 23:17:59 2005 From: marc.battyani at fractalconcept.com (Marc Battyani) Date: Tue, 15 Nov 2005 00:17:59 +0100 Subject: [cl-pdf-devel] Concatenating PDF files References: <1132006075.16220.337.camel@beer.intern> Message-ID: <02be01c5e971$a74af190$0a02a8c0@marcxp> Tim Daly Jr. wrote: > On Mon, 2005-11-14 at 21:08 +0100, Edi Weitz wrote: > ... > > Nevertheless, at the moment I don't even know enough of CL-PDF to be > > able to concatenate the files without wading through the source code > > for a couple of hours. So, if someone could provide me with some > > lines of example code to get me started I'd be /very/ thankful. > > Something like this would be a start, I think: > > (require :cl-pdf) > (require :cl-pdf-parser) > (in-package :pdf) > > (defun concat-pdfs (out-file &rest in-files) > (with-document () > (dolist (in-file in-files) > (let* ((doc (read-pdf-file in-file)) > (root (root-page doc))) > (loop for page across (pages root) do > (with-page () > (let ((template (make-template-from-page page))) > (add-templates-to-page template) > (draw-template template)))))) > (write-document out-file))) Cool! > > but I'd rather do it all in Lisp if possible. Here is the same one with the page numbers added: (defun concat-pdfs (out-file &rest in-files) (with-document () (let ((page-number 0)) (dolist (in-file in-files) (let* ((doc (read-pdf-file in-file)) (root (root-page doc))) (loop for page across (pages root) do (with-page () (let ((template (make-template-from-page page)) (helvetica (pdf:get-font "Helvetica"))) (add-templates-to-page template) (draw-template template) (pdf:in-text-mode (pdf:set-font helvetica 14.0) (pdf:move-text 500 10) (pdf:set-gray-fill 0.0) (pdf:draw-text (format nil "Page ~d" (incf page-number))))))))) (write-document out-file)))) I will add this to the cl-pdf examples. :) > Amen, brother Maynard! Yep. Lisp rulez! Marc From edi at agharta.de Mon Nov 14 23:25:37 2005 From: edi at agharta.de (Edi Weitz) Date: Tue, 15 Nov 2005 00:25:37 +0100 Subject: [cl-pdf-devel] Concatenating PDF files In-Reply-To: <02be01c5e971$a74af190$0a02a8c0@marcxp> (Marc Battyani's message of "Tue, 15 Nov 2005 00:17:59 +0100") References: <1132006075.16220.337.camel@beer.intern> <02be01c5e971$a74af190$0a02a8c0@marcxp> Message-ID: On Tue, 15 Nov 2005 00:17:59 +0100, "Marc Battyani" wrote: > Here is the same one with the page numbers added: Great! Thanks to all of you for your help! From a_bakic at yahoo.com Tue Nov 15 15:21:18 2005 From: a_bakic at yahoo.com (Aleksandar Bakic) Date: Tue, 15 Nov 2005 07:21:18 -0800 (PST) Subject: [cl-pdf-devel] Unicode support feedback needed In-Reply-To: <066501c5e052$21bc8430$0a02a8c0@marcxp> Message-ID: <20051115152118.65102.qmail@web34610.mail.mud.yahoo.com> Hi, I tried your ttf2pt1 because my local example would not work with the new cl-pdf code. (It seems you had not zipped all that is needed for make to work. I had to remove docs and rpm (I believe) from the all: target to build the binaries.) Then I generated .ufm from my modified .ttf, and tried my example. The parts that I had typed using SBCL/Unicode are now not visible. I noticed that you format Unicode characters using ~C, but I type them directly in Unicode-enabled Emacs. I'll try to solve the problem, perhaps I have some relevant local differences, too. Alex __________________________________ Yahoo! Mail - PC Magazine Editors' Choice 2005 http://mail.yahoo.com From a_bakic at yahoo.com Tue Nov 15 18:47:50 2005 From: a_bakic at yahoo.com (Aleksandar Bakic) Date: Tue, 15 Nov 2005 10:47:50 -0800 (PST) Subject: [cl-pdf-devel] Unicode support feedback needed In-Reply-To: <20051115152118.65102.qmail@web34610.mail.mud.yahoo.com> Message-ID: <20051115184750.9889.qmail@web34614.mail.mud.yahoo.com> > I'll try to solve the problem, perhaps I have some > relevant local differences, too. For now, I've found out that the problem is either in my fontforge-generated font or your version of ttf2pt1. I'll see if fontforge has some encoding options. My examples work when using the original ttf font and your ttf2pt1. Any suggestions? Thanks, Alex __________________________________ Yahoo! Mail - PC Magazine Editors' Choice 2005 http://mail.yahoo.com From a_bakic at yahoo.com Tue Nov 15 19:03:35 2005 From: a_bakic at yahoo.com (Aleksandar Bakic) Date: Tue, 15 Nov 2005 11:03:35 -0800 (PST) Subject: [cl-pdf-devel] Unicode support feedback needed In-Reply-To: <20051115184750.9889.qmail@web34614.mail.mud.yahoo.com> Message-ID: <20051115190335.65819.qmail@web34601.mail.mud.yahoo.com> > I'll see if fontforge has some encoding options. I used Unicode Full encoding and that helped. Now it works as before :) [I also used Compact in the Encoding menu before Unicode Full, but that probably had no effect.] Alex __________________________________ Start your day with Yahoo! - Make it your home page! http://www.yahoo.com/r/hs From marc.battyani at fractalconcept.com Tue Nov 15 20:08:31 2005 From: marc.battyani at fractalconcept.com (Marc Battyani) Date: Tue, 15 Nov 2005 21:08:31 +0100 Subject: [cl-pdf-devel] Unicode support feedback needed References: <20051115190335.65819.qmail@web34601.mail.mud.yahoo.com> Message-ID: <066801c5ea20$5a36efd0$0a02a8c0@marcxp> Aleksandar Bakic wrote: >> I'll see if fontforge has some encoding options. > >I used Unicode Full encoding and that helped. Now it works as before :) [I also >used Compact in the Encoding menu before Unicode Full, but that probably had no >effect.] OK. It's good to know. So all works normally now ? About the ttf2pt1 utility. As we just use it to extract the encoding and the char metrics, a much better way would be to rewrite it in Lisp. IIRC, a long time ago, Zach Beane have written cl-truetype to extract the Bezier curves of a font. I will look at it to see if it can be used instead of a separated utility. IIRC From divanov at aha.ru Wed Nov 16 10:00:09 2005 From: divanov at aha.ru (Dmitriy Ivanov) Date: Wed, 16 Nov 2005 13:00:09 +0300 Subject: [cl-pdf-devel] Unicode support feedback needed References: <20051115190335.65819.qmail@web34601.mail.mud.yahoo.com> <066801c5ea20$5a36efd0$0a02a8c0@marcxp> Message-ID: <000001c5ea94$8ec98cc0$be01a8c0@digo> "Marc Battyani" wrote: | About the ttf2pt1 utility. As we just use it to extract the encoding | and the char metrics, a much better way would be to rewrite it in Lisp. | IIRC, a long time ago, Zach Beane have written cl-truetype to extract | the Bezier curves of a font. I will look at it to see if it can be used | instead of a separated utility. IMHO, to do font subsetting, CL-PDF cannot dispense with a font parsing function in Lisp :-(. -- Sincerely, Dmitriy Ivanov lisp.ystok.ru From kavenchuk at jenty.by Thu Nov 17 11:52:06 2005 From: kavenchuk at jenty.by (Yaroslav Kavenchuk) Date: Thu, 17 Nov 2005 13:52:06 +0200 Subject: [cl-pdf-devel] patch for contrib/zlib-clisp.lisp Message-ID: <437C6EE6.2060807@jenty.by> at clisp there is module "zlib" zlib-clisp.diff ======================================= --- zlib-clisp.lisp.orig Mon Oct 10 11:36:10 2005 +++ zlib-clisp.lisp Thu Nov 17 11:22:30 2005 @@ -35,6 +35,7 @@ #-CLISP (error "This code should be loaded in CLISP.") +#-:zlib (use-package "FFI") #| @@ -49,6 +50,7 @@ (:return-type ffi:int)) |# +#-:zlib (defvar *zlib-path* (or #+WIN32 "zlib.dll" ;; TODO how to deal with cygwin (#+UNIX on MS-Windows)? -- it wants zlib.dll @@ -58,7 +60,9 @@ "Set this variable to point to the location of the zlib library (libz.so or zlib.dll) on your system.") +#-:zlib (defvar *zlib*) +#-:zlib (unless (and (boundp '*zlib*) (ffi:validp *zlib*)) (setq *zlib* (user::foreign-library *zlib-path*))) @@ -73,6 +77,7 @@ ;; ffi:c-string (or ffi:c-array-ptr character), since it receives the ;; buffer length as an extra argument. +#-:zlib (ffi:def-lib-call-out zlib-compress-string *zlib* (:name "compress") (:arguments (dest ffi:c-pointer :in) @@ -82,6 +87,7 @@ (:return-type ffi:int) (:language :stdc)) +#-:zlib (defun compress-string (source) "Compress the string SOURCE. Returns an array of bytes representing the compressed data." @@ -97,6 +103,8 @@ (ffi:offset dest 0 `(c-array uint8 ,actual)) (error "zlib error, code ~d" status)))))) +#+:zlib +(setf (symbol-function 'compress-string) #'zlib:compress) (defmethod write-object ((obj pdf-stream) &optional root-level &aux compressed) #+(or Lispworks allegro CMU CLISP) =========================================== Thanks! -- WBR, Yaroslav Kavenchuk. From kavenchuk at jenty.by Thu Nov 17 13:42:09 2005 From: kavenchuk at jenty.by (Yaroslav Kavenchuk) Date: Thu, 17 Nov 2005 15:42:09 +0200 Subject: [cl-pdf-devel] iterate Message-ID: <437C88B1.1020809@jenty.by> Why is not used the original iterate package, but the copy of it is include on cl-pdf? Only for convenience, or there are completions? Thanks! -- WBR, Yaroslav Kavenchuk. From marc.battyani at fractalconcept.com Thu Nov 17 14:26:35 2005 From: marc.battyani at fractalconcept.com (Marc Battyani) Date: Thu, 17 Nov 2005 15:26:35 +0100 Subject: [cl-pdf-devel] Unicode support feedback needed References: <20051115190335.65819.qmail@web34601.mail.mud.yahoo.com> <066801c5ea20$5a36efd0$0a02a8c0@marcxp> <000001c5ea94$8ec98cc0$be01a8c0@digo> Message-ID: <059801c5eb82$ea0a0c10$0a02a8c0@marcxp> Dmitriy Ivanov wrote: > "Marc Battyani" wrote: > > | About the ttf2pt1 utility. As we just use it to extract the encoding > | and the char metrics, a much better way would be to rewrite it in Lisp. > | IIRC, a long time ago, Zach Beane have written cl-truetype to extract > | the Bezier curves of a font. I will look at it to see if it can be used > | instead of a separated utility. > > IMHO, to do font subsetting, CL-PDF cannot dispense with a font parsing > function in Lisp :-(. Well, I'm sure it's possible to extract the needed characters and to re-generate a TTF file in memory. At least it should be a good thing to avoid the use of the ttf2pt1 utility. The TTF format is public. Marc From marc.battyani at fractalconcept.com Thu Nov 17 14:29:07 2005 From: marc.battyani at fractalconcept.com (Marc Battyani) Date: Thu, 17 Nov 2005 15:29:07 +0100 Subject: [cl-pdf-devel] patch for contrib/zlib-clisp.lisp References: <437C6EE6.2060807@jenty.by> Message-ID: <059e01c5eb83$447e7af0$0a02a8c0@marcxp> Yaroslav Kavenchuk > at clisp there is module "zlib" > > zlib-clisp.diff > ======================================= > --- zlib-clisp.lisp.orig Mon Oct 10 11:36:10 2005 > +++ zlib-clisp.lisp Thu Nov 17 11:22:30 2005 > @@ -35,6 +35,7 @@ > > #-CLISP (error "This code should be loaded in CLISP.") > > +#-:zlib > (use-package "FFI") > > #| > @@ -49,6 +50,7 @@ > (:return-type ffi:int)) > |# > > +#-:zlib > (defvar *zlib-path* > (or #+WIN32 "zlib.dll" > ;; TODO how to deal with cygwin (#+UNIX on MS-Windows)? -- it > wants zlib.dll > @@ -58,7 +60,9 @@ > "Set this variable to point to the location of the zlib library > (libz.so or zlib.dll) on your system.") > > +#-:zlib > (defvar *zlib*) > +#-:zlib > (unless (and (boundp '*zlib*) > (ffi:validp *zlib*)) > (setq *zlib* (user::foreign-library *zlib-path*))) > @@ -73,6 +77,7 @@ > ;; ffi:c-string (or ffi:c-array-ptr character), since it receives the > ;; buffer length as an extra argument. > > +#-:zlib > (ffi:def-lib-call-out zlib-compress-string *zlib* > (:name "compress") > (:arguments (dest ffi:c-pointer :in) > @@ -82,6 +87,7 @@ > (:return-type ffi:int) > (:language :stdc)) > > +#-:zlib > (defun compress-string (source) > "Compress the string SOURCE. Returns an array of bytes > representing the compressed data." > @@ -97,6 +103,8 @@ > (ffi:offset dest 0 `(c-array uint8 ,actual)) > (error "zlib error, code ~d" status)))))) > > +#+:zlib > +(setf (symbol-function 'compress-string) #'zlib:compress) > > (defmethod write-object ((obj pdf-stream) &optional root-level &aux > compressed) > #+(or Lispworks allegro CMU CLISP) > =========================================== Thanks. Is this for windows only or portable on every clisp supported OS ? Marc From marc.battyani at fractalconcept.com Thu Nov 17 14:32:38 2005 From: marc.battyani at fractalconcept.com (Marc Battyani) Date: Thu, 17 Nov 2005 15:32:38 +0100 Subject: [cl-pdf-devel] iterate References: <437C88B1.1020809@jenty.by> Message-ID: <05a601c5eb83$c2a4f1c0$0a02a8c0@marcxp> Yaroslav Kavenchuk wrote: > Why is not used the original iterate package, but the copy of it is > include on cl-pdf? Only for convenience, or there are completions? It's both for convinience and to be sure to have a version that works with cl-pdf. Generally this version is even more up-to-date and maintained than the official one ;-) Marc From kavenchuk at jenty.by Thu Nov 17 15:12:41 2005 From: kavenchuk at jenty.by (Yaroslav Kavenchuk) Date: Thu, 17 Nov 2005 17:12:41 +0200 Subject: [cl-pdf-devel] patch for contrib/zlib-clisp.lisp In-Reply-To: <059e01c5eb83$447e7af0$0a02a8c0@marcxp> References: <059e01c5eb83$447e7af0$0a02a8c0@marcxp> Message-ID: <437C9DE9.5070001@jenty.by> Marc Battyani wrote: > Thanks. > > Is this for windows only or portable on every clisp supported OS ? > Portable, but not work. This work (all tests cl-typesettings passed) - sorry --- zlib-clisp.lisp.orig Mon Oct 10 11:36:10 2005 +++ zlib-clisp.lisp Thu Nov 17 15:11:15 2005 @@ -35,6 +35,7 @@ #-CLISP (error "This code should be loaded in CLISP.") +#-:zlib (use-package "FFI") #| @@ -49,6 +50,7 @@ (:return-type ffi:int)) |# +#-:zlib (defvar *zlib-path* (or #+WIN32 "zlib.dll" ;; TODO how to deal with cygwin (#+UNIX on MS-Windows)? -- it wants zlib.dll @@ -58,7 +60,9 @@ "Set this variable to point to the location of the zlib library (libz.so or zlib.dll) on your system.") +#-:zlib (defvar *zlib*) +#-:zlib (unless (and (boundp '*zlib*) (ffi:validp *zlib*)) (setq *zlib* (user::foreign-library *zlib-path*))) @@ -73,6 +77,7 @@ ;; ffi:c-string (or ffi:c-array-ptr character), since it receives the ;; buffer length as an extra argument. +#-:zlib (ffi:def-lib-call-out zlib-compress-string *zlib* (:name "compress") (:arguments (dest ffi:c-pointer :in) @@ -82,6 +87,7 @@ (:return-type ffi:int) (:language :stdc)) +#-:zlib (defun compress-string (source) "Compress the string SOURCE. Returns an array of bytes representing the compressed data." @@ -97,6 +103,13 @@ (ffi:offset dest 0 `(c-array uint8 ,actual)) (error "zlib error, code ~d" status)))))) +#+:zlib +(defun compress-string (source) + (zlib:compress + (if (typep source 'string) + (ext:convert-string-to-bytes source + ext:*default-file-encoding*) + source))) (defmethod write-object ((obj pdf-stream) &optional root-level &aux compressed) #+(or Lispworks allegro CMU CLISP) Thanks! -- WBR, Yaroslav Kavenchuk. From kavenchuk at jenty.by Thu Nov 17 15:18:24 2005 From: kavenchuk at jenty.by (Yaroslav Kavenchuk) Date: Thu, 17 Nov 2005 17:18:24 +0200 Subject: [cl-pdf-devel] iterate In-Reply-To: <05a601c5eb83$c2a4f1c0$0a02a8c0@marcxp> References: <05a601c5eb83$c2a4f1c0$0a02a8c0@marcxp> Message-ID: <437C9F40.6030108@jenty.by> Marc Battyani wrote: >>Why is not used the original iterate package, but the copy of it is >>include on cl-pdf? Only for convenience, or there are completions? > > > It's both for convinience and to be sure to have a version that works > with > cl-pdf. Generally this version is even more up-to-date and maintained > than > the official one ;-) > Well, changelog from official is more long... :) Thanks! -- WBR, Yaroslav Kvenchuk. From marc.battyani at fractalconcept.com Thu Nov 17 17:57:27 2005 From: marc.battyani at fractalconcept.com (Marc Battyani) Date: Thu, 17 Nov 2005 18:57:27 +0100 Subject: [cl-pdf-devel] iterate References: <05a601c5eb83$c2a4f1c0$0a02a8c0@marcxp> <437C9F40.6030108@jenty.by> Message-ID: <05e901c5eba0$5fb43ef0$0a02a8c0@marcxp> "Yaroslav Kavenchuk" wrote: > Marc Battyani wrote: > > >>Why is not used the original iterate package, but the copy of it is > >>include on cl-pdf? Only for convenience, or there are completions? > > > > > > It's both for convinience and to be sure to have a version that works > > with > > cl-pdf. Generally this version is even more up-to-date and maintained > > than > > the official one ;-) > > > > Well, changelog from official is more long... :) Sure I just wait for them to keep up and after I take it ;-) Marc From marc.battyani at fractalconcept.com Thu Nov 17 18:06:29 2005 From: marc.battyani at fractalconcept.com (Marc Battyani) Date: Thu, 17 Nov 2005 19:06:29 +0100 Subject: [cl-pdf-devel] patch for contrib/zlib-clisp.lisp References: <437C6EE6.2060807@jenty.by> <059e01c5eb83$447e7af0$0a02a8c0@marcxp> <073F2AA8-3E63-4210-AF8F-4261F198D341@gigamonkeys.com> Message-ID: <060001c5eba1$a31e6f70$0a02a8c0@marcxp> Peter Seibel wrote: > On Nov 17, 2005, at 6:29 AM, Marc Battyani wrote: > > > Yaroslav Kavenchuk > > > >> at clisp there is module "zlib" > > > Is this for windows only or portable on every clisp supported OS ? > > There's also the question of what license this code is under--if it's > part of CLISP it's GPL and thus you can't just grab it unless you > want to GPL cl-pdf. Even if it's in the contrib directory ? It's a user contributed file after all, not a real part of cl-pdf. There is no cl-pdf copyright in it, just the original public domain one from the author (Joerg-Cyril Hoehle) Marc From marc.battyani at fractalconcept.com Thu Nov 17 18:23:19 2005 From: marc.battyani at fractalconcept.com (Marc Battyani) Date: Thu, 17 Nov 2005 19:23:19 +0100 Subject: [cl-pdf-devel] patch for contrib/zlib-clisp.lisp References: <437C6EE6.2060807@jenty.by> <059e01c5eb83$447e7af0$0a02a8c0@marcxp> <073F2AA8-3E63-4210-AF8F-4261F198D341@gigamonkeys.com> <060001c5eba1$a31e6f70$0a02a8c0@marcxp> Message-ID: <066101c5eba3$fc1cce30$0a02a8c0@marcxp> Peter Seibel wrote: > On Nov 17, 2005, at 10:06 AM, Marc Battyani wrote: > > > Peter Seibel wrote: > >> On Nov 17, 2005, at 6:29 AM, Marc Battyani wrote: > >> > >>> Yaroslav Kavenchuk > >>> > >>>> at clisp there is module "zlib" > >> > >>> Is this for windows only or portable on every clisp supported OS ? > >> > >> There's also the question of what license this code is under--if it's > >> part of CLISP it's GPL and thus you can't just grab it unless you > >> want to GPL cl-pdf. > > > > Even if it's in the contrib directory ? It's a user contributed > > file after > > all, not a real part of cl-pdf. > > There is no cl-pdf copyright in it, just the original public domain > > one from > > the author (Joerg-Cyril Hoehle) > > Do you mean CLISP rather than cl-pdf above? If it's not actually part > of CLISP and has been placed in the public domain by the author, then > you're probably all set. (Modulo the problem with certain > jurisdictions (Germany, I think) making it essentially impossible to > put stuff in the public domain. What I mean is that it's not a part of cl-pdf so the viral GPL can't apply to cl-pdf IMO. There have been yet another discussion on this in cll and I think that as long as an interface is not CLISP only then it's ok. (ie there are N zlib intefaces) Marc From kavenchuk at jenty.by Fri Nov 18 10:07:43 2005 From: kavenchuk at jenty.by (Yaroslav Kavenchuk) Date: Fri, 18 Nov 2005 12:07:43 +0200 Subject: [cl-pdf-devel] #\Nul Message-ID: <437DA7EF.2070400@jenty.by> Is possible change #\Nul in ttu-font.lisp to #\Null or (code-char 0)? clisp not know about #\Nul. Thanks! -- WBR, Yaroslav Kavenchuk. From kavenchuk at jenty.by Fri Nov 18 10:19:24 2005 From: kavenchuk at jenty.by (Yaroslav Kavenchuk) Date: Fri, 18 Nov 2005 12:19:24 +0200 Subject: [cl-pdf-devel] compile warnings Message-ID: <437DAAAC.6090702@jenty.by> clisp-2.35 [2]> (asdf:operate 'asdf:compile-op :cl-pdf) ... ;; Compiling file C:\CL\lib\cl-pdf\encodings.lisp ... WARNING in 18 29 (DEFMETHOD INITIALIZE-INSTANCE :AFTER ...)-5-1-1-1 in lines 18..29 : variable INIT-OPTIONS is not used. Misspelled or missing IGNORE declaration? ... and so on. finish: ... The following functions were used but are deprecated: GENTEMP - This function creates symbols that cannot be garbage-collected. Use GENSYM instead. 0 errors, 22 warnings NIL I can insert (declare (ignore ... in these places? Thanks! -- WBR, Yaroslav Kavenchuk. From marc.battyani at fractalconcept.com Fri Nov 18 10:27:28 2005 From: marc.battyani at fractalconcept.com (Marc Battyani) Date: Fri, 18 Nov 2005 11:27:28 +0100 Subject: [cl-pdf-devel] #\Nul References: <437DA7EF.2070400@jenty.by> Message-ID: <023601c5ec2a$acca5550$0a02a8c0@marcxp> "Yaroslav Kavenchuk" writes: > Is possible change #\Nul in ttu-font.lisp to #\Null or (code-char 0)? > > clisp not know about #\Nul. OK. Marc From marc.battyani at fractalconcept.com Fri Nov 18 10:30:35 2005 From: marc.battyani at fractalconcept.com (Marc Battyani) Date: Fri, 18 Nov 2005 11:30:35 +0100 Subject: [cl-pdf-devel] compile warnings References: <437DAAAC.6090702@jenty.by> Message-ID: <023c01c5ec2b$1ca4fa10$0a02a8c0@marcxp> "Yaroslav Kavenchuk" writes: > clisp-2.35 > > [2]> (asdf:operate 'asdf:compile-op :cl-pdf) > ... > ;; Compiling file C:\CL\lib\cl-pdf\encodings.lisp ... > WARNING in 18 29 (DEFMETHOD INITIALIZE-INSTANCE :AFTER ...)-5-1-1-1 in > lines 18..29 : > variable INIT-OPTIONS is not used. > Misspelled or missing IGNORE declaration? > ... > > and so on. finish: > ... > The following functions were used but are deprecated: > > GENTEMP - This function creates symbols that cannot be > garbage-collected. Use GENSYM instead. > 0 errors, 22 warnings > NIL > > I can insert (declare (ignore ... in these places? Yes. But anyway the encoding stuff will change a lot as soon as I find enough time to integrate Dmitriy's code. Marc From kavenchuk at jenty.by Fri Nov 18 11:08:03 2005 From: kavenchuk at jenty.by (Yaroslav Kavenchuk) Date: Fri, 18 Nov 2005 13:08:03 +0200 Subject: [cl-pdf-devel] compile warnings In-Reply-To: <023c01c5ec2b$1ca4fa10$0a02a8c0@marcxp> References: <023c01c5ec2b$1ca4fa10$0a02a8c0@marcxp> Message-ID: <437DB613.2070906@jenty.by> Marc Battyani wrote: >>I can insert (declare (ignore ... in these places? > > > Yes. But anyway the encoding stuff will change a lot as soon as I find > enough time to integrate Dmitriy's code. > May be send patch to Dmitriy? Thanks! -- WBR, Yaroslav Kavenchuk. From kavenchuk at jenty.by Fri Nov 18 11:57:18 2005 From: kavenchuk at jenty.by (Yaroslav Kavenchuk) Date: Fri, 18 Nov 2005 13:57:18 +0200 Subject: [cl-pdf-devel] for clisp Message-ID: <437DC19E.1060402@jenty.by> I think, if library (is cl-pdf library?) establish global variables - it is not very good. I about custom:*default-file-encoding* in cl-pdf (and custom:*floating-point-contagion-ansi* custom:*warn-on-floating-point-contagion* in cl-typesettings. Possible use ext:letf for "shielding" this variables. May be make it is improbable or very hard? Thanks. -- WBR, Yaroslav Kavenchuk. From kavenchuk at jenty.by Fri Nov 18 13:28:55 2005 From: kavenchuk at jenty.by (Yaroslav Kavenchuk) Date: Fri, 18 Nov 2005 15:28:55 +0200 Subject: [cl-pdf-devel] clisp, example8 - stack overflow Message-ID: <437DD717.8030600@jenty.by> this feature clisp only? Thanks. -- WBR, Yaroslav Kavenchuk. From a_bakic at yahoo.com Fri Nov 18 13:44:27 2005 From: a_bakic at yahoo.com (Aleksandar Bakic) Date: Fri, 18 Nov 2005 05:44:27 -0800 (PST) Subject: [cl-pdf-devel] Unicode support feedback needed In-Reply-To: <066801c5ea20$5a36efd0$0a02a8c0@marcxp> Message-ID: <20051118134427.80829.qmail@web34602.mail.mud.yahoo.com> > So all works normally now ? I found another problem. Before the encodings change, a generated PDF could be conveted to PS using pdf2ps without losing characters. Now, when a PDF file with Unicode characters (using my font generated using fontforge w/ Full Unicode encoding) is converted to PS, the Unicode characters are not visible (in gv and kghostview, at least). Alex __________________________________ Yahoo! FareChase: Search multiple travel sites in one click. http://farechase.yahoo.com From a_bakic at yahoo.com Fri Nov 18 14:08:24 2005 From: a_bakic at yahoo.com (Aleksandar Bakic) Date: Fri, 18 Nov 2005 06:08:24 -0800 (PST) Subject: [cl-pdf-devel] Unicode support feedback needed In-Reply-To: <20051118134427.80829.qmail@web34602.mail.mud.yahoo.com> Message-ID: <20051118140824.88600.qmail@web34608.mail.mud.yahoo.com> Actually, I might have used the original TTF font when everything worked (I mean, the problem may not be related to the encodins change). Alex > Before the encodings change, [...] __________________________________ Yahoo! Mail - PC Magazine Editors' Choice 2005 http://mail.yahoo.com From marc.battyani at fractalconcept.com Fri Nov 18 14:21:29 2005 From: marc.battyani at fractalconcept.com (Marc Battyani) Date: Fri, 18 Nov 2005 15:21:29 +0100 Subject: [cl-pdf-devel] clisp, example8 - stack overflow References: <437DD717.8030600@jenty.by> Message-ID: <02aa01c5ec4b$5e3c9c60$0a02a8c0@marcxp> "Yaroslav Kavenchuk" writes: > > this feature clisp only? Yes ;-) At least it works on LispWorks. Marc From marc.battyani at fractalconcept.com Fri Nov 18 14:24:48 2005 From: marc.battyani at fractalconcept.com (Marc Battyani) Date: Fri, 18 Nov 2005 15:24:48 +0100 Subject: [cl-pdf-devel] Unicode support feedback needed References: <20051118134427.80829.qmail@web34602.mail.mud.yahoo.com> Message-ID: <02b001c5ec4b$d500a9e0$0a02a8c0@marcxp> "Aleksandar Bakic" writes: >I found another problem. Before the encodings change, a generated PDF could be >conveted to PS using pdf2ps without losing characters. Now, when a PDF file >with Unicode characters (using my font generated using fontforge w/ Full >Unicode encoding) is converted to PS, the Unicode characters are not visible >(in gv and kghostview, at least). Normally, I have not changed the output to the pdf file. So this should be the same. Have you tried with the full font? Marc From kavenchuk at jenty.by Fri Nov 18 15:00:05 2005 From: kavenchuk at jenty.by (Yaroslav Kavenchuk) Date: Fri, 18 Nov 2005 17:00:05 +0200 Subject: [cl-pdf-devel] clisp, example8 - stack overflow In-Reply-To: <02aa01c5ec4b$5e3c9c60$0a02a8c0@marcxp> References: <02aa01c5ec4b$5e3c9c60$0a02a8c0@marcxp> Message-ID: <437DEC75.7010602@jenty.by> Marc Battyani wrote: >>this feature clisp only? > > > Yes ;-) > > At least it works on LispWorks. > increase stack up to 6M has solved problem :) Thanks! -- WBR, Yaroslav Kavencuk. From kavenchuk at jenty.by Mon Nov 21 14:24:55 2005 From: kavenchuk at jenty.by (Yaroslav Kavenchuk) Date: Mon, 21 Nov 2005 16:24:55 +0200 Subject: [cl-pdf-devel] Unicode support feedback needed In-Reply-To: <02b001c5ec4b$d500a9e0$0a02a8c0@marcxp> References: <02b001c5ec4b$d500a9e0$0a02a8c0@marcxp> Message-ID: <4381D8B7.4060105@jenty.by> Marc Battyani wrote: > Normally, I have not changed the output to the pdf file. So this should > be > the same. Have you tried with the full font? > Sorry, but GSview 4.7 not read hello-u.pdf from cl-typesetting-test (adobe reader read it): Displaying PDF page 1 %GSVIEW_PDF_PAGE: 1 %GSVIEW_PDF_MEDIA: [0 0 595 841] %GSVIEW_PDF_ROTATE: 0 Loading NimbusSanL-Bold font from C:\Program Files\gs\fonts/n019004l.pfb... 2271224 943365 1617680 292391 3 done. Loading NimbusRomNo9L-ReguItal font from C:\Program Files\gs\fonts/n021023l.pfb... 2388392 1076529 1617680 298399 3 done. Error: /rangecheck in --%op_show_continue-- Operand stack: --dict:7/7(L)-- Execution stack: %interp_exit .runexec2 --nostringval-- --nostringval-- --nostringval-- 2 %stopped_push --nostringval-- --nostringval-- false 1 %stopped_push 1 3 %oparray_pop 1 3 %oparray_pop 1 3 %oparray_pop 1 3 %oparray_pop .runexec2 --nostringval-- --nostringval-- --nostringval-- 2 %stopped_push --nostringval-- --nostringval-- --nostringval-- --nostringval-- --nostringval-- %array_continue --nostringval-- false 1 %stopped_push --nostringval-- %loop_continue --nostringval-- --nostringval-- --nostringval-- %array_continue Dictionary stack: --dict:1129/1686(ro)(G)-- --dict:0/20(G)-- --dict:79/200(L)-- --dict:105/127(ro)(G)-- --dict:251/347(ro)(G)-- --dict:21/24(L)-- --dict:4/6(L)-- --dict:20/20(L)-- --dict:10/13(L)-- Current allocation mode is local pdf_page failed Thanks! -- WBR, Yaroslav Kavenchuk. From kavenchuk at jenty.by Tue Nov 22 08:25:33 2005 From: kavenchuk at jenty.by (Yaroslav Kavenchuk) Date: Tue, 22 Nov 2005 10:25:33 +0200 Subject: [cl-pdf-devel] Unicode support feedback needed In-Reply-To: <4381D8B7.4060105@jenty.by> References: <4381D8B7.4060105@jenty.by> Message-ID: <4382D5FD.8080604@jenty.by> > Sorry, but GSview 4.7 not read hello-u.pdf from cl-typesetting-test > (adobe reader read it): > Oops, my bug: in my times.ttf there are no characters with code 9562-9565 from unicode-hello function in test.lisp from cl-typesetting. But the size of files from unicode examples very big. It can be reduced? Thanks! -- WBR, Yaroslav Kavenchuk. From marc.battyani at fractalconcept.com Tue Nov 22 18:09:17 2005 From: marc.battyani at fractalconcept.com (Marc Battyani) Date: Tue, 22 Nov 2005 19:09:17 +0100 Subject: [cl-pdf-devel] Unicode support feedback needed References: <4381D8B7.4060105@jenty.by> <4382D5FD.8080604@jenty.by> Message-ID: <032c01c5ef8f$daac8bb0$0a02a8c0@marcxp> "Yaroslav Kavenchuk" writes: > > Sorry, but GSview 4.7 not read hello-u.pdf from cl-typesetting-test > > (adobe reader read it): > > > > Oops, my bug: in my times.ttf there are no characters with code > 9562-9565 from unicode-hello function in test.lisp from cl-typesetting. OK. Maybe I should change the example to use more mainstream unicode characters. > But the size of files from unicode examples very big. It can be reduced? The best way would be to generate a font subset on the fly with only the needed characters. But it's probably a lot of work (or maybe the truetype format is simple enough, I don't know). Otherwise I don't know if there are some utilities to do that. Marc From a_bakic at yahoo.com Tue Nov 29 02:02:44 2005 From: a_bakic at yahoo.com (Aleksandar Bakic) Date: Mon, 28 Nov 2005 18:02:44 -0800 (PST) Subject: [cl-pdf-devel] on escaping parentheses and backslashes Message-ID: <20051129020245.72040.qmail@web34605.mail.mud.yahoo.com> Hi, I am having some problems when typesetting random text (it is perhaps related to cl-typesetting, I am not sure yet). I noticed that writing one #\\ in write-cid-string and write-cid-char helps in some cases, but it does not solve the problem. Any hints on how the escaping of special characters should be done? Thanks, Alex __________________________________ Yahoo! Music Unlimited Access over 1 million songs. Try it free. http://music.yahoo.com/unlimited/ From marc.battyani at fractalconcept.com Tue Nov 29 07:14:47 2005 From: marc.battyani at fractalconcept.com (Marc Battyani) Date: Tue, 29 Nov 2005 08:14:47 +0100 Subject: [cl-pdf-devel] on escaping parentheses and backslashes References: <20051129020245.72040.qmail@web34605.mail.mud.yahoo.com> Message-ID: <05d101c5f4b4$983e7d90$0a02a8c0@marcxp> Aleksandar Bakic wrote: >I am having some problems when typesetting random text (it is perhaps >related >to cl-typesetting, I am not sure yet). I noticed that writing one #\\ in >write-cid-string and write-cid-char helps in some cases, but it does not >solve >the problem. Any hints on how the escaping of special characters should be >done? Normally cl-typesetting takes care of the escaping of the special characters. Do you have a reproductible example ? Marc From a_bakic at yahoo.com Tue Nov 29 11:59:08 2005 From: a_bakic at yahoo.com (Aleksandar Bakic) Date: Tue, 29 Nov 2005 03:59:08 -0800 (PST) Subject: [cl-pdf-devel] on escaping parentheses and backslashes In-Reply-To: <05d101c5f4b4$983e7d90$0a02a8c0@marcxp> Message-ID: <20051129115908.88299.qmail@web34605.mail.mud.yahoo.com> > Normally cl-typesetting takes care of the escaping of the special > characters. > Do you have a reproductible example ? I sent you the cl-typesetting patch below in a private email, as I am not yet a member of the list. It seems to fix the problem. Alex Index: stroke.lisp =================================================================== --- stroke.lisp (revision 110) +++ stroke.lisp (working copy) @@ -74,8 +74,10 @@ (unless (or string text-chunk) (setf text-x x text-y (+ offset y))) (let ((char (boxed-char char-box))) - (when (find char "\\()" :test #'char=) - (push #\\ string)) + (unless (and *font* (typep (pdf::font-metrics *font*) + 'pdf::ttu-font-metrics)) + (when (find char "\\()" :test #'char=) + (push #\\ string))) (push char string))) (add-spacing (space) (setf space (round (/ (* -1000 space) *text-x-scale*) *font-size*)) __________________________________ Yahoo! Music Unlimited Access over 1 million songs. Try it free. http://music.yahoo.com/unlimited/ From divanov at aha.ru Tue Nov 29 16:36:56 2005 From: divanov at aha.ru (Dmitriy Ivanov) Date: Tue, 29 Nov 2005 19:36:56 +0300 Subject: [cl-pdf-devel] Re: [cl-typesetting-devel] Unicode support feedbackneeded References: <074c01c503f3$13b432c0$0a02a8c0@marcxp><08b301c5198a$52a9fb20$0a02a8c0@marcxp><010401c5dd86$555ecec0$0a02a8c0@marcxp><05a801c5dee2$c081e2c0$0a02a8c0@marcxp><066601c5deea$eb9bb190$0a02a8c0@marcxp><015e01c5df40$dbf4c640$0a02a8c0@marcxp><028c01c5df92$443db080$0a02a8c0@marcxp><066501c5e052$21bc8430$0a02a8c0@marcxp><000701c5e3cf$f8ae6000$be01a8c0@digo><0d6701c5e3f4$2466f620$0a02a8c0@marcxp><000a01c5e452$f7b03a60$be01a8c0@digo><000001c5e488$54278b10$0a02a8c0@marcxp><000101c5e51d$b4f45190$be01a8c0@digo><033601c5e52c$702aebf0$0a02a8c0@marcxp> <000d01c5e62e$85cb3b60$be01a8c0@digo> <0a1401c5e64f$d4525ea0$0a02a8c0@marcxp> Message-ID: <000401c5f503$2f40a580$be01a8c0@digo> "Marc Battyani" wrote: | Dmitriy Ivanov wrote: |> |> I am pleased to propose quite a big rewrite of CL-PDF. The purpose is |> two-fold: |> |> 1) Integrate Type0 (CID-keyed) and Type1 fonts based on |> custom-encoding. 2) Approach binary mode of output file. |> |> The attachment contains the two files: |> |> 1) di-encodings.lisp |> Slightly changed encoding class hierarchy. |> |> 2) di-contrib.lisp |> Patches for several source files. | | Thanks Dmitriy, I will test this as soon I can find some time to do it. | | As for the binary mode of the pdf file, I'm starting to wonder if it's | a good idea after all. In any case the pdf format is a mixed char/byte | one and there are advantages and drawback to using each mode in Lisp. I think, the binary mode can be reasonably used when opening an external file to write the document. In other places, we take encoding into account and convert everything to strings that actually store ub8 codes. Page stream content is always a string and ready for compressing. That is why my latest code used your version of compress-string from zlib.lisp - the subtle version of string-to-octets is unneeded. -- Sincerely, Dmitriy Ivanov lisp.ystok.ru From a_bakic at yahoo.com Tue Nov 29 23:49:15 2005 From: a_bakic at yahoo.com (Aleksandar Bakic) Date: Tue, 29 Nov 2005 15:49:15 -0800 (PST) Subject: [cl-pdf-devel] on escaping parentheses and backslashes In-Reply-To: <20051129115908.88299.qmail@web34605.mail.mud.yahoo.com> Message-ID: <20051129234915.96733.qmail@web34605.mail.mud.yahoo.com> Hi, Another patch on the same topic. There are still problems: ccaron is rendered as Cdot by acroread (using the original windows fonts). The same happens with pdf2ps. xpdf renders ccaron fine. Alex Index: pdf-base.lisp =================================================================== --- pdf-base.lisp (revision 110) +++ pdf-base.lisp (working copy) @@ -27,9 +27,15 @@ (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*))) + (lo (ldb (byte 8 0) code)) + (chi (code-char hi)) + (clo (code-char lo))) + (when (find chi "\\()" :test #'char=) + (write-char #\\ *page-stream*)) + (write-char chi *page-stream*) + (when (find clo "\\()" :test #'char=) + (write-char #\\ *page-stream*)) + (write-char clo *page-stream*))) (princ string *page-stream*)) (write-string ") " *page-stream*)) @@ -38,9 +44,15 @@ (if (and *font* (typep (font-metrics *font*) 'ttu-font-metrics)) (let* ((code (char-code char)) (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*)) + (lo (ldb (byte 8 0) code)) + (chi (code-char hi)) + (clo (code-char lo))) + (when (find chi "\\()" :test #'char=) + (write-char #\\ *page-stream*)) + (write-char chi *page-stream*) + (when (find clo "\\()" :test #'char=) + (write-char #\\ *page-stream*)) + (write-char clo *page-stream*)) (write-char char *page-stream*)) (write-string ") " *page-stream*)) __________________________________ Yahoo! Mail - PC Magazine Editors' Choice 2005 http://mail.yahoo.com From marc.battyani at fractalconcept.com Wed Nov 30 12:03:29 2005 From: marc.battyani at fractalconcept.com (Marc Battyani) Date: Wed, 30 Nov 2005 13:03:29 +0100 Subject: [cl-pdf-devel] on escaping parentheses and backslashes References: <20051129115908.88299.qmail@web34605.mail.mud.yahoo.com> Message-ID: <0c1401c5f5a6$14522070$0a02a8c0@marcxp> Aleksandar Bakic wrote: > > Normally cl-typesetting takes care of the escaping of the special > > characters. > > Do you have a reproductible example ? > > I sent you the cl-typesetting patch below in a private email, as I am not yet a > member of the list. It seems to fix the problem. > > Alex > > Index: stroke.lisp > =================================================================== > --- stroke.lisp (revision 110) > +++ stroke.lisp (working copy) > @@ -74,8 +74,10 @@ > (unless (or string text-chunk) > (setf text-x x text-y (+ offset y))) > (let ((char (boxed-char char-box))) > - (when (find char "\\()" :test #'char=) > - (push #\\ string)) > + (unless (and *font* (typep (pdf::font-metrics *font*) > + 'pdf::ttu-font-metrics)) > + (when (find char "\\()" :test #'char=) > + (push #\\ string))) > (push char string))) > (add-spacing (space) > (setf space (round (/ (* -1000 space) *text-x-scale*) > *font-size*)) > OK Thanks. Looks like the problem were not the lack on quoting but instead the fact of quoting some unicode character. :) Marc From marc.battyani at fractalconcept.com Wed Nov 30 12:09:41 2005 From: marc.battyani at fractalconcept.com (Marc Battyani) Date: Wed, 30 Nov 2005 13:09:41 +0100 Subject: [cl-pdf-devel] Re: [cl-typesetting-devel] Unicode support feedbackneeded References: <074c01c503f3$13b432c0$0a02a8c0@marcxp><08b301c5198a$52a9fb20$0a02a8c0@marcxp><010401c5dd86$555ecec0$0a02a8c0@marcxp><05a801c5dee2$c081e2c0$0a02a8c0@marcxp><066601c5deea$eb9bb190$0a02a8c0@marcxp><015e01c5df40$dbf4c640$0a02a8c0@marcxp><028c01c5df92$443db080$0a02a8c0@marcxp><066501c5e052$21bc8430$0a02a8c0@marcxp><000701c5e3cf$f8ae6000$be01a8c0@digo><0d6701c5e3f4$2466f620$0a02a8c0@marcxp><000a01c5e452$f7b03a60$be01a8c0@digo><000001c5e488$54278b10$0a02a8c0@marcxp><000101c5e51d$b4f45190$be01a8c0@digo><033601c5e52c$702aebf0$0a02a8c0@marcxp> <000d01c5e62e$85cb3b60$be01a8c0@digo> <0a1401c5e64f$d4525ea0$0a02a8c0@marcxp> <000401c5f503$2f40a580$be01a8c0@digo> Message-ID: <0c1b01c5f5a6$f14b7e40$0a02a8c0@marcxp> "Dmitriy Ivanov" wrote: > "Marc Battyani" wrote: > > | As for the binary mode of the pdf file, I'm starting to wonder if it's > | a good idea after all. In any case the pdf format is a mixed char/byte > | one and there are advantages and drawback to using each mode in Lisp. > > I think, the binary mode can be reasonably used when opening an external > file to write the document. In other places, we take encoding into account > and convert everything to strings that actually store ub8 codes. Page stream > content is always a string and ready for compressing. Yes. > That is why my latest code used your version of compress-string from > zlib.lisp - the subtle version of string-to-octets is unneeded. OK. BTW I'm sorry, but as I am really, really, busy with 4 projects to finish before the end of the year, I have not yet looked at your encoding changes so far. But it's still high on my todo list ;-) Marc