From mboxrd@z Thu Jan 1 00:00:00 1970 X-Msuck: nntp://news.gmane.io/gmane.comp.tex.context/6146 Path: main.gmane.org!not-for-mail From: "George N. White III" Newsgroups: gmane.comp.tex.context Subject: Re: texfont bad mode (755->0755) for mkdir, missing map line Date: Wed, 14 Nov 2001 16:24:31 -0400 (AST) Sender: owner-ntg-context@let.uu.nl Message-ID: References: <5.1.0.14.1.20011113092509.03e11990@server-1> Reply-To: "George N. White III" NNTP-Posting-Host: coloc-standby.netfonds.no Mime-Version: 1.0 Content-Type: TEXT/PLAIN; charset=US-ASCII X-Trace: main.gmane.org 1035396692 7927 80.91.224.250 (23 Oct 2002 18:11:32 GMT) X-Complaints-To: usenet@main.gmane.org NNTP-Posting-Date: Wed, 23 Oct 2002 18:11:32 +0000 (UTC) Cc: "George N. White III" , ConTeXt mailing list Original-To: Hans Hagen In-Reply-To: <5.1.0.14.1.20011113092509.03e11990@server-1> Xref: main.gmane.org gmane.comp.tex.context:6146 X-Report-Spam: http://spam.gmane.org/gmane.comp.tex.context:6146 On Tue, 13 Nov 2001, Hans Hagen wrote: > At 08:28 PM 11/12/2001 -0400, George N. White III wrote: > >I've just started using texfont, version=2000.12.14, (from the Sept. 14th > >beta), and encountered a couple minor problems: > > > >1) The line with mkdir: > > > > { my $str = shift ; mkdir $str, 0755 unless -d $str } > > > >originally used a mode off '755', which gives bad permissions > >for the directories texfont creates. > > so the 0 really means something (i thought that perl would see it as a > number and drop leading 0's) > > >2) The actual map files are always missing the first line shown in the > >encoding-vendor-collection.map file. > > i'll send you the latest version so that you can test it; A few minutes with "perl -d" reveals that the lost zero was actually just misplaced and written as an "o". The list of map file entries is stored in two forms: $mapdata -- list of new entries to be appended to the file $maplist -- the list of entries for the current font collection The misplaced "0" appears in the line which strips any existing entries for the current font ($thename) from $mapdata: { $mapdata =~ s/^$thename\s.*?$//gmois ; The effect the "o" is to tell perl to only compile the regular expression once (e.g., assume that $thename never changes -- an important optimization for certain loops). This line strips out any existing entry in the mapfile for font $thename, so that $mapdata can be appended to the file without duplicating existing entries. The result is that, when creating a new map file, the first font will not appear in the map file. I've gone into lots of detail here a) so the next time I see a similar problem there will be an explanation in the archives, and b) so that people who use texfont and have never written a perl script can see that it is possible to tweak perl scripts when they go astray. -- George N. White III Bedford Institute of Oceanography