Mail Archives: cygwin/2009/05/12/12:18:54
Oops, rush to judgment here. Caught in the old assumption trap--- I
thought that if it worked for gs then it would follow that it should
work for gv! Silly me!! However both will work with a symlink to the
appropiate .PFB. So a change to the script:
$ cat fonts.pl
#!/usr/bin/perl
#
# fonts.pl -- create list of fonts for fontmap.GS from commandline
use strict;
use warnings;
use PostScript::Font;
use File::Basename;
our $VERSION =3D '1.01';
my @files;
for (@ARGV) {
push(@files,glob($_));
}
print "\n% -- Additional User Fonts --\n\n";
for (@files) {
my $info =3D new PostScript::Font ($_,format =3D> 'pfb');
my $filename =3D basename($info->FileName());
print "/",$info->FontName(),"\t\t($filename)\t;\n";
}
Now I cleaned out the full path version of my fonts from Fontmap.GS
and then ran:
$ perl ./fonts.pl /cygdrive/c/windows/fonts/*.PFB | cat >>
/usr/share/ghostscript/8.63/lib/Fontmap.GS
Next I created the symlinks in /usr/share/ghostscript/fonts with the follow=
ing:
$ ln /cygdrive/c/windows/fonts/*.PFB .
At this point I have a working gs and gv. This makes writing raw
postscript about as easy as it is going to get.
--hsm
On Mon, May 11, 2009 at 7:32 PM, Hugh Myers <hsmyers AT gmail DOT com> wrote:
> The primary answer is yes. And since my belief is that lpr goes
> through ghostscript for Postscript evaluation, things all resolve down
> to getting ghostscript to "find" wanted fonts. After a great deal of
> trial and error, it came down to a single file: Fontmap.GS. On my
> system this is found at /usr/share/ghostscript/8.63/lib-- your mileage
> may vary. Modifying this file leads to the desired result: for
> instance in order for the /BriemMono line in gs to work, you need an
> entry in Fontmap.GS that looks like:
>
> /BriemMono =A0 =A0 =A0 =A0 =A0 =A0 =A0(/cygdrive/c/windows/fonts/BRIEM___=
.PFB) =A0 =A0 =A0 =A0;
>
> Two things to note--- the whitespace you see is comprised of tabs (old
> tradition in unix, possible makes no difference, but still...) and the
> location of the file (which may be different for you) is couched in
> cygwin terms; /cygdrive/c/ etc.
>
> There after font name resolution is no longer a problem.
>
> Actually, since annotation by hand would in my case be a very large
> PIA =A0(190 fonts to add), I wrote a small script that creates output
> suitable for concatenation with Fontmap.GS:
>
> #!/usr/bin/perl
> #
> # fonts.pl -- create list of fonts for fontmap.GS from commandline
> use strict;
> use warnings;
> use PostScript::Font;
>
> my @files;
>
> for (@ARGV) {
> =A0 =A0push(@files,glob($_));
> }
> print "\n% -- Additional User Fonts --\n\n";
> for (@files) {
> =A0 =A0my $info =3D new PostScript::Font ($_,format =3D> 'pfb');
> =A0 =A0print "/",$info->FontName(),"\t\t(",$info->FileName(),")\t;\n";
> }
>
> Given the above, the following command gratifies greatly!
>
> =A0perl ./fonts.pl /cygdrive/c/windows/fonts/*.PFB | cat >>
> /usr/share/ghostscript/8.63/lib/Fontmap.GS
>
> Problem solved, back to work;)
>
> On Fri, May 8, 2009 at 3:37 AM, Hugh Myers <hsmyers AT gmail DOT com> wrote:
>> I've a great many postscript fonts installed under Windows XP--- is
>> there a way to acquaint cygwin of these?
>>
>> How are font names resolved for lpr? For instance in a non cygwin
>> situation, I might have a line in a postscript file such as:
>> /BriemMono findfont 8 scalefont setfont (typeset these words) show.
>> This runs without problems, I'd like to be able to do something
>> similar using cygwin (obviously using cygwin installed fonts). I am
>> somewhat clueless here, hence these questions. Thanks for any help...
>>
>> --hsm
>>
>
--
Unsubscribe info: http://cygwin.com/ml/#unsubscribe-simple
Problem reports: http://cygwin.com/problems.html
Documentation: http://cygwin.com/docs.html
FAQ: http://cygwin.com/faq/
- Raw text -