delorie.com/archives/browse.cgi   search  
Mail Archives: cygwin/2009/05/11/21:33:15

X-Recipient: archive-cygwin AT delorie DOT com
X-SWARE-Spam-Status: No, hits=-1.7 required=5.0 tests=AWL,BAYES_00,J_CHICKENPOX_72,SARE_MSGID_LONG40,SPF_PASS
X-Spam-Check-By: sourceware.org
MIME-Version: 1.0
In-Reply-To: <408995400905080237y1ac5f951t4c3260a86fd23f16@mail.gmail.com>
References: <408995400905080237y1ac5f951t4c3260a86fd23f16 AT mail DOT gmail DOT com>
From: Hugh Myers <hsmyers AT gmail DOT com>
Date: Mon, 11 May 2009 19:32:34 -0600
Message-ID: <408995400905111832m55a059e4l82a3a6c90f9e2018@mail.gmail.com>
Subject: Re: 2 questions about fonts
To: cygwin AT cygwin DOT com
Mailing-List: contact cygwin-help AT cygwin DOT com; run by ezmlm
List-Id: <cygwin.cygwin.com>
List-Unsubscribe: <mailto:cygwin-unsubscribe-archive-cygwin=delorie DOT com AT cygwin DOT com>
List-Subscribe: <mailto:cygwin-subscribe AT cygwin DOT com>
List-Archive: <http://sourceware.org/ml/cygwin/>
List-Post: <mailto:cygwin AT cygwin DOT com>
List-Help: <mailto:cygwin-help AT cygwin DOT com>, <http://sourceware.org/ml/#faqs>
Sender: cygwin-owner AT cygwin DOT com
Mail-Followup-To: cygwin AT cygwin DOT com
Delivered-To: mailing list cygwin AT cygwin DOT com

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 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 -


  webmaster     delorie software   privacy  
  Copyright © 2019   by DJ Delorie     Updated Jul 2019