From divanov at aha.ru Fri Sep 7 05:25:21 2007 From: divanov at aha.ru (Dmitriy Ivanov) Date: Fri, 7 Sep 2007 09:25:21 +0400 Subject: [cl-pdf-devel] Re: [cl-typesetting-devel] Unicode? References: <46E06EF8.8030309@gigamonkeys.com> Message-ID: <000001c7f10f$894bacf0$8100a8c0@digo> Hello Peter, | I've got this simple test program which, as you can see, attempts to | use one of the LatinModern unicode fonts and tries to render some text | that contains a unicode emdash (code-point #x2014). | | (defpackage :foo (:use :cl :cl-pdf)) | | (in-package :foo) | | (defun test-unicode (&optional (file #P"foo.pdf")) | (pdf:with-document () | (pdf:with-page () | (pdf:with-outline-level ("Example" | (pdf:register-page-reference)) (let ((font (pdf:get-font | "LMRoman12-Regular"))) (pdf:in-text-mode | (pdf:set-font font 14.0) | (pdf:move-text 100 800) | (pdf:draw-text | (format nil "This ~c is a test." (code-char #x2014))))))) | (pdf:write-document file) | file)) | | | When I run this function in generates a file without error but the | emdash is nowhere to be seen. Is this a problem with the font (which | was loaded from an .afm file not a .ufm) or with cl-pdf or with | something I'm doing wrong? First, I believe that is a cl-pdf-devel question, not cl-typesetting-devel :-) Second, if LatinModern were a custom single-byte encoding font, I would suggest to map the Unicode char code to the code belonging [0-255] range as follows: (defmethod get-char-metrics ((code (eql #x2014)) font (encoding custom-encoding)) (aref (characters font) #x96)) (defmethod get-char-metrics ((char (eql #.(code-char #x2014))) font (encoding custom-encoding)) (aref (characters font) #x96)) I cannot say for Unicode fonts as I do not use ufm-files in production :-( -- Sincerely, Dmitriy Ivanov lisp.ystok.ru From attila.lendvai at gmail.com Fri Sep 7 09:18:05 2007 From: attila.lendvai at gmail.com (Attila Lendvai) Date: Fri, 7 Sep 2007 11:18:05 +0200 Subject: [cl-pdf-devel] Re: [cl-typesetting-devel] Unicode? In-Reply-To: <000001c7f10f$894bacf0$8100a8c0@digo> References: <46E06EF8.8030309@gigamonkeys.com> <000001c7f10f$894bacf0$8100a8c0@digo> Message-ID: > | I've got this simple test program which, as you can see, attempts to > | use one of the LatinModern unicode fonts and tries to render some text > | that contains a unicode emdash (code-point #x2014). i'm not sure if this issue is still there, or if it's related but i was having a long headache once because of this, so i share it here again: you must bind (pdf::*compress-streams* nil) to disable compression because salza (the zlib cl-pdf uses) screws up the encoding silently. and this only happened when then resulting pdf was bigger then a certain size (300 bytes?) because otherwise it was not compressed and the unicode text was fine. a cleanup of cl-pdf/typesetting to use binary streams should fix this. i would suggest using babel which is a nice cross-platform encoding lib: http://common-lisp.net/~loliveira/darcs/babel/ hth, -- attila From peter at gigamonkeys.com Sat Sep 8 02:47:08 2007 From: peter at gigamonkeys.com (Peter Seibel) Date: Fri, 07 Sep 2007 19:47:08 -0700 Subject: [cl-pdf-devel] Re: [cl-typesetting-devel] Unicode? In-Reply-To: <000001c7f10f$894bacf0$8100a8c0@digo> References: <46E06EF8.8030309@gigamonkeys.com> <000001c7f10f$894bacf0$8100a8c0@digo> Message-ID: <46E20D2C.4040606@gigamonkeys.com> Dmitriy Ivanov wrote: > Hello Peter, > > | I've got this simple test program which, as you can see, attempts to > | use one of the LatinModern unicode fonts and tries to render some text > | that contains a unicode emdash (code-point #x2014). > | > | (defpackage :foo (:use :cl :cl-pdf)) > | > | (in-package :foo) > | > | (defun test-unicode (&optional (file #P"foo.pdf")) > | (pdf:with-document () > | (pdf:with-page () > | (pdf:with-outline-level ("Example" > | (pdf:register-page-reference)) (let ((font (pdf:get-font > | "LMRoman12-Regular"))) (pdf:in-text-mode > | (pdf:set-font font 14.0) > | (pdf:move-text 100 800) > | (pdf:draw-text > | (format nil "This ~c is a test." (code-char #x2014))))))) > | (pdf:write-document file) > | file)) > | > | > | When I run this function in generates a file without error but the > | emdash is nowhere to be seen. Is this a problem with the font (which > | was loaded from an .afm file not a .ufm) or with cl-pdf or with > | something I'm doing wrong? > > First, I believe that is a cl-pdf-devel question, not cl-typesetting-devel > :-) Hmmmm, I thought the lists had been collapsed into a single list. Guess I misremembered. Anyway, after some more investigation, I think the problem goes much deeper than just a font metric issue. I looked at the PDF file generated when I made the text was (format nil "A~cB" (code-char #x2014). In the PDF there's a: (A?B) Tj where the ? is actually the character #x14, i.e. the bottom byte of the #x2014 character. It conceivable that through some proper manipulation of external-formats somewhere I could fix that but it wouldn't help because, as far as I understand the PDF spec, (...) strings can only contain ASCII characters. There is obviously some way to include Unicode text (uncoded in UTF-16BE, I believe) in PDFs but it's much more involved than just throwing some text between ()'s. I think the relevant sections of the PDF spec may be 5.6 Composite Fonts and following. -Peter -- Peter Seibel : peter at gigamonkeys.com A Billion Monkeys Can't be Wrong : http://www.gigamonkeys.com/blog/ Practical Common Lisp : http://www.gigamonkeys.com/book/ Coders at Work : http://www.codersatwork.com/ From marc.battyani at fractalconcept.com Sat Sep 8 10:57:51 2007 From: marc.battyani at fractalconcept.com (Marc Battyani) Date: Sat, 08 Sep 2007 12:57:51 +0200 Subject: [cl-pdf-devel] Re: [cl-typesetting-devel] Unicode? In-Reply-To: <46E20D2C.4040606@gigamonkeys.com> References: <46E06EF8.8030309@gigamonkeys.com> <000001c7f10f$894bacf0$8100a8c0@digo> <46E20D2C.4040606@gigamonkeys.com> Message-ID: <46E2802F.5050507@fractalconcept.com> Peter Seibel wrote: [...] > Anyway, after some more investigation, I think the problem goes much > deeper than just a font metric issue. I looked at the PDF file > generated when I made the text was (format nil "A~cB" (code-char > #x2014). In the PDF there's a: > > (A?B) Tj > > where the ? is actually the character #x14, i.e. the bottom byte of > the #x2014 character. It conceivable that through some proper > manipulation of external-formats somewhere I could fix that but it > wouldn't help because, as far as I understand the PDF spec, (...) > strings can only contain ASCII characters. There is obviously some way > to include Unicode text (uncoded in UTF-16BE, I believe) in PDFs but > it's much more involved than just throwing some text between ()'s. I > think the relevant sections of the PDF spec may be 5.6 Composite Fonts > and following. I'm just catching up. So do you still have the problem? If that's the case, I will have a look at it this WE. Marc From peter at gigamonkeys.com Sat Sep 8 15:16:22 2007 From: peter at gigamonkeys.com (Peter Seibel) Date: Sat, 08 Sep 2007 08:16:22 -0700 Subject: [cl-pdf-devel] Re: [cl-typesetting-devel] Unicode? In-Reply-To: <46E2802F.5050507@fractalconcept.com> References: <46E06EF8.8030309@gigamonkeys.com> <000001c7f10f$894bacf0$8100a8c0@digo> <46E20D2C.4040606@gigamonkeys.com> <46E2802F.5050507@fractalconcept.com> Message-ID: <46E2BCC6.1010803@gigamonkeys.com> Marc Battyani wrote: > > Peter Seibel wrote: > > [...] >> Anyway, after some more investigation, I think the problem goes much >> deeper than just a font metric issue. I looked at the PDF file >> generated when I made the text was (format nil "A~cB" (code-char >> #x2014). In the PDF there's a: >> >> (A?B) Tj >> >> where the ? is actually the character #x14, i.e. the bottom byte of >> the #x2014 character. It conceivable that through some proper >> manipulation of external-formats somewhere I could fix that but it >> wouldn't help because, as far as I understand the PDF spec, (...) >> strings can only contain ASCII characters. There is obviously some way >> to include Unicode text (uncoded in UTF-16BE, I believe) in PDFs but >> it's much more involved than just throwing some text between ()'s. I >> think the relevant sections of the PDF spec may be 5.6 Composite Fonts >> and following. > I'm just catching up. So do you still have the problem? If that's the > case, I will have a look at it this WE. Yes, as far as I can tell some moderately significant surgery needs to be done to really support arbitrary Unicode characters. For another test case, you can use: (pdf:draw-text (format nil "~c~c" (code-char #x6e05) (code-char #x6167))) Which are the two Chinese characters you can see on this web page: -Peter -- Peter Seibel : peter at gigamonkeys.com A Billion Monkeys Can't be Wrong : http://www.gigamonkeys.com/blog/ Practical Common Lisp : http://www.gigamonkeys.com/book/ Coders at Work : http://www.codersatwork.com/ From divanov at aha.ru Sun Sep 9 09:12:05 2007 From: divanov at aha.ru (Dmitriy Ivanov) Date: Sun, 9 Sep 2007 13:12:05 +0400 Subject: [cl-pdf-devel] Re: [cl-typesetting-devel] Unicode? References: <46E06EF8.8030309@gigamonkeys.com><000001c7f10f$894bacf0$8100a8c0@digo> <46E20D2C.4040606@gigamonkeys.com> Message-ID: <000001c7f2c1$899c4bc0$8100a8c0@digo> Hello Peter, | Anyway, after some more investigation, I think the problem goes much | deeper than just a font metric issue. I looked at the PDF file | generated when I made the text was (format nil "A~cB" (code-char | #x2014). In the PDF there's a: | | (A?B) Tj | | where the ? is actually the character #x14, i.e. the bottom byte of the | #x2014 character... What you see is actually depends on the viewer or editor you are using to browse the PDF file. | ... It conceivable that through some proper manipulation | of external-formats somewhere I could fix that but it wouldn't help | because, as far as I understand the PDF spec, (...) strings can only | contain ASCII characters. There is obviously some way to include | Unicode text (uncoded in UTF-16BE, I believe) in PDFs but it's much | more involved than just throwing some text between ()'s.... Not exactly. The text strings used outside content streams can only contain characters in PDFDocEncoding or UNICODE. Literal strings enclosed in (...) in content streams can contain arbitrary characters and even escape sequences. | I think the relevant sections of the PDF spec may be 5.6 Composite | Fonts and following. Yes, but this section is rather tough to dig into :-( -- Sincerely, Dmitriy Ivanov lisp.ystok.ru From marc.battyani at fractalconcept.com Sun Sep 9 19:39:54 2007 From: marc.battyani at fractalconcept.com (Marc Battyani) Date: Sun, 09 Sep 2007 21:39:54 +0200 Subject: [cl-pdf-devel] Re: [cl-typesetting-devel] Unicode? In-Reply-To: <46E44985.2080205@fractalconcept.com> References: <46E06EF8.8030309@gigamonkeys.com> <000001c7f10f$894bacf0$8100a8c0@digo> <46E20D2C.4040606@gigamonkeys.com> <46E2802F.5050507@fractalconcept.com> <46E2BCC6.1010803@gigamonkeys.com> <46E44985.2080205@fractalconcept.com> Message-ID: <46E44C0A.4010208@fractalconcept.com> Peter Seibel wrote: > > Yes, as far as I can tell some moderately significant surgery needs to > > be done to really support arbitrary Unicode characters. For another > > test case, you can use: > > > > (pdf:draw-text (format nil "~c~c" (code-char #x6e05) (code-char > > #x6167))) > > > > Which are the two Chinese characters you can see on this web page: > > > > > I just tried the unicode-hello in test.lisp and it seems to work well on LWW5.02: > > (pdf:load-ttu-font #P"d:/tmp/times.ufm" #P"C:/WINDOWS/Fonts/times.ttf") > # > >(defparameter *unicode-test-string* (map unicode-string-type 'code-char > '(8252 8319 8359 8592 8593 8594 8595 8596 8597 8616 915 920 934 945 948 949 963 964 966 32 9554 9555 9556 9557 9558 9559 9560 9561 9562 9563 9564 9565 9566 9567 32 65 9568 9650 9658 9660 9668 9675 9688 9689 8364 1027 8218 402 8222 8230 8224 8225 32 66 372 373 374 375 383 506 507 508 509 510 511 903 913 914 916 917 918 919 921 922 923 32 946 947 950 951 952 953 954 955 956 957 958 1101 1102 1103 1105 1106 1107 1108 32 1475 1488 1489 1490 1491 1492 1493 64304 64305 64306 64307 64308 64309 32 7911 7912 7913 7914 7915 7916 7917 7918 1179 1180 1181 1186 1187 1198 1199 1200 32 #x6e05 #x6167))) *unicode-test-string* > > (defun unicode-hello (&optional (file #P"/tmp/hello-u.pdf")) > (pdf:with-document () (pdf:with-page () (pdf:with-outline-level ("Unicode Example" (pdf:register-page-reference)) (pdf:set-line-width 0.1) (let ((content (compile-text () (vspace 100) (paragraph (:h-align :center :font "Helvetica-Bold" :font-size 50 :color '(0.0 0 0.8)) "cl-typesetting" :eol (vspace 2) (hrule :dy 1) (with-style (:font "Times-Italic" :font-size 26) "The cool Common Lisp typesetting system") (vspace 50) (with-style (:font "TimesNewRomanPSMT" :font-size 36) (put-string *unicode-test-string*)))))) (draw-block content 20 800 545 700)))) (pdf:write-document file))) unicode-hello > > (unicode-hello) > nil The generated pdf looks ok for me in acrobat. I can send it to you if you want. (too big for the list, it just bounced) Have you tried this example? Marc From peter at gigamonkeys.com Mon Sep 10 19:31:34 2007 From: peter at gigamonkeys.com (Peter Seibel) Date: Mon, 10 Sep 2007 12:31:34 -0700 Subject: [cl-pdf-devel] Re: [cl-typesetting-devel] Unicode? In-Reply-To: <46E44C0A.4010208@fractalconcept.com> References: <46E06EF8.8030309@gigamonkeys.com> <000001c7f10f$894bacf0$8100a8c0@digo> <46E20D2C.4040606@gigamonkeys.com> <46E2802F.5050507@fractalconcept.com> <46E2BCC6.1010803@gigamonkeys.com> <46E44985.2080205@fractalconcept.com> <46E44C0A.4010208@fractalconcept.com> Message-ID: <46E59B96.1030807@gigamonkeys.com> Marc Battyani wrote: > The generated pdf looks ok for me in acrobat. I can send it to you if you want. (too big for the list, it just bounced) I think I got a copy though since you sent it to me and the list. > Have you tried this example? I haven't. I'll play around some more. -Peter -- Peter Seibel : peter at gigamonkeys.com A Billion Monkeys Can't be Wrong : http://www.gigamonkeys.com/blog/ Practical Common Lisp : http://www.gigamonkeys.com/book/ Coders at Work : http://www.codersatwork.com/ From peter at gigamonkeys.com Mon Sep 10 20:20:36 2007 From: peter at gigamonkeys.com (Peter Seibel) Date: Mon, 10 Sep 2007 13:20:36 -0700 Subject: [cl-pdf-devel] Re: [cl-typesetting-devel] Unicode? In-Reply-To: <46E59B96.1030807@gigamonkeys.com> References: <46E06EF8.8030309@gigamonkeys.com> <000001c7f10f$894bacf0$8100a8c0@digo> <46E20D2C.4040606@gigamonkeys.com> <46E2802F.5050507@fractalconcept.com> <46E2BCC6.1010803@gigamonkeys.com> <46E44985.2080205@fractalconcept.com> <46E44C0A.4010208@fractalconcept.com> <46E59B96.1030807@gigamonkeys.com> Message-ID: <46E5A714.2040200@gigamonkeys.com> Peter Seibel wrote: > Marc Battyani wrote: > >> The generated pdf looks ok for me in acrobat. I can send it to you if >> you want. (too big for the list, it just bounced) > > I think I got a copy though since you sent it to me and the list. > >> Have you tried this example? > > I haven't. I'll play around some more. Okay, I can't get unicode-hello to work on Allegro 8.1 on GNU/Linux with any Unicode fonts I have. Perhaps I'm generating bad .ufm files? (I tried to build your special ttf2ufm program Marc but couldn't figure out how so used another one I found on the web.) Maybe to remove at least one variable we can use the same font. I just tried with Gentium, a free Unicode font which you can get here: http://scripts.sil.org/cms/scripts/page.php?site_id=nrsi&item_id=Gentium_download Whenever I use Gentium in the place of TimesNewRomanPSMT I get this error, even when I set the *unicode-test-string* to something as simple as "abc". Index(s) to array function is/are out of the range of the array. [Condition of type TYPE-ERROR] Restarts: 0: [ABORT] Return to SLIME's top level. 1: [ABORT] Abort entirely from this (lisp) process. Backtrace: 0: (SWANK:SWANK-DEBUGGER-HOOK # #) 1: (ERROR TYPE-ERROR :DATUM NIL :EXPECTED-TYPE FIXNUM :FORMAT-CONTROL "Index(s) to array function is/are out of the range of the array." :FORMAT-ARGUMENTS (NIL)) 2: ((METHOD PDF::GET-CHAR-METRICS (T T T)) #\I # #) 3: (PDF:GET-KERNING #\I #\a # 36) 4: (PUT-STRING "abc") 5: (UNICODE-HELLO) -Peter -- Peter Seibel : peter at gigamonkeys.com A Billion Monkeys Can't be Wrong : http://www.gigamonkeys.com/blog/ Practical Common Lisp : http://www.gigamonkeys.com/book/ Coders at Work : http://www.codersatwork.com/ From peter at gigamonkeys.com Mon Sep 10 21:01:08 2007 From: peter at gigamonkeys.com (Peter Seibel) Date: Mon, 10 Sep 2007 14:01:08 -0700 Subject: [cl-pdf-devel] Re: [cl-typesetting-devel] Unicode? In-Reply-To: <46E5A714.2040200@gigamonkeys.com> References: <46E06EF8.8030309@gigamonkeys.com> <000001c7f10f$894bacf0$8100a8c0@digo> <46E20D2C.4040606@gigamonkeys.com> <46E2802F.5050507@fractalconcept.com> <46E2BCC6.1010803@gigamonkeys.com> <46E44985.2080205@fractalconcept.com> <46E44C0A.4010208@fractalconcept.com> <46E59B96.1030807@gigamonkeys.com> <46E5A714.2040200@gigamonkeys.com> Message-ID: <46E5B094.9020707@gigamonkeys.com> Peter Seibel wrote: > I tried to build your special ttf2ufm program Marc but couldn't > figure out how so used another one I found on the web. Here's the one I used: http://wxcode.sourceforge.net/docs/wxpdfdoc/makefont.html -Peter -- Peter Seibel : peter at gigamonkeys.com A Billion Monkeys Can't be Wrong : http://www.gigamonkeys.com/blog/ Practical Common Lisp : http://www.gigamonkeys.com/book/ Coders at Work : http://www.codersatwork.com/ From marc.battyani at fractalconcept.com Mon Sep 10 22:15:50 2007 From: marc.battyani at fractalconcept.com (Marc Battyani) Date: Tue, 11 Sep 2007 00:15:50 +0200 Subject: [cl-pdf-devel] Re: [cl-typesetting-devel] Unicode? In-Reply-To: <46E5A714.2040200@gigamonkeys.com> References: <46E06EF8.8030309@gigamonkeys.com> <000001c7f10f$894bacf0$8100a8c0@digo> <46E20D2C.4040606@gigamonkeys.com> <46E2802F.5050507@fractalconcept.com> <46E2BCC6.1010803@gigamonkeys.com> <46E44985.2080205@fractalconcept.com> <46E44C0A.4010208@fractalconcept.com> <46E59B96.1030807@gigamonkeys.com> <46E5A714.2040200@gigamonkeys.com> Message-ID: <46E5C216.9010905@fractalconcept.com> Peter Seibel wrote: > Okay, I can't get unicode-hello to work on Allegro 8.1 on GNU/Linux > with any Unicode fonts I have. Perhaps I'm generating bad .ufm files? > (I tried to build your special ttf2ufm program Marc but couldn't > figure out how so used another one I found on the web.) Maybe to > remove at least one variable we can use the same font. I just tried > with Gentium, a free Unicode font which you can get here: > > http://scripts.sil.org/cms/scripts/page.php?site_id=nrsi&item_id=Gentium_download > > > Whenever I use Gentium in the place of TimesNewRomanPSMT I get this > error, even when I set the *unicode-test-string* to something as > simple as "abc". OK I downloaded it and it works for me with LWW5. (Windows) I will send you the pdf and the ufm off-list. TYPESET 27 > (pdf:load-ttu-font #P"d:/tmp/gentium102/GenAI102.ufm" #P"d:/tmp/gentium102/GenAI102.ttf") # TYPESET 28 > (defparameter *unicode-test-string* (map unicode-string-type 'code-char '(382 65 124 250 251 252 253))) *unicode-test-string* TYPESET 29 > (defun unicode-hello (&optional (file #P"d:/tmp/hello-u.pdf")) (pdf:with-document () (pdf:with-page () (pdf:with-outline-level ("Unicode Example" (pdf:register-page-reference)) (pdf:set-line-width 0.1) (let ((content (compile-text () (vspace 100) (paragraph (:h-align :center :font "Helvetica-Bold" :font-size 50 :color '(0.0 0 0.8)) "cl-typesetting" :eol (vspace 2) (hrule :dy 1) (with-style (:font "Times-Italic" :font-size 26) "The cool Common Lisp typesetting system") (vspace 50) (with-style (:font "GentiumAlt-Italic" :font-size 72) (put-string *unicode-test-string*)))))) (draw-block content 20 800 545 700)))) (pdf:write-document file))) unicode-hello TYPESET 30 > (unicode-hello) nil Marc From peter at gigamonkeys.com Tue Sep 11 19:52:42 2007 From: peter at gigamonkeys.com (Peter Seibel) Date: Tue, 11 Sep 2007 12:52:42 -0700 Subject: [cl-pdf-devel] Re: [cl-typesetting-devel] Unicode? In-Reply-To: <46E5C216.9010905@fractalconcept.com> References: <46E06EF8.8030309@gigamonkeys.com> <000001c7f10f$894bacf0$8100a8c0@digo> <46E20D2C.4040606@gigamonkeys.com> <46E2802F.5050507@fractalconcept.com> <46E2BCC6.1010803@gigamonkeys.com> <46E44985.2080205@fractalconcept.com> <46E44C0A.4010208@fractalconcept.com> <46E59B96.1030807@gigamonkeys.com> <46E5A714.2040200@gigamonkeys.com> <46E5C216.9010905@fractalconcept.com> Message-ID: <46E6F20A.2020107@gigamonkeys.com> Marc Battyani wrote: > Peter Seibel wrote: >> Okay, I can't get unicode-hello to work on Allegro 8.1 on GNU/Linux >> with any Unicode fonts I have. Perhaps I'm generating bad .ufm files? >> (I tried to build your special ttf2ufm program Marc but couldn't >> figure out how so used another one I found on the web.) Maybe to >> remove at least one variable we can use the same font. I just tried >> with Gentium, a free Unicode font which you can get here: >> >> http://scripts.sil.org/cms/scripts/page.php?site_id=nrsi&item_id=Gentium_download >> >> >> Whenever I use Gentium in the place of TimesNewRomanPSMT I get this >> error, even when I set the *unicode-test-string* to something as >> simple as "abc". > > OK I downloaded it and it works for me with LWW5. (Windows) > I will send you the pdf and the ufm off-list. > > TYPESET 27 > (pdf:load-ttu-font #P"d:/tmp/gentium102/GenAI102.ufm" > #P"d:/tmp/gentium102/GenAI102.ttf") > # Okay, so I figured out how to compile your version of ttf2pt1 (I just needed to chmod +x the unhtml script to get the make to complete) and now have things more or less working. One mystery still remaining is that when I generate PDFs using Cochin, the font I got from my Mac and converted from .dfont to .ttf using fontforge, it works except when I render the string "hello, world!" it comes out as "helloworld". Strange. But it works fine using Gentium with .ufm files produced with your ttf2pt1. So I'm going to assume something went awry with fontforge. Using Gentium I still have two problems. One is when I try to include the characters U+6e05 and U+6167 (Chinese characters) it succeeds in rendering but the characters are not displayed. Is that becauseGentium doesn't support those characters? And finally, when I try to run unicode-hello using Gentium on the full *unicode-test-string* I get this error. Index(s) to array function is/are out of the range of the array. [Condition of type TYPE-ERROR] Restarts: 0: [ABORT] Return to SLIME's top level. 1: [ABORT] Abort entirely from this (lisp) process. Backtrace: 0: (SWANK:SWANK-DEBUGGER-HOOK # #) 1: (ERROR TYPE-ERROR :DATUM NIL :EXPECTED-TYPE FIXNUM :FORMAT-CONTROL "Index(s) to array function is/are out of the range of the array." :FORMAT-ARGUMENTS (NIL)) 2: ((METHOD PDF::GET-CHAR-METRICS (T T T)) #\? # #) 3: (PDF:GET-KERNING #\? #\? # 36) 4: (PUT-STRING "??????????????????? ?????????????? A???????????????? B????????????????????? ?????????????????? ????????????? ???????????????? ") 5: (UNICODE-HELLO "Gentium") -Peter -- Peter Seibel : peter at gigamonkeys.com A Billion Monkeys Can't be Wrong : http://www.gigamonkeys.com/blog/ Practical Common Lisp : http://www.gigamonkeys.com/book/ Coders at Work : http://www.codersatwork.com/ -------------- next part -------------- An embedded and charset-unspecified text was scrubbed... Name: GenAI102.ufm.MINE URL: From peter at gigamonkeys.com Tue Sep 11 20:10:28 2007 From: peter at gigamonkeys.com (Peter Seibel) Date: Tue, 11 Sep 2007 13:10:28 -0700 Subject: [cl-pdf-devel] Re: [cl-typesetting-devel] Unicode? In-Reply-To: <46E6F20A.2020107@gigamonkeys.com> References: <46E06EF8.8030309@gigamonkeys.com> <000001c7f10f$894bacf0$8100a8c0@digo> <46E20D2C.4040606@gigamonkeys.com> <46E2802F.5050507@fractalconcept.com> <46E2BCC6.1010803@gigamonkeys.com> <46E44985.2080205@fractalconcept.com> <46E44C0A.4010208@fractalconcept.com> <46E59B96.1030807@gigamonkeys.com> <46E5A714.2040200@gigamonkeys.com> <46E5C216.9010905@fractalconcept.com> <46E6F20A.2020107@gigamonkeys.com> Message-ID: <46E6F634.20704@gigamonkeys.com> Peter Seibel wrote: > Using Gentium I still have two problems. One is when I try to include > the characters U+6e05 and U+6167 (Chinese characters) it succeeds in > rendering but the characters are not displayed. Is that becauseGentium > doesn't support those characters? So that must be it because I got these characters properly rendered using a Chinese font I got off the web. Now the only thing I don't know is how non-Chinese characters get rendered when using a Chinese font. Do Chinese fonts typically provide glyphs for latin characters as well? If so, it might be nice to have a way (maybe in cl-typesetting rather than cl-pdf) to define a list of fonts that will be tried in order so I can have a block of text that is set primarily in, say, Gentium, but which will fall back to HanWangMingMedium for any Chinese characters for which Gentium doesn't provide a glyph. Would that be possible--i.e. can cl-pdf/cl-typesetting tell when there's no glyph for a codepoint? -Peter -- Peter Seibel : peter at gigamonkeys.com A Billion Monkeys Can't be Wrong : http://www.gigamonkeys.com/blog/ Practical Common Lisp : http://www.gigamonkeys.com/book/ Coders at Work : http://www.codersatwork.com/ From peter at gigamonkeys.com Tue Sep 11 20:22:46 2007 From: peter at gigamonkeys.com (Peter Seibel) Date: Tue, 11 Sep 2007 13:22:46 -0700 Subject: [cl-pdf-devel] Fonts? Message-ID: <46E6F916.8020000@gigamonkeys.com> I'm sorry I'm such a typographical illiterate; this may be a silly question but here goes: can cl-pdf use OpenType fonts? I really don't understand how all the different styles of fonts relate to each other .ttf vs .dfont vs PostScript vs OpenType. I vaguely understand that some of these are packaging technologies for the others but I can't keep track which are which. -Peter -- Peter Seibel : peter at gigamonkeys.com A Billion Monkeys Can't be Wrong : http://www.gigamonkeys.com/blog/ Practical Common Lisp : http://www.gigamonkeys.com/book/ Coders at Work : http://www.codersatwork.com/