[Date Prev][Date Next][Thread Prev][Thread Next] [Search] [Date Index] [Thread Index]

Re: [MacPerl] Downloading fonts to printer...



Jefferson Lowrey writes 13 May 1999:

>MacPerl seems like a good tool to use to write something that would check
>all the printers to see if they had the fonts resident in memory - and
>download them if they didn't.
>
>Does anyone know if there's a reference for talking to printers, or some
>module that I couldn't find on CPAN?

There is a script called 'sendps' in 'MacPerl Ÿ:macscripts' which will
probably do much of what you want, or at least provide you with a good
starting point for development.

If you send this PS script;

        /str 30 string def
        FontDirectory { exch str cvs print (\n) print pop} forall

to this Perl script (as a droplet, say);

        #!perl

        $| = 1;

        open(PRINTER, "+>Dev:Printer") or die "couldn't find LaserWriter";
        select((select(PRINTER), $|=1, $/="\012")[0]);

        while (<>) {
            print PRINTER;
        }

        shutdown(PRINTER,1);

        while (<PRINTER>) {
            s/\012/\015/g;
            print;
        }

it will print to screen the PS names of all the LaserWriter's resident fonts.

I haven't ever tried sending Type1 fonts to a printer via MacPerl, but I
can't see why you couldn't dispatch one to 'Dev:Printer' in a similar
fashion. I don't know the PS routine for adding a font to the FontDict, but
I guess it's to be found in the PS Reference somewhere.

Hope this helps,

Alan Fry



===== Want to unsubscribe from this list?
===== Send mail with body "unsubscribe" to macperl-request@macperl.org