From mboxrd@z Thu Jan 1 00:00:00 1970 X-Msuck: nntp://news.gmane.io/gmane.comp.tex.context/18648 Path: main.gmane.org!not-for-mail From: Stefan Wachter Newsgroups: gmane.comp.tex.context Subject: My way: Generating Small PDF Documents - more questions Date: Thu, 03 Mar 2005 10:58:14 +0100 Message-ID: <4226DFB6.4040606@gmx.de> Reply-To: mailing list for ConTeXt users NNTP-Posting-Host: main.gmane.org Mime-Version: 1.0 Content-Type: text/plain; charset=ISO-8859-1; format=flowed Content-Transfer-Encoding: quoted-printable X-Trace: sea.gmane.org 1109843815 18003 80.91.229.2 (3 Mar 2005 09:56:55 GMT) X-Complaints-To: usenet@sea.gmane.org NNTP-Posting-Date: Thu, 3 Mar 2005 09:56:55 +0000 (UTC) Original-X-From: ntg-context-bounces@ntg.nl Thu Mar 03 10:56:55 2005 Original-Received: from ronja.vet.uu.nl ([131.211.172.88] helo=ronja.ntg.nl) by ciao.gmane.org with esmtp (Exim 4.43) id 1D6n4b-00040r-1O for gctc-ntg-context-518@m.gmane.org; Thu, 03 Mar 2005 10:56:49 +0100 Original-Received: from localhost (localhost.localdomain [127.0.0.1]) by ronja.ntg.nl (Postfix) with ESMTP id E04021282C; Thu, 3 Mar 2005 11:01:46 +0100 (CET) Original-Received: from ronja.ntg.nl ([127.0.0.1]) by localhost (ronja.vet.uu.nl [127.0.0.1]) (amavisd-new, port 10024) with LMTP id 04609-02; Thu, 3 Mar 2005 11:01:46 +0100 (CET) Original-Received: from ronja.vet.uu.nl (localhost.localdomain [127.0.0.1]) by ronja.ntg.nl (Postfix) with ESMTP id DABE712825; Thu, 3 Mar 2005 10:58:30 +0100 (CET) Original-Received: from localhost (localhost.localdomain [127.0.0.1]) by ronja.ntg.nl (Postfix) with ESMTP id 9B2AC12825 for ; Thu, 3 Mar 2005 10:58:28 +0100 (CET) Original-Received: from ronja.ntg.nl ([127.0.0.1]) by localhost (ronja.vet.uu.nl [127.0.0.1]) (amavisd-new, port 10024) with LMTP id 04500-04 for ; Thu, 3 Mar 2005 10:58:25 +0100 (CET) Original-Received: from mail.gmx.net (imap.gmx.net [213.165.64.20]) by ronja.ntg.nl (Postfix) with SMTP id 463341281F for ; Thu, 3 Mar 2005 10:58:25 +0100 (CET) Original-Received: (qmail invoked by alias); 03 Mar 2005 09:58:24 -0000 Original-Received: from p54A24F30.dip.t-dialin.net (EHLO [192.168.1.33]) (84.162.79.48) by mail.gmx.net (mp014) with SMTP; 03 Mar 2005 10:58:24 +0100 X-Authenticated: #10144042 User-Agent: Mozilla/5.0 (X11; U; Linux i686; en-US; rv:1.7.3) Gecko/20040913 X-Accept-Language: en-us, en Original-To: mailing list for ConTeXt users X-Y-GMX-Trusted: 0 X-Virus-Scanned: by amavisd-new at ntg.nl X-BeenThere: ntg-context@ntg.nl X-Mailman-Version: 2.1.5 Precedence: list List-Id: mailing list for ConTeXt users List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Original-Sender: ntg-context-bounces@ntg.nl Errors-To: ntg-context-bounces@ntg.nl X-Virus-Scanned: by amavisd-new at ntg.nl X-MailScanner-From: ntg-context-bounces@ntg.nl X-MailScanner-To: gctc-ntg-context-518@m.gmane.org Xref: main.gmane.org gmane.comp.tex.context:18648 X-Report-Spam: http://spam.gmane.org/gmane.comp.tex.context:18648 Hi all, for some time I try to generate small PDF documents that have no=20 embedded fonts and do not reencoding fonts. In the meantime I was quite=20 successful and I wanted to share my insights with others. Comments are=20 welcome! I generated new ec-encoded virtual fonts for the standard Adobe fonts=20 that are based on 8a-encoded raw fonts. In other words, I used afm2tfm=20 with the TeX encoding set to ec and the postscript encoding set to 8a.=20 (See below for a batch file that does this job). Then I wrote a small=20 type script (smallpdf.tex) that defines the necessary font synonymes=20 (see below). Finally I wrote a map file (smallpdf.map) that prevents the=20 8a-encoded raw fonts from being embedded or reencoded (see below). After all these preparations I can now generate PDF documents that use=20 the builtin fonts. The following example generates a PDF document that=20 is only 3389 bytes long whereas the corresponding document with=20 embedding and reencoding is 112966 bytes long! Of course these numbers=20 are not representative because the document contains only a few lines of=20 text but uses 12 different fonts. Finally two issues remain: 1. In which situations is the call of "\usetypescript[adobekb][ec]"=20 necessary. I had the impression that it is only needed if the document=20 contains characters that are not containted in the builtin fonts. 2. I would also like to use the builtin symbol character sets Zapf=20 Dingbats and Zapf Chancery. Adam Lindsay already showed how Zapf=20 Dingbats can be used without embedding (cf.=20 http://homepage.mac.com/atl/tex/). But is there also a possibility to=20 use it without reencoding? Thanks for your attention, --Stefan Test document =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D \enableregime[il1] \setupencoding[default=3Dec] \setupoutput[pdftex] \pdfoptionpdfminorversion 4 \usetypescriptfile[smallpdf.tex] \usetypescript[adobekb][ec] % Seems to be necessary to access characters=20 that are not contained in the builtin fonts. \usetypescript[postscript][ec] \setupbodyfont[postscript,sans,20pt] \mainlanguage[de] \setupheadertexts[] \def\Show{This is a test. \quotedblbase =E4=F6=FC=DF=C4=D6=DC\quotedbllef= t} \def\ShowVariants{\Show\par{\bf\Show}\par{\it\Show}\par{\bi\Show}\par} \starttext\pdfmapfile{+smallpdf.map} {\ss Helvetica\par\ShowVariants} {\rm Times-Roman\par\ShowVariants} {\tt Courier\par\ShowVariants} \stoptext Batch file for generating the fonts =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D # 1: directory that contains the afm-files. # 2: font vendor (eg. adobe) # 3: font collection (eg. times, helvetic, or courier) if [ $# -ne 3 ] ; then echo "Usage: $0 " 1>&2 exit 1 fi vfDir=3Dfonts/vf/$2/$3/ tfmDir=3Dfonts/tfm/$2/$3/ mapDir=3Dfonts/map/pdftex/context/ mapFile=3D8a-$2-$3.map rm $mapFile for datei in `find $1/$2/$3 -name "*.afm"` ; do name=3D`basename $datei .afm` echo processing $name afm2tfm $name -v ec-$name -t ec.enc -p 8a.enc 8a-raw-$name >> $mapFil= e vptovf ec-$name.vpl ec-$name.vf ec-$name.tfm done mkdir -p $vfDir $tfmDir $mapDir mv *.vf $vfDir mv *.tfm $tfmDir rm *.vpl mv *.map $mapDir smallpdf.tex =3D=3D=3D=3D=3D=3D=3D=3D=3D % Use of virtual fonts that are based on 8a encoded fonts. \starttypescript [sans] [helvetica] [texnansi,ec,8r] \definefontsynonym [Helvetica] [\typefaceencoding-phvr8a]=20 [encoding=3D\typefaceencoding] \definefontsynonym [Helvetica-Bold] [\typefaceencoding-phvb8a]=20 [encoding=3D\typefaceencoding] \definefontsynonym [Helvetica-BoldOblique]=20 [\typefaceencoding-phvbo8a][encoding=3D\typefaceencoding] \definefontsynonym [Helvetica-Oblique] =20 [\typefaceencoding-phvro8a][encoding=3D\typefaceencoding] \stoptypescript \starttypescript [serif] [times] [texnansi,ec,8r] \definefontsynonym [Times-Roman] [\typefaceencoding-ptmr8a]=20 [encoding=3D\typefaceencoding] \definefontsynonym [Times-Bold] [\typefaceencoding-ptmb8a]=20 [encoding=3D\typefaceencoding] \definefontsynonym [Times-BoldItalic]=20 [\typefaceencoding-ptmbi8a][encoding=3D\typefaceencoding] \definefontsynonym [Times-Italic] =20 [\typefaceencoding-ptmri8a][encoding=3D\typefaceencoding] \stoptypescript \starttypescript [mono] [courier] [texnansi,ec,8r] \definefontsynonym [Courier] [\typefaceencoding-pcrr8a]=20 [encoding=3D\typefaceencoding] \definefontsynonym [Courier-Bold] [\typefaceencoding-pcrb8a]=20 [encoding=3D\typefaceencoding] \definefontsynonym [Courier-BoldOblique]=20 [\typefaceencoding-pcrbo8a][encoding=3D\typefaceencoding] \definefontsynonym [Courier-Oblique] =20 [\typefaceencoding-pcrro8a][encoding=3D\typefaceencoding] \stoptypescript smallpdf.map =3D=3D=3D=3D=3D=3D=3D=3D=3D 8a-raw-phvr8a Helvetica 8a-raw-phvb8a Helvetica-Bold 8a-raw-phvbo8a Helvetica-BoldOblique 8a-raw-phvro8a Helvetica-Oblique 8a-raw-ptmr8a Times-Roman 8a-raw-ptmb8a Times-Bold 8a-raw-ptmbi8a Times-BoldItalic 8a-raw-ptmri8a Times-Italic 8a-raw-pcrr8a Courier 8a-raw-pcrb8a Courier-Bold 8a-raw-pcrbo8a Courier-BoldOblique 8a-raw-pcrro8a Courier-Oblique