This is the mail archive of the cygwin mailing list for the Cygwin project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

Re: 2 questions about fonts


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 = '1.01';

my @files;

for (@ARGV) {
    push(@files,glob($_));
}
print "\n% -- Additional User Fonts --\n\n";
for (@files) {
    my $info = new PostScript::Font ($_,format => 'pfb');
    my $filename = 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 following:

$ 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@gmail.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 ? ? ? ? ? ? ?(/cygdrive/c/windows/fonts/BRIEM___.PFB) ? ? ? ?;
>
> 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 ?(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) {
> ? ?push(@files,glob($_));
> }
> print "\n% -- Additional User Fonts --\n\n";
> for (@files) {
> ? ?my $info = new PostScript::Font ($_,format => 'pfb');
> ? ?print "/",$info->FontName(),"\t\t(",$info->FileName(),")\t;\n";
> }
>
> Given the above, the following command gratifies greatly!
>
> ?perl ./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@gmail.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/


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]