Subject: Re: HEADS-UP: Perl programmer wanted to fix "xsrc" problem
To: Frederick Bruckman <fredb@immanent.net>
From: Ron Roskens <roskens@elfin.net>
List: current-users
Date: 06/09/2003 14:13:07
On Mon, 9 Jun 2003, Frederick Bruckman wrote:
> On Sun, 8 Jun 2003, Jason Thorpe wrote:
>
> > On Saturday, June 7, 2003, at 11:59 PM, Matthias Scheler wrote:
> >
> > > On Sat, Jun 07, 2003 at 03:50:03PM -0700, Jason Thorpe wrote:
> > >>> I'm therefor searching for a volunteer to rewite the Perl script
> > >>> "xfree/xc/fonts/util/ucs2any.pl" into a C program.
> > >> How about sh/awk/sed?
> > >
> > > Rewriting it as a shell script would probably cause a performance
> > > degradation.
> >
> > Uh, but it's only used as a host tool, right? So what if it takes a
> > little longer to run...
>
> All it's doing is creating a plaintext file with minor changes from
> the original plaintext file. It seems like exactly the sort of thing
> that "awk" is designed for.
>
> My thoughts are to turn the logic of the perl script inside out,
> hashing the mapping, and using that as a filter for the bdf font.
> Hashing the whole font under "gawk" would not be very efficient, or
> reliable, and it shouldn't really be a problem reading in the source
> font twice for each output file, since the file would still be in the
> file cache. (Twice, because the minimum bounding box is specified near
> the top of the file, even though you need to see each glyph to figure
> out what it should be.)
>
> I've started writing a shell-awk script that mostly does the encodings
> part, but there's still a lot of detail work to be done to make it
> functionally equivalent to the perl script, if anyone's interested in
> collaborating...
I started looking at it too and what I found was that the guts of what the
perl script does are in the libfontenc library. Unfortunately, the
documentation on libfontenc is non-existant so you have to UTSL to find
out what the API is.
Ron Roskens