From peter at javamonkey.com Wed Mar 3 00:53:41 2004 From: peter at javamonkey.com (Peter Seibel) Date: Tue, 02 Mar 2004 16:53:41 -0800 Subject: [cl-typesetting-devel] Small patch for hyphenation code Message-ID: I noticed some bad hyphenations in my generated PDFs such as hyphenating "store" as "s-tore". Checking with TeX it agrees with me that there are no good hyphen breaks in "store". Anyway, I figured out that the problem is cl-typesetting has no concept of \lefthyphenmin and \righthyphenmin the way TeX does. Here's a patch that adds at least an approximation of those concepts, set to the default TeX values. -Peter Index: hyphenation-fp.lisp =================================================================== --- hyphenation-fp.lisp (revision 10) +++ hyphenation-fp.lisp (working copy) @@ -39,6 +39,13 @@ :directory '(:relative "hyphen-patterns")) *cl-typesetting-base-directory*)) + +(defvar *left-hyphen-minimum* 2 + "Minimum number of characters that must precede a hyphen.") + +(defvar *right-hyphen-minimum* 3 + "Minimum number of characters that must follow a hyphen.") + ;; An hyphenation object is able to return the list ;; of hyphenation points for any word according to ;; the language it has been built for @@ -65,10 +72,16 @@ (result (hyphen-trie-find-exception word-seq (exception-trie hyphen-trie)))) (unless result (setq result (hyphen-trie-find `(#\. , at word-seq #\.) (pattern-trie hyphen-trie)))) - (mapcar #'first (remove-if - #'(lambda (x) (or (eq (first x) :end) (eq (first x) 0))) - result)))) + (format t "result : ~a~%" result) + (mapcar #'first (remove-if + #'(lambda (x) + (let ((idx (first x))) + (or (eq idx :end) + (< idx *left-hyphen-minimum*) + (< (- (length word) idx) *right-hyphen-minimum*)))) + result)))) + ;; Format of the language file: ;; the first line has 'pattern' ;; one pattern per line -- Peter Seibel peter at javamonkey.com Lisp is the red pill. -- John Fraser, comp.lang.lisp From divanov at aha.ru Wed Mar 3 06:32:57 2004 From: divanov at aha.ru (Dmitri Ivanov) Date: Wed, 3 Mar 2004 09:32:57 +0300 Subject: [cl-typesetting-devel] Multi-page tables and layout References: <06b501c3fcab$6f89e0e0$0303a8c0@marc2><16446.25586.351774.46397@mccarthy.genworks.com><06ea01c3fcaf$8a86c3f0$0303a8c0@marc2> <000001c400e4$86f2f770$a44d02c3@digo> Message-ID: <000201c400e9$7eebf770$a44d02c3@digo> Sorry about previously posting to the wrong list. | Hello, | | I am on my way to split a table automatically and want your opinion. My | approach is to put separate rows into a vbox. Do you think this is the | right direction? | | What was the intention of the splitable-p slot in the table-row class? | | The weak point is that we don't have the position of the last item | stroked into the page at our disposal. Is it possible for | make-filled-vbox to return a dy-left or dy-allocated value indicating | how much vertical space was actually used? | | We do need a kind of top-level layout staff akin to DefDoc. Its unit | conversion module could also be of value. | -- | Sincerely, | Dmitri Ivanov | lisp.ystok.ru From marc.battyani at fractalconcept.com Wed Mar 3 23:21:50 2004 From: marc.battyani at fractalconcept.com (Marc Battyani) Date: Thu, 4 Mar 2004 00:21:50 +0100 Subject: [cl-typesetting-devel] Small patch for hyphenation code References: Message-ID: <034501c40176$500e7530$0a04a8c0@marc2> "Peter Seibel" writes: > I noticed some bad hyphenations in my generated PDFs such as > hyphenating "store" as "s-tore". Checking with TeX it agrees with me > that there are no good hyphen breaks in "store". Anyway, I figured out > that the problem is cl-typesetting has no concept of \lefthyphenmin > and \righthyphenmin the way TeX does. Here's a patch that adds at > least an approximation of those concepts, set to the default TeX > values. [patch...] Committed to the repository! (I just removed the format and moved the (length word) out of the loop) It should work but I could not find the time to test it... Marc From marc.battyani at fractalconcept.com Wed Mar 3 23:22:26 2004 From: marc.battyani at fractalconcept.com (Marc Battyani) Date: Thu, 4 Mar 2004 00:22:26 +0100 Subject: [cl-typesetting-devel] Multi-page tables and layout References: <06b501c3fcab$6f89e0e0$0303a8c0@marc2><16446.25586.351774.46397@mccarthy.genworks.com><06ea01c3fcaf$8a86c3f0$0303a8c0@marc2><000001c400e4$86f2f770$a44d02c3@digo> <000201c400e9$7eebf770$a44d02c3@digo> Message-ID: <034601c40176$646006c0$0a04a8c0@marc2> "Dmitri Ivanov" writes: > Sorry about previously posting to the wrong list. > > | Hello, > | > | I am on my way to split a table automatically and want your opinion. My > | approach is to put separate rows into a vbox. Do you think this is the > | right direction? > | > | What was the intention of the splitable-p slot in the table-row class? > | > | The weak point is that we don't have the position of the last item > | stroked into the page at our disposal. Is it possible for > | make-filled-vbox to return a dy-left or dy-allocated value indicating > | how much vertical space was actually used? > | > | We do need a kind of top-level layout staff akin to DefDoc. Its unit > | conversion module could also be of value. Hi Dmitri, I'm sorry but I can't find the time to reply in details before Friday or Saturday. (Tomorrow I'm going to see customers in NL) Marc From peter at javamonkey.com Thu Mar 4 20:22:35 2004 From: peter at javamonkey.com (Peter Seibel) Date: Thu, 04 Mar 2004 12:22:35 -0800 Subject: [cl-typesetting-devel] Small patch for hyphenation code In-Reply-To: <034501c40176$500e7530$0a04a8c0@marc2> (Marc Battyani's message of "Thu, 4 Mar 2004 00:21:50 +0100") References: <034501c40176$500e7530$0a04a8c0@marc2> Message-ID: "Marc Battyani" writes: > "Peter Seibel" writes: > >> I noticed some bad hyphenations in my generated PDFs such as >> hyphenating "store" as "s-tore". Checking with TeX it agrees with me >> that there are no good hyphen breaks in "store". Anyway, I figured out >> that the problem is cl-typesetting has no concept of \lefthyphenmin >> and \righthyphenmin the way TeX does. Here's a patch that adds at >> least an approximation of those concepts, set to the default TeX >> values. > > [patch...] > > Committed to the repository! > (I just removed the format and moved the (length word) out of the loop) > It should work but I could not find the time to test it... Whoops. Didn't mean to leave that FORMAT in there obviously. Thanks. -Peter -- Peter Seibel peter at javamonkey.com Lisp is the red pill. -- John Fraser, comp.lang.lisp From divanov at aha.ru Fri Mar 5 16:17:14 2004 From: divanov at aha.ru (Dmitri Ivanov) Date: Fri, 5 Mar 2004 19:17:14 +0300 Subject: [cl-typesetting-devel] Top-level layout, multi-page tables, and other contrib References: <06b501c3fcab$6f89e0e0$0303a8c0@marc2><16446.25586.351774.46397@mccarthy.genworks.com><06ea01c3fcaf$8a86c3f0$0303a8c0@marc2><000001c400e4$86f2f770$a44d02c3@digo> <000201c400e9$7eebf770$a44d02c3@digo> <034601c40176$646006c0$0a04a8c0@marc2> Message-ID: <001101c402cd$560313d0$2a4302c3@digo> Hello, Main features ============== - Basic top-level stuff - Multi-page table working only if they are inline - Multi-page table can have header and footer rows - Implemented row-span for table cells - New generic v-split as a replacement of split-lines. Please test. The resulting pdf file is available in lisp.ystok.ru/code/multi-page.pdf Other suggestions and notes ========================= 1) I suggest renaming the splitable-p slot into "keep" or "keep-together" which accept values t (meaning keep own lines together) or :next (meaning keep own lines together as well as with the next box). 2) The package name "typeset" is a bit long, and source looks too wording as a result. It would be nice having nicknames like TSET, TPS, or even TT or TY. I vote for TT. It would be nice having an abbreviation for the paragraph macro - I vote for universally recognized P. IMHO put-source-code-string is also too long, let's have simply "put-source" or the like. 3) AFAIR, code badly needs lots of restructuring and encapsulation. For example, the pdf:page class should inherit from typeset:page, pdf:document - from typeset:document, not vice versa. -- Sincerely, Dmitri Ivanov lisp.ystok.ru -------------- next part -------------- A non-text attachment was scrubbed... Name: multi-page.lisp Type: application/octet-stream Size: 7808 bytes Desc: not available URL: -------------- next part -------------- A non-text attachment was scrubbed... Name: di-contrib.zip Type: application/x-zip-compressed Size: 9330 bytes Desc: not available URL: From marc.battyani at fractalconcept.com Fri Mar 5 23:12:23 2004 From: marc.battyani at fractalconcept.com (Marc Battyani) Date: Sat, 6 Mar 2004 00:12:23 +0100 Subject: [cl-typesetting-devel] Top-level layout, multi-page tables, and other contrib References: <06b501c3fcab$6f89e0e0$0303a8c0@marc2><16446.25586.351774.46397@mccarthy.genworks.com><06ea01c3fcaf$8a86c3f0$0303a8c0@marc2><000001c400e4$86f2f770$a44d02c3@digo><000201c400e9$7eebf770$a44d02c3@digo><034601c40176$646006c0$0a04a8c0@marc2> <001101c402cd$560313d0$2a4302c3@digo> Message-ID: <011b01c40307$522928a0$0303a8c0@marc2> "Dmitri Ivanov" writes: > Main features > ============== > - Basic top-level stuff > - Multi-page table working only if they are inline > - Multi-page table can have header and footer rows > - Implemented row-span for table cells > - New generic v-split as a replacement of split-lines. > > Please test. The resulting pdf file is available in > lisp.ystok.ru/code/multi-page.pdf Very Great! > Other suggestions and notes > ========================= > 1) I suggest renaming the splitable-p slot into "keep" or "keep-together" > which accept values t (meaning keep own lines together) or :next (meaning > keep own lines together as well as with the next box). Or maybe a number? > 2) The package name "typeset" is a bit long, and source looks too wording as > a result. It would be nice having nicknames like TSET, TPS, or even TT or > TY. I vote for TT. OK, why not. Anybody has another suggestion ? > It would be nice having an abbreviation for the paragraph macro - I vote for > universally recognized P. OK. > IMHO put-source-code-string is also too long, let's have simply "put-source" > or the like. Or maybe "verbatim" What does TeX uses ? > 3) AFAIR, code badly needs lots of restructuring and encapsulation. For > example, the pdf:page class should inherit from typeset:page, pdf:document - > from typeset:document, not vice versa. No. cl-pdf can be used without cl-typesetting. At least for now ;-) I will test and merge this into cl-typesetting this WE. I any case thanks a lot Dmitri! This is a very great contribution! All the best, Marc From divanov at aha.ru Sat Mar 6 06:39:38 2004 From: divanov at aha.ru (Dmitri Ivanov) Date: Sat, 6 Mar 2004 09:39:38 +0300 Subject: [cl-typesetting-devel] Top-level layout, multi-page tables, and other contrib References: <06b501c3fcab$6f89e0e0$0303a8c0@marc2><16446.25586.351774.46397@mccarthy.genworks.com><06ea01c3fcaf$8a86c3f0$0303a8c0@marc2><000001c400e4$86f2f770$a44d02c3@digo><000201c400e9$7eebf770$a44d02c3@digo><034601c40176$646006c0$0a04a8c0@marc2> <001101c402cd$560313d0$2a4302c3@digo> <011b01c40307$522928a0$0303a8c0@marc2> Message-ID: <000001c40348$5281bf60$da4d02c3@digo> Hello Marc, |> 1) I suggest renaming the splitable-p slot into "keep" or |> "keep-together" which accept values t (meaning keep own lines |> together) or :next (meaning keep own lines together as well as with |> the next box). | | Or maybe a number? Agree. |> IMHO put-source-code-string is also too long, let's have simply | "put-source" |> or the like. | | Or maybe "verbatim" | What does TeX uses ? "verbatim" is even better. I would also prefer a global switch *dont-hyphenate* or *hyphenatation-level* if possible. Small code notes on typo.lisp ;;-- Instead of: (defmethod (setf font) :around (font (style text-style)) (when (stringp font)(setf font (pdf:get-font font))) (call-next-method font style)) ;;-- More natural: (defmethod (setf font) ((font string) (style text-style)) (setf (font style) (pdf:get-font font))) ;; About insert-stuff (defmethod insert-stuff ((obj symbol)) `(put-string (princ-to-string ,obj))) It could be of value to make difference between put-string and put-source-code-string (or verbatim) just inside the insert-stuff. Peter uses *significant-whitespace* for a similiar purpose: (defmethod emit-pdf ((thing string)) (if *significant-whitespace* (typeset::put-source-code-string thing) (typeset::put-string thing))) A *significant-whitespace* equivalent can be incorporated at insert-stuff level like this: (defmethod insert-stuff ((obj symbol)) `(funcall (if *significant-whitespace* (typeset::put-source-code-string thing) (typeset::put-string thing)) (princ-to-string ,obj))) Or, (defmethod insert-stuff ((obj symbol)) `(funcall *default-stringer* (princ-to-string ,obj))) -- Sincerely, Dmitri Ivanov lisp.ystok.ru From peter at javamonkey.com Sat Mar 6 18:21:13 2004 From: peter at javamonkey.com (Peter Seibel) Date: Sat, 06 Mar 2004 10:21:13 -0800 Subject: [cl-typesetting-devel] Top-level layout, multi-page tables, and other contrib In-Reply-To: <000001c40348$5281bf60$da4d02c3@digo> (Dmitri Ivanov's message of "Sat, 6 Mar 2004 09:39:38 +0300") References: <06b501c3fcab$6f89e0e0$0303a8c0@marc2> <16446.25586.351774.46397@mccarthy.genworks.com> <06ea01c3fcaf$8a86c3f0$0303a8c0@marc2> <000001c400e4$86f2f770$a44d02c3@digo> <000201c400e9$7eebf770$a44d02c3@digo> <034601c40176$646006c0$0a04a8c0@marc2> <001101c402cd$560313d0$2a4302c3@digo> <011b01c40307$522928a0$0303a8c0@marc2> <000001c40348$5281bf60$da4d02c3@digo> Message-ID: "Dmitri Ivanov" writes: > Hello Marc, > > |> 1) I suggest renaming the splitable-p slot into "keep" or > |> "keep-together" which accept values t (meaning keep own lines > |> together) or :next (meaning keep own lines together as well as with > |> the next box). > | > | Or maybe a number? > > Agree. > > |> IMHO put-source-code-string is also too long, let's have simply > | "put-source" > |> or the like. > | > | Or maybe "verbatim" > | What does TeX uses ? > > "verbatim" is even better. I would also prefer a global switch > *dont-hyphenate* or *hyphenatation-level* if possible. Yes, that would be nice. I've been tempted to hack that in but haven't gotten around to it. I also would like a way to specify that a particular string is *not* to be broken across a line even if it contains whitespace, etc. Maybe that's just "verbatim"; I haven't played around with what happens if I emit verbatim text in the middle of a paragraph. -Peter -- Peter Seibel peter at javamonkey.com Lisp is the red pill. -- John Fraser, comp.lang.lisp From divanov at aha.ru Sun Mar 7 07:10:14 2004 From: divanov at aha.ru (Dmitri Ivanov) Date: Sun, 7 Mar 2004 10:10:14 +0300 Subject: [cl-typesetting-devel] Top-level layout, multi-page tables, and other contrib References: <06b501c3fcab$6f89e0e0$0303a8c0@marc2><16446.25586.351774.46397@mccarthy.genworks.com><06ea01c3fcaf$8a86c3f0$0303a8c0@marc2><000001c400e4$86f2f770$a44d02c3@digo><000201c400e9$7eebf770$a44d02c3@digo><034601c40176$646006c0$0a04a8c0@marc2> <001101c402cd$560313d0$2a4302c3@digo> <011b01c40307$522928a0$0303a8c0@marc2> Message-ID: <000101c40413$5d0ded20$d54302c3@digo> Hello Marc, |> 3) AFAIR, code badly needs lots of restructuring and encapsulation. |> For example, the pdf:page class should inherit from typeset:page, | pdf:document - |> from typeset:document, not vice versa. | | No. cl-pdf can be used without cl-typesetting. At least for now ;-) At least symbols pdf:*document*, pdf:*page* and some others should be imported into typeset and then reexported. I assumed that finalize-page can perform custom operations like adding outline via finalize-fn. Perhaps finalize-page should become a generic and do this in :before or :after method for pdf::page argument (as well as getting content). BTW, I've run into the questionable method in stroke.lisp: (defmethod stroke ((style text-style) x y) (when (font style) (setf *font* (font style))) (when (font-size style) (setf *font-size* (font-size style))) (when (text-x-scale style) (setf *text-x-scale* (text-x-scale style))) (when (color style) (setf *color* (color style)) (pdf::set-color-fill *color*))) Though *color* holds a foreground, or stroking, color value, this value is assigned as a non-stroking PDF color. Must we have the following: (defmethod stroke ((style text-style) x y) (when (font style) (setf *font* (font style))) (when (font-size style) (setf *font-size* (font-size style))) (when (text-x-scale style) (setf *text-x-scale* (text-x-scale style))) (when (color style) (setf *color* (color style)) (pdf::set-color-stroke *color*)) (when (background-color style) (setf *background-color* (background-color style)) (pdf::set-color-fill *background-color*))) ? -- Sincerely, Dmitri Ivanov lisp.ystok.ru From marc.battyani at fractalconcept.com Sun Mar 7 22:52:07 2004 From: marc.battyani at fractalconcept.com (Marc Battyani) Date: Sun, 7 Mar 2004 23:52:07 +0100 Subject: [cl-typesetting-devel] New version References: <06b501c3fcab$6f89e0e0$0303a8c0@marc2><16446.25586.351774.46397@mccarthy.genworks.com><06ea01c3fcaf$8a86c3f0$0303a8c0@marc2><000001c400e4$86f2f770$a44d02c3@digo><000201c400e9$7eebf770$a44d02c3@digo><034601c40176$646006c0$0a04a8c0@marc2><001101c402cd$560313d0$2a4302c3@digo><011b01c40307$522928a0$0303a8c0@marc2> <000101c40413$5d0ded20$d54302c3@digo> Message-ID: <050a01c40496$d2a746c0$0303a8c0@marc2> I've merged the code from Dmitri Ivanov into the repository Added splitable multi-pages tables Added row-span in tables Top level document structure Several improvements Thanks to Dmitri for all this. :) Have fun with this and please report the bugs... (Look at test.lisp for an example of the new functionalities) Marc From marc.battyani at fractalconcept.com Sun Mar 7 22:52:18 2004 From: marc.battyani at fractalconcept.com (Marc Battyani) Date: Sun, 7 Mar 2004 23:52:18 +0100 Subject: [cl-typesetting-devel] Top-level layout, multi-page tables, and other contrib References: <06b501c3fcab$6f89e0e0$0303a8c0@marc2><16446.25586.351774.46397@mccarthy.genworks.com><06ea01c3fcaf$8a86c3f0$0303a8c0@marc2><000001c400e4$86f2f770$a44d02c3@digo><000201c400e9$7eebf770$a44d02c3@digo><034601c40176$646006c0$0a04a8c0@marc2><001101c402cd$560313d0$2a4302c3@digo><011b01c40307$522928a0$0303a8c0@marc2> <000101c40413$5d0ded20$d54302c3@digo> Message-ID: <050b01c40496$d95cce40$0303a8c0@marc2> "Dmitri Ivanov" writes: > |> 3) AFAIR, code badly needs lots of restructuring and encapsulation. > |> For example, the pdf:page class should inherit from typeset:page, > | pdf:document - > |> from typeset:document, not vice versa. > | > | No. cl-pdf can be used without cl-typesetting. At least for now ;-) > > At least symbols pdf:*document*, pdf:*page* and some others should be > imported into typeset and then reexported. Yes. > I assumed that finalize-page can perform custom operations like adding > outline via finalize-fn. Perhaps finalize-page should become a generic and > do this in :before or :after method for pdf::page argument (as well as > getting content). I have not looked enough at this code to have an opinion on this yet. :) > BTW, I've run into the questionable method in stroke.lisp: > > (defmethod stroke ((style text-style) x y) > (when (font style) > (setf *font* (font style))) > (when (font-size style) > (setf *font-size* (font-size style))) > (when (text-x-scale style) > (setf *text-x-scale* (text-x-scale style))) > (when (color style) > (setf *color* (color style)) > (pdf::set-color-fill *color*))) > > Though *color* holds a foreground, or stroking, color value, this value is > assigned as a non-stroking PDF color. Must we have the following: > > (defmethod stroke ((style text-style) x y) > (when (font style) > (setf *font* (font style))) > (when (font-size style) > (setf *font-size* (font-size style))) > (when (text-x-scale style) > (setf *text-x-scale* (text-x-scale style))) > (when (color style) > (setf *color* (color style)) > (pdf::set-color-stroke *color*)) > (when (background-color style) > (setf *background-color* (background-color style)) > (pdf::set-color-fill *background-color*))) Not for text. When drawing text in pdf, the fill color is used. IIRC the stroke color would apply when you want to have hollow characters for instance. Marc From divanov at aha.ru Tue Mar 9 08:20:13 2004 From: divanov at aha.ru (Dmitri Ivanov) Date: Tue, 9 Mar 2004 11:20:13 +0300 Subject: [cl-typesetting-devel] New version References: <06b501c3fcab$6f89e0e0$0303a8c0@marc2><16446.25586.351774.46397@mccarthy.genworks.com><06ea01c3fcaf$8a86c3f0$0303a8c0@marc2><000001c400e4$86f2f770$a44d02c3@digo><000201c400e9$7eebf770$a44d02c3@digo><034601c40176$646006c0$0a04a8c0@marc2><001101c402cd$560313d0$2a4302c3@digo><011b01c40307$522928a0$0303a8c0@marc2><000101c40413$5d0ded20$d54302c3@digo> <050a01c40496$d2a746c0$0303a8c0@marc2> Message-ID: <000201c405af$c4418360$445702c3@digo> Hello Marc, | I've merged the code from Dmitri Ivanov into the repository | ...snip...| Two notes about the code merged. 1) You have inserted code starting with (defgeneric v-split (content dx dy &optional v-align) in both specials.lisp and boxes.lisp. 2) stroke.lisp, (defmethod stroke ((line text-line) x y) Thanks for #+lispworks/#+lispworks - featured additions. I found out that they are not actually needed though don't do any harm. After I have set (lw:set-default-character-element-type 'simple-char) beforehand, your old version works fine. Sorry for bothering. Two notes about test.lisp 1) To facilitate testing, it would be nice to parameterize banner and fractal locations as follows: (defun single-page-example (&optional (file #P"/tmp/ex.pdf") (banner #P"/tmp/banner.jpg") (fractal #P"/tmp/fractal.jpg")) 2) multi-page-example seems to artbitrary switch text color to green for even pages 2 and 4. Not sure if this due to lack of any initial color setting in the example or some other side effect. -- Sincerely, Dmitri Ivanov lisp.ystok.ru From divanov at aha.ru Tue Mar 9 09:52:57 2004 From: divanov at aha.ru (Dmitri Ivanov) Date: Tue, 9 Mar 2004 12:52:57 +0300 Subject: [cl-typesetting-devel] Top-level layout, multi-page tables, and other contrib References: <06b501c3fcab$6f89e0e0$0303a8c0@marc2><16446.25586.351774.46397@mccarthy.genworks.com><06ea01c3fcaf$8a86c3f0$0303a8c0@marc2><000001c400e4$86f2f770$a44d02c3@digo><000201c400e9$7eebf770$a44d02c3@digo><034601c40176$646006c0$0a04a8c0@marc2><001101c402cd$560313d0$2a4302c3@digo><011b01c40307$522928a0$0303a8c0@marc2> <000101c40413$5d0ded20$d54302c3@digo> <050b01c40496$d95cce40$0303a8c0@marc2> Message-ID: <000301c405bc$81993af0$445702c3@digo> Hello Marc, |> BTW, I've run into the questionable method in stroke.lisp: |> |> (defmethod stroke ((style text-style) x y) |...snip...| Thanks for the explanation. BTW, is there any reason for having the two keywords: :centered and :center? E.g. (tt:paragraph (:h-align :centered) ...) (tt:hbox (:align :center) ...) IMHO if we had them unified to :center, that would give less mess ;-) -- Sincerely, Dmitri Ivanov lisp.ystok.ru From divanov at aha.ru Tue Mar 9 10:27:18 2004 From: divanov at aha.ru (Dmitri Ivanov) Date: Tue, 9 Mar 2004 13:27:18 +0300 Subject: [cl-typesetting-devel] New version References: <06b501c3fcab$6f89e0e0$0303a8c0@marc2><16446.25586.351774.46397@mccarthy.genworks.com><06ea01c3fcaf$8a86c3f0$0303a8c0@marc2><000001c400e4$86f2f770$a44d02c3@digo><000201c400e9$7eebf770$a44d02c3@digo><034601c40176$646006c0$0a04a8c0@marc2><001101c402cd$560313d0$2a4302c3@digo><011b01c40307$522928a0$0303a8c0@marc2><000101c40413$5d0ded20$d54302c3@digo><050a01c40496$d2a746c0$0303a8c0@marc2> <000201c405af$c4418360$445702c3@digo> Message-ID: <000401c405c1$35259920$445702c3@digo> | 2) multi-page-example seems to artbitrary switch text | color to green for even pages 2 and 4. Not sure if this due to lack of | any initial color setting in the example or some other side effect. I've discovered that the global value of *color* was retained (0.0 0.6 0.3) from single-page-example after a non-local exit (aborting from a debugger prompt). The text-style mechanism seems rather fragile :-) -- Sincerely, Dmitri Ivanov lisp.ystok.ru From marc.battyani at fractalconcept.com Wed Mar 10 19:05:27 2004 From: marc.battyani at fractalconcept.com (Marc Battyani) Date: Wed, 10 Mar 2004 20:05:27 +0100 Subject: [cl-typesetting-devel] Top-level layout, multi-page tables, and other contrib References: <06b501c3fcab$6f89e0e0$0303a8c0@marc2><16446.25586.351774.46397@mccarthy.genworks.com><06ea01c3fcaf$8a86c3f0$0303a8c0@marc2><000001c400e4$86f2f770$a44d02c3@digo><000201c400e9$7eebf770$a44d02c3@digo><034601c40176$646006c0$0a04a8c0@marc2><001101c402cd$560313d0$2a4302c3@digo><011b01c40307$522928a0$0303a8c0@marc2> <000101c40413$5d0ded20$d54302c3@digo> <050b01c40496$d95cce40$0303a8c0@marc2> <000301c405bc$81993af0$445702c3@digo> Message-ID: <0fb701c406d2$a6df7e20$0303a8c0@marc2> "Dmitri Ivanov" writes: > BTW, is there any reason for having the two keywords: :centered and :center? > E.g. > > (tt:paragraph (:h-align :centered) ...) > (tt:hbox (:align :center) ...) > > IMHO if we had them unified to :center, that would give less mess ;-) Hi Dmitri. I will put :center everywhere. Marc From marc.battyani at fractalconcept.com Wed Mar 10 19:06:00 2004 From: marc.battyani at fractalconcept.com (Marc Battyani) Date: Wed, 10 Mar 2004 20:06:00 +0100 Subject: [cl-typesetting-devel] New version References: <06b501c3fcab$6f89e0e0$0303a8c0@marc2><16446.25586.351774.46397@mccarthy.genworks.com><06ea01c3fcaf$8a86c3f0$0303a8c0@marc2><000001c400e4$86f2f770$a44d02c3@digo><000201c400e9$7eebf770$a44d02c3@digo><034601c40176$646006c0$0a04a8c0@marc2><001101c402cd$560313d0$2a4302c3@digo><011b01c40307$522928a0$0303a8c0@marc2><000101c40413$5d0ded20$d54302c3@digo> <050a01c40496$d2a746c0$0303a8c0@marc2> <000201c405af$c4418360$445702c3@digo> Message-ID: <0fb801c406d2$ba9089f0$0303a8c0@marc2> "Dmitri Ivanov" writes: > Two notes about the code merged. > > 1) You have inserted code starting with > (defgeneric v-split (content dx dy &optional v-align) > in both specials.lisp and boxes.lisp. Corrected. (removed from specials.lisp) > 2) stroke.lisp, (defmethod stroke ((line text-line) x y) > Thanks for #+lispworks/#+lispworks - featured additions. I found out that > they are not actually needed though don't do any harm. After I have set > (lw:set-default-character-element-type 'simple-char) > beforehand, your old version works fine. Sorry for bothering. OK, I will put back the initial code. > Two notes about test.lisp > 1) To facilitate testing, it would be nice to parameterize banner and > fractal locations as follows: > > (defun single-page-example (&optional (file #P"/tmp/ex.pdf") > (banner #P"/tmp/banner.jpg") (fractal #P"/tmp/fractal.jpg")) Done. Marc From marc.battyani at fractalconcept.com Wed Mar 10 19:06:57 2004 From: marc.battyani at fractalconcept.com (Marc Battyani) Date: Wed, 10 Mar 2004 20:06:57 +0100 Subject: [cl-typesetting-devel] New version References: <06b501c3fcab$6f89e0e0$0303a8c0@marc2><16446.25586.351774.46397@mccarthy.genworks.com><06ea01c3fcaf$8a86c3f0$0303a8c0@marc2><000001c400e4$86f2f770$a44d02c3@digo><000201c400e9$7eebf770$a44d02c3@digo><034601c40176$646006c0$0a04a8c0@marc2><001101c402cd$560313d0$2a4302c3@digo><011b01c40307$522928a0$0303a8c0@marc2><000101c40413$5d0ded20$d54302c3@digo><050a01c40496$d2a746c0$0303a8c0@marc2><000201c405af$c4418360$445702c3@digo> <000401c405c1$35259920$445702c3@digo> Message-ID: <0fbd01c406d2$dcdb60c0$0303a8c0@marc2> "Dmitri Ivanov" writes: > | 2) multi-page-example seems to artbitrary switch text > | color to green for even pages 2 and 4. Not sure if this due to lack of > | any initial color setting in the example or some other side effect. > > I've discovered that the global value of *color* was retained (0.0 0.6 0.3) > from single-page-example after a non-local exit (aborting from a debugger > prompt). The text-style mechanism seems rather fragile :-) Sure it is... Peter Seibel has found some ones which are now corrected but there are probably others. A with-default-style macro which would bind the special variables, could be used in some places to avoid this. Or maybe I should just toss away all the *style-special-variables* and just have a *current-style* holding an object. Marc From marc.battyani at fractalconcept.com Wed Mar 10 19:11:34 2004 From: marc.battyani at fractalconcept.com (Marc Battyani) Date: Wed, 10 Mar 2004 20:11:34 +0100 Subject: [cl-typesetting-devel] Top-level layout, multi-page tables, andother contrib References: <06b501c3fcab$6f89e0e0$0303a8c0@marc2><16446.25586.351774.46397@mccarthy.genworks.com><06ea01c3fcaf$8a86c3f0$0303a8c0@marc2><000001c400e4$86f2f770$a44d02c3@digo><000201c400e9$7eebf770$a44d02c3@digo><034601c40176$646006c0$0a04a8c0@marc2><001101c402cd$560313d0$2a4302c3@digo><011b01c40307$522928a0$0303a8c0@marc2><000001c40348$5281bf60$da4d02c3@digo> Message-ID: <0fc101c406d3$829363a0$0303a8c0@marc2> "Peter Seibel" writes: > "Dmitri Ivanov" writes: > > > "verbatim" is even better. I would also prefer a global switch > > *dont-hyphenate* or *hyphenatation-level* if possible. > > Yes, that would be nice. I've been tempted to hack that in but haven't > gotten around to it. I also would like a way to specify that a > particular string is *not* to be broken across a line even if it > contains whitespace, etc. Maybe that's just "verbatim"; I haven't > played around with what happens if I emit verbatim text in the middle > of a paragraph. I think it should work. I renamed #'put-source-code-string to #'verbatim Marc From divanov at aha.ru Thu Mar 11 07:20:13 2004 From: divanov at aha.ru (Dmitri Ivanov) Date: Thu, 11 Mar 2004 10:20:13 +0300 Subject: [cl-typesetting-devel] New version References: <06b501c3fcab$6f89e0e0$0303a8c0@marc2><16446.25586.351774.46397@mccarthy.genworks.com><06ea01c3fcaf$8a86c3f0$0303a8c0@marc2><000001c400e4$86f2f770$a44d02c3@digo><000201c400e9$7eebf770$a44d02c3@digo><034601c40176$646006c0$0a04a8c0@marc2><001101c402cd$560313d0$2a4302c3@digo><011b01c40307$522928a0$0303a8c0@marc2><000101c40413$5d0ded20$d54302c3@digo><050a01c40496$d2a746c0$0303a8c0@marc2><000201c405af$c4418360$445702c3@digo> <000401c405c1$35259920$445702c3@digo> <0fbd01c406d2$dcdb60c0$0303a8c0@marc2> Message-ID: <000801c4073e$062b3c00$514d02c3@digo> Hello Marc, | A with-default-style macro which would bind the special variables, | could be used in some places to avoid this. | Or maybe I should just toss away all the *style-special-variables* and | just have a *current-style* holding an object. I think moving to a style object is the right direction. That would be more modular and less error-prone than tons of special variables. Furthermore, that would provide leverage for introducing style taxonomy: paragraph styles, character styles etc. -- Sincerely, Dmitri Ivanov lisp.ystok.ru From divanov at aha.ru Thu Mar 11 10:52:24 2004 From: divanov at aha.ru (Dmitri Ivanov) Date: Thu, 11 Mar 2004 13:52:24 +0300 Subject: [cl-typesetting-devel] Top-level layout, multi-page tables, andother contrib References: <06b501c3fcab$6f89e0e0$0303a8c0@marc2><16446.25586.351774.46397@mccarthy.genworks.com><06ea01c3fcaf$8a86c3f0$0303a8c0@marc2><000001c400e4$86f2f770$a44d02c3@digo><000201c400e9$7eebf770$a44d02c3@digo><034601c40176$646006c0$0a04a8c0@marc2><001101c402cd$560313d0$2a4302c3@digo><011b01c40307$522928a0$0303a8c0@marc2><000001c40348$5281bf60$da4d02c3@digo> <0fc101c406d3$829363a0$0303a8c0@marc2> Message-ID: <001201c40759$9d4f4c00$514d02c3@digo> Hello Marc, | I think it should work. | I renamed #'put-source-code-string to #'verbatim IMHO as matter of convenience, the put-string and verbatim functions should: - if the argument were null, do nothing; - if the argument were not a string, convert to string by means princ-to-string (or some customizable?). For completeness, NIL should not be output by default, so I suggest: (defmethod insert-stuff ((obj null)) (declare (ignore obj))) -- Sincerely, Dmitri Ivanov lisp.ystok.ru From divanov at aha.ru Fri Mar 12 05:19:45 2004 From: divanov at aha.ru (Dmitri Ivanov) Date: Fri, 12 Mar 2004 08:19:45 +0300 Subject: [cl-typesetting-devel] Top-level layout, multi-page tables, andother contrib References: <06b501c3fcab$6f89e0e0$0303a8c0@marc2><16446.25586.351774.46397@mccarthy.genworks.com><06ea01c3fcaf$8a86c3f0$0303a8c0@marc2><000001c400e4$86f2f770$a44d02c3@digo><000201c400e9$7eebf770$a44d02c3@digo><034601c40176$646006c0$0a04a8c0@marc2><001101c402cd$560313d0$2a4302c3@digo><011b01c40307$522928a0$0303a8c0@marc2><000001c40348$5281bf60$da4d02c3@digo><0fc101c406d3$829363a0$0303a8c0@marc2> <001201c40759$9d4f4c00$514d02c3@digo> Message-ID: <000901c407f5$97051090$bd4302c3@digo> Hello, | IMHO as matter of convenience, the put-string and verbatim functions | should: | - if the argument were null, do nothing; | - if the argument were not a | string, convert to string by means princ-to-string (or some | customizable?). | | For completeness, NIL should not be output by default, | so I suggest: | (defmethod insert-stuff ((obj null)) | (declare (ignore obj))) In addition to (defmethod insert-stuff ((obj symbol)) `(put-string ,obj)) or (defmethod insert-stuff ((obj symbol)) `(funcall *default-stringer* ,obj)) -- Sincerely, Dmitri Ivanov lisp.ystok.ru From marc.battyani at fractalconcept.com Fri Mar 12 22:08:32 2004 From: marc.battyani at fractalconcept.com (Marc Battyani) Date: Fri, 12 Mar 2004 23:08:32 +0100 Subject: [cl-typesetting-devel] Top-level layout, multi-page tables, andother contrib References: <06b501c3fcab$6f89e0e0$0303a8c0@marc2><16446.25586.351774.46397@mccarthy.genworks.com><06ea01c3fcaf$8a86c3f0$0303a8c0@marc2><000001c400e4$86f2f770$a44d02c3@digo><000201c400e9$7eebf770$a44d02c3@digo><034601c40176$646006c0$0a04a8c0@marc2><001101c402cd$560313d0$2a4302c3@digo><011b01c40307$522928a0$0303a8c0@marc2><000001c40348$5281bf60$da4d02c3@digo> <0fc101c406d3$829363a0$0303a8c0@marc2> <001201c40759$9d4f4c00$514d02c3@digo> Message-ID: <199f01c4087e$8f504340$0303a8c0@marc2> "Dmitri Ivanov" writes: Hi Dmitri, #| Sorry for my very late replies. I'm very interested by all this, but I still have an incredible amount of workload (this week-end, I have 2 PCB to design and 3 functionalities to add to a web application)] |# > IMHO as matter of convenience, the put-string and verbatim functions should: > - if the argument were null, do nothing; > - if the argument were not a string, convert to string by means > princ-to-string (or some customizable?). The method to transform a lisp element into some cl-typesetting representation is #'insert-stuff. #'put-string is an utility function for #'insert-stuff of a string. But insert stuff works at macro-expansion time. There is probably a need for a run time #'typeset-object generic function. > For completeness, NIL should not be output by default, so I suggest: > (defmethod insert-stuff ((obj null)) > (declare (ignore obj))) This will probably not work because obj will not be nil at compile time so the following method will be called. And this will output a nil at run time (defmethod insert-stuff ((obj symbol)) `(put-string (format nil "~a" ,obj))) #'typeset-object should be used instead of put-string (with no format). Marc From divanov at aha.ru Sat Mar 13 08:40:05 2004 From: divanov at aha.ru (Dmitri Ivanov) Date: Sat, 13 Mar 2004 11:40:05 +0300 Subject: [cl-typesetting-devel] Best way of underlining? References: <06b501c3fcab$6f89e0e0$0303a8c0@marc2><16446.25586.351774.46397@mccarthy.genworks.com><06ea01c3fcaf$8a86c3f0$0303a8c0@marc2><000001c400e4$86f2f770$a44d02c3@digo><000201c400e9$7eebf770$a44d02c3@digo><034601c40176$646006c0$0a04a8c0@marc2><001101c402cd$560313d0$2a4302c3@digo><011b01c40307$522928a0$0303a8c0@marc2><000001c40348$5281bf60$da4d02c3@digo> <0fc101c406d3$829363a0$0303a8c0@marc2> <001201c40759$9d4f4c00$514d02c3@digo> <199f01c4087e$8f504340$0303a8c0@marc2> Message-ID: <000201c408d6$f17644e0$3f4d02c3@digo> Hello, Please advise how to output characters underlined into PDF. What is the means for the form like follows? Institution Phone: ___________ Institution Fax: ___________ Sometimes the fields have to be left blank, but sometimes - filled in with text having the overal underline retained. Can hrule be used accompanied by with-offset? -- Sincerely, Dmitri Ivanov lisp.ystok.ru From marc.battyani at fractalconcept.com Sat Mar 13 13:02:04 2004 From: marc.battyani at fractalconcept.com (Marc Battyani) Date: Sat, 13 Mar 2004 14:02:04 +0100 Subject: [cl-typesetting-devel] Best way of underlining? References: <06b501c3fcab$6f89e0e0$0303a8c0@marc2><16446.25586.351774.46397@mccarthy.genworks.com><06ea01c3fcaf$8a86c3f0$0303a8c0@marc2><000001c400e4$86f2f770$a44d02c3@digo><000201c400e9$7eebf770$a44d02c3@digo><034601c40176$646006c0$0a04a8c0@marc2><001101c402cd$560313d0$2a4302c3@digo><011b01c40307$522928a0$0303a8c0@marc2><000001c40348$5281bf60$da4d02c3@digo><0fc101c406d3$829363a0$0303a8c0@marc2><001201c40759$9d4f4c00$514d02c3@digo><199f01c4087e$8f504340$0303a8c0@marc2> <000201c408d6$f17644e0$3f4d02c3@digo> Message-ID: <00fc01c408fb$62898650$0a04a8c0@marc2> "Dmitri Ivanov" writes: > Please advise how to output characters underlined into PDF. > > What is the means for the form like follows? > > Institution Phone: ___________ > Institution Fax: ___________ > > Sometimes the fields have to be left blank, but sometimes - filled in with > text having the overal underline retained. > > Can hrule be used accompanied by with-offset? No, you should use colored-box which is intended to be inlined. Marc From peter at javamonkey.com Tue Mar 16 20:28:20 2004 From: peter at javamonkey.com (Peter Seibel) Date: Tue, 16 Mar 2004 12:28:20 -0800 Subject: [cl-typesetting-devel] Portability oops Message-ID: Looks like the new top-level stuff has a dependence on some impl dependent foo. Here's a patch to get rid of it (taking a reasonable guess at what SYS::REMOVE-PROPERTIES does): -Peter Index: top-level.lisp =================================================================== --- top-level.lisp (revision 15) +++ top-level.lisp (working copy) @@ -51,6 +51,11 @@ (room-left :accessor room-left :initarg :room-left :initform 0) )) +(defun remove-properties (plist keys) + (loop for (key value) on plist by #'cddr + unless (member key keys) nconc (list key value))) + + (defun draw-pages (content &rest args &key (size *default-page-size*) (orientation *default-page-orientation*) @@ -78,7 +83,7 @@ :footer-bottom footer-bottom ;; Move room-left into initialize-instance :after? :room-left (- height top-margin bottom-margin) - (sys::remove-properties args + (remove-properties args '(:size :orientation :bounds :header-top :footer-bottom :break)))))) (when (and pdf:*page* (member break '(:before :always))) -- Peter Seibel peter at javamonkey.com Lisp is the red pill. -- John Fraser, comp.lang.lisp From marc.battyani at fractalconcept.com Tue Mar 16 21:56:37 2004 From: marc.battyani at fractalconcept.com (Marc Battyani) Date: Tue, 16 Mar 2004 22:56:37 +0100 Subject: [cl-typesetting-devel] Portability oops References: Message-ID: <05fb01c40ba1$8eac6740$0a04a8c0@marc2> "Peter Seibel" writes: > Looks like the new top-level stuff has a dependence on some impl > dependent foo. Here's a patch to get rid of it (taking a reasonable > guess at what SYS::REMOVE-PROPERTIES does): [patch...] Thanks Peter, I commited the changes to the repository. (I'm trying to find some time to play with all this by the end of the week.) Marc From divanov at aha.ru Wed Mar 17 09:24:17 2004 From: divanov at aha.ru (Dmitri Ivanov) Date: Wed, 17 Mar 2004 12:24:17 +0300 Subject: [cl-typesetting-devel] v-split failure and patch References: <06b501c3fcab$6f89e0e0$0303a8c0@marc2><16446.25586.351774.46397@mccarthy.genworks.com><06ea01c3fcaf$8a86c3f0$0303a8c0@marc2><000001c400e4$86f2f770$a44d02c3@digo><000201c400e9$7eebf770$a44d02c3@digo><034601c40176$646006c0$0a04a8c0@marc2><001101c402cd$560313d0$2a4302c3@digo><011b01c40307$522928a0$0303a8c0@marc2><000001c40348$5281bf60$da4d02c3@digo><0fc101c406d3$829363a0$0303a8c0@marc2> <001201c40759$9d4f4c00$514d02c3@digo> Message-ID: <001001c40c01$c0d5bc70$114302c3@digo> Hello, I have bumped into terrible looping bug. I am not sure that the user-drawn-box was actually the culprit but the error has been detected where user-drawn-box occurs. Please see the broken-user-box.lisp attached and the following trace. CL-USER 13 > (tt::broken-user-box 34) Table total height 511. 0 (METHOD TYPESET::STROKE (TYPESET:USER-DRAWN-BOX T T)) > ... >> TYPESET::BOX : # >> TYPESET::X : 50 >> TYPESET::Y : 35.996597623924345 0 (METHOD TYPESET::STROKE (TYPESET:USER-DRAWN-BOX T T)) < ... << VALUE-0 : " B" Error: Can't make a string of length 4194304. 1 (abort) Return to level 0. 2 Return to top loop level 0. After patching the v-split method, it returns nil as the first value and the outer draw-pages feeds a new page. The patched return-lines subfunction simply detects pathological case where the text-lines list is a one-element list consisting of the spurious text-line. Its boxes slot only includes either text-style or h-spacing (including explicit or made by make-hfill-glue) instances. -- Sincerely, Dmitri Ivanov lisp.ystok.ru -------------- next part -------------- A non-text attachment was scrubbed... Name: broken-user-box.lisp Type: application/octet-stream Size: 1687 bytes Desc: not available URL: -------------- next part -------------- A non-text attachment was scrubbed... Name: v-split-patch.diff Type: application/octet-stream Size: 4826 bytes Desc: not available URL: From divanov at aha.ru Wed Mar 17 10:10:06 2004 From: divanov at aha.ru (Dmitri Ivanov) Date: Wed, 17 Mar 2004 13:10:06 +0300 Subject: [cl-typesetting-devel] Portability oops References: Message-ID: <001101c40c27$733caa70$114302c3@digo> Hello Peter, | Looks like the new top-level stuff has a dependence on some impl | dependent foo. Here's a patch to get rid of it (taking a reasonable | guess at what SYS::REMOVE-PROPERTIES does): | ...snip...| | | +(defun remove-properties (plist keys) | + (loop for (key value) on plist by #'cddr | + unless (member key keys) nconc (list key value))) Sorry, this excerpt is from my lw-compat library: #+lispworks (eval-when (:compile-toplevel :load-toplevel :execute) (import 'system::remove-properties)) #-lispworks (defun remove-properties (plist keys) (loop for (key value) on plist by #'cddr unless (member key keys :test #'eq) nconc (list key value))) -- Sincerely, Dmitri Ivanov lisp.ystok.ru From divanov at aha.ru Mon Mar 22 11:24:35 2004 From: divanov at aha.ru (Dmitri Ivanov) Date: Mon, 22 Mar 2004 14:24:35 +0300 Subject: [cl-typesetting-devel] v-split failure and patch References: <06b501c3fcab$6f89e0e0$0303a8c0@marc2><16446.25586.351774.46397@mccarthy.genworks.com><06ea01c3fcaf$8a86c3f0$0303a8c0@marc2><000001c400e4$86f2f770$a44d02c3@digo><000201c400e9$7eebf770$a44d02c3@digo><034601c40176$646006c0$0a04a8c0@marc2><001101c402cd$560313d0$2a4302c3@digo><011b01c40307$522928a0$0303a8c0@marc2><000001c40348$5281bf60$da4d02c3@digo><0fc101c406d3$829363a0$0303a8c0@marc2><001201c40759$9d4f4c00$514d02c3@digo> <001001c40c01$c0d5bc70$114302c3@digo> <133d01c40fee$019ebd70$0a04a8c0@marc2> Message-ID: <002a01c41000$6f408400$7a4302c3@digo> Hello Marc, | OK thanks Dmitri. It's committed to the repository. (I just moved a | badly placed nreverse which was broking the single-page-example.) Agree that the nreverse is missing as a default cond clause. Sorry. -- Sincerely, Dmitri Ivanov list.ystok.ru From marc.battyani at fractalconcept.com Mon Mar 22 09:13:56 2004 From: marc.battyani at fractalconcept.com (Marc Battyani) Date: Mon, 22 Mar 2004 10:13:56 +0100 Subject: [cl-typesetting-devel] v-split failure and patch References: <06b501c3fcab$6f89e0e0$0303a8c0@marc2><16446.25586.351774.46397@mccarthy.genworks.com><06ea01c3fcaf$8a86c3f0$0303a8c0@marc2><000001c400e4$86f2f770$a44d02c3@digo><000201c400e9$7eebf770$a44d02c3@digo><034601c40176$646006c0$0a04a8c0@marc2><001101c402cd$560313d0$2a4302c3@digo><011b01c40307$522928a0$0303a8c0@marc2><000001c40348$5281bf60$da4d02c3@digo><0fc101c406d3$829363a0$0303a8c0@marc2><001201c40759$9d4f4c00$514d02c3@digo> <001001c40c01$c0d5bc70$114302c3@digo> Message-ID: <133d01c40fee$019ebd70$0a04a8c0@marc2> "Dmitri Ivanov" writes: > I have bumped into terrible looping bug. I am not sure that the > user-drawn-box was actually the culprit but the error has been detected > where user-drawn-box occurs. Please see the broken-user-box.lisp attached > and the following trace. ... > After patching the v-split method, it returns nil as the first value and the > outer draw-pages feeds a new page. The patched return-lines subfunction > simply detects pathological case where the text-lines list is a one-element > list consisting of the spurious text-line. Its boxes slot only includes > either text-style or h-spacing (including explicit or made by > make-hfill-glue) instances. OK thanks Dmitri. It's committed to the repository. (I just moved a badly placed nreverse which was broking the single-page-example.) This week I have to write some reports with cl-typesetting so I will have the opportunity to test the new functionalities :) Marc From erik at nittin.net Wed Mar 24 15:35:16 2004 From: erik at nittin.net (Erik Enge) Date: Wed, 24 Mar 2004 10:35:16 -0500 Subject: [cl-typesetting-devel] Image in upper-right corner. Message-ID: Is there any way I can make an image stick in the upper-right corner of a page regardless of how big it is? Currently, my code looks like this: (typeset:cell () (typeset:image :file #p"/somwhere.jpg" :dx 200 :dy 20)) That cell is in a row and the table has two rows which are half the size of the width of the page. Sometimes the image is 43x50 pixels and sometime its 189x26 and yet other times various sizes. Is there any way I can align it with the upper-right corner regardless of its size? The various images move around today depending on their sizes. Thanks, Erik. From divanov at aha.ru Wed Mar 24 15:54:30 2004 From: divanov at aha.ru (Dmitri Ivanov) Date: Wed, 24 Mar 2004 18:54:30 +0300 Subject: [cl-typesetting-devel] Image in upper-right corner. References: Message-ID: <005601c411bb$3bb39d40$845702c3@digo> Hello Erik, | Is there any way I can make an image stick in the upper-right corner of | a page regardless of how big it is? Currently, my code looks like this: | | (typeset:cell () | (typeset:image :file #p"/somwhere.jpg" :dx 200 :dy 20)) | | That cell is in a row and the table has two rows which are half the | size of | the width of the page. Sometimes the image is 43x50 pixels and | sometime its 189x26 and yet other times various sizes. Is there any | way I can align it | with the upper-right corner regardless of its size? The various images | move around today depending on their sizes. I would recommend tt:draw-pages with a page header containing the image. The header should be specified as function instead of being static content. -- Sincerely, Dmitri Ivanov lisp.ystok.ru From marc.battyani at fractalconcept.com Wed Mar 24 16:32:06 2004 From: marc.battyani at fractalconcept.com (Marc Battyani) Date: Wed, 24 Mar 2004 17:32:06 +0100 Subject: [cl-typesetting-devel] Image in upper-right corner. References: Message-ID: <060101c411bd$8d21f300$0a04a8c0@marc2> "Erik Enge" writes: > Is there any way I can make an image stick in the upper-right corner of > a > page regardless of how big it is? Currently, my code looks like this: > > (typeset:cell () > (typeset:image :file #p"/somwhere.jpg" :dx 200 :dy 20)) > > That cell is in a row and the table has two rows which are half the > size of > the width of the page. Sometimes the image is 43x50 pixels and sometime > its 189x26 and yet other times various sizes. Is there any way I can > align it > with the upper-right corner regardless of its size? The various images > move > around today depending on their sizes. Upper-right corner of the page or of the cell? Have you tried something like this in the cell? :hfill (image :file fractal-jpg :dx 15 :dy 15 :inline t) :vfill Marc From marc.battyani at fractalconcept.com Wed Mar 24 16:34:57 2004 From: marc.battyani at fractalconcept.com (Marc Battyani) Date: Wed, 24 Mar 2004 17:34:57 +0100 Subject: [cl-typesetting-devel] Image in upper-right corner. References: <060101c411bd$8d21f300$0a04a8c0@marc2> Message-ID: <060f01c411bd$f24ed400$0a04a8c0@marc2> "Marc Battyani" writes: > "Erik Enge" writes: > > > Is there any way I can make an image stick in the upper-right corner of > > a > > page regardless of how big it is? Currently, my code looks like this: > > > > (typeset:cell () > > (typeset:image :file #p"/somwhere.jpg" :dx 200 :dy 20)) > > > > That cell is in a row and the table has two rows which are half the > > size of > > the width of the page. Sometimes the image is 43x50 pixels and sometime > > its 189x26 and yet other times various sizes. Is there any way I can > > align it > > with the upper-right corner regardless of its size? The various images > > move > > around today depending on their sizes. > > > Upper-right corner of the page or of the cell? > Have you tried something like this in the cell? > > :hfill (image :file fractal-jpg :dx 15 :dy 15 :inline t) > :vfill Or wrapping the image in a paragraph with a :align :right style ? Marc From erik at nittin.net Wed Mar 24 17:33:13 2004 From: erik at nittin.net (Erik Enge) Date: Wed, 24 Mar 2004 12:33:13 -0500 Subject: [cl-typesetting-devel] Image in upper-right corner. In-Reply-To: <060f01c411bd$f24ed400$0a04a8c0@marc2> References: <060101c411bd$8d21f300$0a04a8c0@marc2> <060f01c411bd$f24ed400$0a04a8c0@marc2> Message-ID: <53F60E34-7DB9-11D8-A1C2-000A95CEC334@nittin.net> On Mar 24, 2004, at 11:34 AM, Marc Battyani wrote: >> Upper-right corner of the page or of the cell? Of the cell, which in this case happens to be the upper-right corner of the page too. >> :hfill (image :file fractal-jpg :dx 15 :dy 15 :inline t) >> :vfill I tried (typeset:cell () :hfill (typeset:image :file #p"/somwhere.jpg" :dx 200 :dy 20 :inline t)) Though that did not help much. Did I misunderstand? > Or wrapping the image in a paragraph with a :align :right style ? Tried that but that did not work, the image stayed in the same spot. Erik. From erik at nittin.net Wed Mar 24 17:33:45 2004 From: erik at nittin.net (Erik Enge) Date: Wed, 24 Mar 2004 12:33:45 -0500 Subject: [cl-typesetting-devel] Image in upper-right corner. In-Reply-To: <005601c411bb$3bb39d40$845702c3@digo> References: <005601c411bb$3bb39d40$845702c3@digo> Message-ID: <66AD0979-7DB9-11D8-A1C2-000A95CEC334@nittin.net> On Mar 24, 2004, at 10:54 AM, Dmitri Ivanov wrote: > I would recommend tt:draw-pages with a page header containing the > image. The > header should be specified as function instead of being static content. Would this header should up on each page? I believe I only want it on the first page. Erik. From marc.battyani at fractalconcept.com Wed Mar 24 17:46:50 2004 From: marc.battyani at fractalconcept.com (Marc Battyani) Date: Wed, 24 Mar 2004 18:46:50 +0100 Subject: [cl-typesetting-devel] Image in upper-right corner. References: <060101c411bd$8d21f300$0a04a8c0@marc2> <060f01c411bd$f24ed400$0a04a8c0@marc2> <53F60E34-7DB9-11D8-A1C2-000A95CEC334@nittin.net> Message-ID: <06c301c411c7$fdbcf600$0a04a8c0@marc2> "Erik Enge" writes: > On Mar 24, 2004, at 11:34 AM, Marc Battyani wrote: > > >> Upper-right corner of the page or of the cell? > > Of the cell, which in this case happens to be the upper-right corner of > the page too. > > >> :hfill (image :file fractal-jpg :dx 15 :dy 15 :inline t) > >> :vfill > > I tried > > (typeset:cell () > :hfill (typeset:image :file #p"/somwhere.jpg" :dx 200 :dy 20 > :inline t)) > > Though that did not help much. Did I misunderstand? > > > Or wrapping the image in a paragraph with a :align :right style ? > > Tried that but that did not work, the image stayed in the same spot. I will have a closer look at this. Marc From erik at nittin.net Wed Mar 24 18:02:29 2004 From: erik at nittin.net (Erik Enge) Date: Wed, 24 Mar 2004 13:02:29 -0500 Subject: [cl-typesetting-devel] Image in upper-right corner. In-Reply-To: <06c301c411c7$fdbcf600$0a04a8c0@marc2> References: <060101c411bd$8d21f300$0a04a8c0@marc2> <060f01c411bd$f24ed400$0a04a8c0@marc2> <53F60E34-7DB9-11D8-A1C2-000A95CEC334@nittin.net> <06c301c411c7$fdbcf600$0a04a8c0@marc2> Message-ID: <6A5189A4-7DBD-11D8-A1C2-000A95CEC334@nittin.net> On Mar 24, 2004, at 12:46 PM, Marc Battyani wrote: > I will have a closer look at this. Thanks. In the mean time I have decided I will only use same-sized images and I will have them centered (using :h-align :center in typeset:paragraph). Erik. From divanov at aha.ru Thu Mar 25 06:33:42 2004 From: divanov at aha.ru (Dmitri Ivanov) Date: Thu, 25 Mar 2004 09:33:42 +0300 Subject: [cl-typesetting-devel] Image in upper-right corner. References: <005601c411bb$3bb39d40$845702c3@digo> <66AD0979-7DB9-11D8-A1C2-000A95CEC334@nittin.net> Message-ID: <000301c4123f$0c7880c0$fd5702c3@digo> Hello Erik, |> I would recommend tt:draw-pages with a page header containing the |> image. The |> header should be specified as function instead of being static |> content. | | Would this header should up on each page? I believe I only want it on | the first page. It will. In your case, this is inappropriate. Sorry for misunderstanding. -- Sincerely, Dmitri Ivanov lisp.ystok.ru From marc.battyani at fractalconcept.com Fri Mar 26 15:02:59 2004 From: marc.battyani at fractalconcept.com (Marc Battyani) Date: Fri, 26 Mar 2004 16:02:59 +0100 Subject: [cl-typesetting-devel] Image in upper-right corner. References: <060101c411bd$8d21f300$0a04a8c0@marc2> <060f01c411bd$f24ed400$0a04a8c0@marc2> <53F60E34-7DB9-11D8-A1C2-000A95CEC334@nittin.net> Message-ID: <042001c41343$6e979160$0a04a8c0@marc2> "Erik Enge" wrote: OK i've looked at this: > I tried > > (typeset:cell () > :hfill (typeset:image :file #p"/somwhere.jpg" :dx 200 :dy 20 > :inline t)) > > Though that did not help much. Did I misunderstand? When you do this, you are left aligned by default so you will get one hfill on each side of the image so it will end up centered. > > Or wrapping the image in a paragraph with a :align :right style ? > > Tried that but that did not work, the image stayed in the same spot. Sorry it's not :align but :h-align I tried this in the single-page-example in test.lisp and for me it works: (cell (:background-color '(1 1 1)) (paragraph (:h-align :right) (image :file fractal-jpg :dx 15 :dy 15 :inline t))) Marc