t[merge] - plan9port - [fork] Plan 9 from user space
 (HTM) git clone git://src.adamsgaard.dk/plan9port
 (DIR) Log
 (DIR) Files
 (DIR) Refs
 (DIR) README
 (DIR) LICENSE
       ---
 (DIR) commit 2af649f94c2a0366a9d58411013dc10c1ff5bb9f
 (DIR) parent 1f74e1b758cabeb095c4325e890fad774196b10b
 (HTM) Author: Russ Cox <rsc@swtch.com>
       Date:   Thu, 10 Jul 2008 00:24:04 -0400
       
       t[merge]
       
       Diffstat:
         M dist/troff/afm2troff.c              |       8 +++++++-
         M dist/troff/tfont                    |       9 ++++++---
       
       2 files changed, 13 insertions(+), 4 deletions(-)
       ---
 (DIR) diff --git a/dist/troff/afm2troff.c b/dist/troff/afm2troff.c
       t@@ -51,7 +51,9 @@ run(char *name, int fd)
                char *p, *q, *f[100];
                int nf, code, wid, ad;
                Biobuf b;
       +        Fmt fmt;
                
       +        fmtstrinit(&fmt);
                Binit(&b, fd, OREAD);
                while((p = Brdline(&b, '\n')) != nil){
                        p[Blinelen(&b)-1] = 0;
       t@@ -84,10 +86,14 @@ run(char *name, int fd)
                                        ad |= 1;
                                if(atoi(f[nf-2]) > 600)
                                        ad |= 2;
       +                        if(nf >= 7 && strcmp(f[5], "N") == 0 && strcmp(f[6], "space") == 0)
       +                                code = ' ';
                                if(code == ' ')
                                        Bprint(&bout, "spacewidth %d\ncharset\n", wid);
                                else
       -                                Bprint(&bout, "%C\t%d\t%d\t%d %04x\n", code, wid, ad, code, code);
       +                                fmtprint(&fmt, "%C\t%d\t%d\t%d %04x\n",
       +                                        code, wid, ad, code, code);
                        }
                }
       +        Bprint(&bout, "%s", fmtstrflush(&fmt));
        }
 (DIR) diff --git a/dist/troff/tfont b/dist/troff/tfont
       t@@ -15,8 +15,11 @@ for(font){
                        font=`{9 basename $font .ttf}
                if not if(~ $font *.sfd)
                        font=`{9 basename $font .sfd}
       -        fontforge -c 'Open($1); Generate($2, "", -1, 72, "map.sfd")' \
       -                $f0 $font^%s.pfb map.sfd
       +        echo '
       +                Open("'$f0'")
       +                Generate("'$font^%s.pfb'", "", -1, 72, "map.sfd")
       +        ' >fontforge.in
       +        fontforge -script fontforge.in
                {
                        echo name $font
                        echo fontname $font
       t@@ -25,7 +28,7 @@ for(font){
                for(h in $hex){
                        if(test -f $font$h.pfb){
                                pfb2pfa $font$h.pfb $font$h.pfa
       -                        mv $font$h.pfa /usr/local/plan9/postscript/font/dejavu/$font$h
       +                        mv $font$h.pfa /usr/local/plan9/postscript/font/$font$h
                                afm2troff -h -o 0x$h^00 $font$h.afm >>$font.troff
                                echo 0x$h^00 0x$h^FF $font$h >>$font.tpost
                        }