From mitch at bermita.com Tue Nov 15 18:11:12 2011 From: mitch at bermita.com (Mitch Berkson) Date: Tue, 15 Nov 2011 13:11:12 -0500 Subject: [cl-pdf-devel] Conversion of TrueType fonts to afm for use by CL-PDF Message-ID: <4EC2AB40.6090302@bermita.com> I have tried two ways to convert my Garamond TrueType font to .afm. The first was using the font converter at http://fpdf.fruit-lab.de/. The second was using Dimitriy's converter ttf2pt1. When viewing a pdf document created using the Garamond.afm font produced by either of these, Adobe reader says "The font 'Garamond' contains a bad /BBox." and the text looks bad. Is there a better way to get .afm files for CL-PDF? Thanks for any help. Mitch Berkson I doubt if this is an issue, but to generate the pdf, I am using: (defun font-test (&optional (file (merge-pathnames "font-test.pdf" *dir*))) (pdf:with-document () (pdf:with-page () (let ((font-names '("Helvetica" "Times-Roman" "Garamond")) (text-str "Lorem ipsum dolor sit amet, consectetur adipiscing elit. Nam elit metus, consequat ac posuere eu, rutrum sit amet nisi. Suspendisse potenti. In consequat, massa sit amet eleifend pharetra, ligula nisl posuere elit, aliquam sagittis nibh magna eget justo. Maecenas justo risus, varius at iaculis in, pellentesque at lectus. Praesent ut tincidunt lectus.") (content)) (loop for a-font-name in font-names for i from 0 do (setf content (tt:compile-text () (tt:paragraph (:h-align 'left :font (pdf:get-font a-font-name) :font-size 12 :color (pdf:set-cymk-stroke 0.0 0.0 0.0 100.0)) (tt:verbatim (format nil "~a~%~a" a-font-name text-str))))) do (tt::draw-block content 50 (- 700 (* 100 i)) 500 500)))) (pdf:write-document file))) From archimag at gmail.com Tue Nov 15 19:20:46 2011 From: archimag at gmail.com (Andrey Moskvitin) Date: Tue, 15 Nov 2011 23:20:46 +0400 Subject: [cl-pdf-devel] Conversion of TrueType fonts to afm for use by CL-PDF In-Reply-To: <4EC2AB40.6090302@bermita.com> References: <4EC2AB40.6090302@bermita.com> Message-ID: > Is there a better way to get .afm files for CL-PDF? http://lists.common-lisp.net/pipermail/cl-pdf-devel/2006-March/001008.html Andrey From mitch at bermita.com Tue Nov 15 23:49:35 2011 From: mitch at bermita.com (Mitch Berkson) Date: Tue, 15 Nov 2011 18:49:35 -0500 Subject: [cl-pdf-devel] Conversion of TrueType fonts to afm for use by CL-PDF In-Reply-To: References: <4EC2AB40.6090302@bermita.com> Message-ID: <4EC2FA8F.1090605@bermita.com> Wow. Thanks. I've been struggling with that for quite a while. Mitch On 11/15/2011 2:20 PM, Andrey Moskvitin wrote: >> Is there a better way to get .afm files for CL-PDF? > http://lists.common-lisp.net/pipermail/cl-pdf-devel/2006-March/001008.html > > Andrey > > _______________________________________________ > cl-pdf-devel site list > cl-pdf-devel at common-lisp.net > http://common-lisp.net/mailman/listinfo/cl-pdf-devel >