Re: use windows fonts and adobe distiller and lout
douglas mcallaster <[email protected]> Fri, 31 Jan 2020 17:06:33 -0500
| Newsgroups | gmane.comp.type-setting.lout |
|---|---|
| Message-ID | <CANsn3kfZC1fXbK6HAY2Sez-HJegjceMyNagmRHYFj6JmxYe4Zg@mail.gmail.com> |
--000000000000fb779d059d76c9b8 Content-Type: text/plain; charset="UTF-8" Content-Transfer-Encoding: quoted-printable Thanks, Guys; The TTF2AFM.exe created an afm file, which Lout used, and then distiller rendered Thus, perfect solution found, all on Windows, and no type 1 fonts needed. Ttf2afm is by Han The Thanh, the author of pdfTex. I got the exe from the MikTex distribution. (I had used Tex and LaTex years ago but even the basic distro has 8K files; it is a beast. The full distro from Tex User Group has over 100K files!!) The ttf2afm is described in a TUG boat 2009 article entitled 'A closer look at TrueType fonts and pdfTex' The only trick was applying an encoding option in its usage; else the afm files had -1 index for the glyphs; and the afms provided with Lout had a decimal code for the glyphs. Not all the TT fonts I tried worked, though; the newer ones did not seem to recode correctly. Thanh discusses some of this in his article but I did not really follow it. PS: I may still work on using Martin's shell script and investigate whether distiller can use type1 fonts and examine the quality. I do have a Linux Mint pc; and have used it for poking around. I tried briefly last night but got an error message about no GS_fontpath (as I recall) even though put the ttf font in a path GS searches. but no time to work on this again for a week at least. Lout is truly a wonderful gift. Many thanks to Professor Kingston for such a robust program. Doug On Fri, Jan 31, 2020 at 1:31 AM William Bader <[email protected]> wrote: > I think that Lout needs only the AFM, so just to run Lout, you can > probably get by without converting the fonts. > An alternative to ttf2pt1 is converting the font file through a file > conversion web site like http://www.freefontconverter.com/ (which > probably runs ttf2pt1 underneath). > Regards, William > > ------------------------------ > *From:* Lout-users <lout-users-bounces+williambader=3Dhotmail.com@nongnu.= org> > on behalf of Martin Michel <[email protected]> > *Sent:* Thursday, January 30, 2020 3:44 PM > *To:* douglas mcallaster <[email protected]> > *Cc:* [email protected] <[email protected]> > *Subject:* Re: use windows fonts and adobe distiller and lout > > Hey Doug, > > author of the script here. William and David already explained the idea > of the script very well, I have not much to add. It is basically a > wrapper around ttf2pt1 which automates the whole chain of preparation > for using a TTF/OTF font within Lout. The Readme on GitHub [1] gives > some more details, but you know it probably already. > > I used the script successful on MacOS and Linux but have no experience > with it on Windows. To directly use it, you could try to install Cygwin > [2] or MSYS2 [3], install the required programs and follow the steps > from the Readme. The dependencies are a bunch of GNU Unix/Linux tools > which should come out-of-the box in Cygwin (bash, sed, grep, tee, ...) an= d > the ttf2pt1 program [4]. Compilation requires specific development > headers, e.g. Freetype 2 [5] and build essential tools like make and > gcc. Although all those resource should be accessible by Cygwin's > package system, I have to admit, this is not an easy path if you are > completely new to GNU/Linux/Unix. To cut a long story short, I cannot > guarantee it will work this way but if you are ambitious and eager to > learn something new, just give it a try. (Alternatively, you could > install a Linux VM using Virtualbox [6] but this would make your task > even bigger=E2=80=A6) > > If there is another, easier way (Windows or Linux), I would be also very > happy to learn about it from the community. > > =E2=88=92Martin > > [1] https://github.com/smartmic/addfonts > [2] https://www.cygwin.com/ > [3] https://www.msys2.org/ > [4] http://ttf2pt1.sourceforge.net/ > [5] https://www.freetype.org/ > [6] https://www.virtualbox.org/ > > > On Tue, Jan 28, 2020 at 05:33:49PM -0500, douglas mcallaster wrote: > > Folks, > > > > Can lout use the truetype fonts which come with Windows 10? > > (And I am using Adobe Distiller to make pdf from the lout generated > postscript.) > > > > I found an explanation for using non standard fonts from 20 years ago > (using PFA or PFB and AFM files), > > but I assume truetype fonts would provide much higher quality. > > > > I discovered (on git hub) a script from Martin Michel from 2014 but it > is for Linux and ghostscript. > > Has someone made a Windows powershell script which could perform this > magic for me? > > > > Or perhaps someone could explain the script (copied next under) so that > I could try to its steps manually. > > > > As I understand it, I would have to set up lout to find the AFM file vi= a > a myfonts.ld file. > > > > If someone could reply with the requisite (I assume) AFM file (based on > some Windows10 truetype font), > > and a myfonts.ld file (with the correct matching @name, @family, @face, > @tag, @metrics, @mapping info) > > what would be really great. (An early success would keep me going, as I > have a day job.) > > > > Also, if folks have done this and can suggest a nice Windows Monospace, > Serif, and San Serif font, I welcome it. > > > > Finally, my thoughts go out to Dr Kingston, who enjoyed hiking in > Australia, > > as I wonder how much of his treasured woodlands are now destroyed. > > > > Thanks, Doug > > > > #!/bin/bash > > # > > # addfonts.sh > > # Converts True Type or Open Type Fonts to Postscript Type1 Fonts and > populates > > # the Ghostscript Fontmap file and the Basser Lout FontDef databases fo= r > local > > # users. > > # > > # Depends on non-standard commands: ttfpt1 (compiled against Freetype) > > # > > # > > # Copyright 2014 Martin Michel > > # > > # Licensed under the Apache License, Version 2.0 (the "License"); you > may not > > # use this file except in compliance with the License. You may obtai= n > a copy > > # of the License at > > # > > # http://www.apache.org/licenses/LICENSE-2.0 > > # > > # Unless required by applicable law or agreed to in writing, software > > # distributed under the License is distributed on an "AS IS" BASIS, > WITHOUT > > # WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. > See the > > # License for the specific language governing permissions and > limitations > > # under the License. > > > > shfile=3D$(sed 's/^.*\///' <<< $0) > > logfile=3D$(sed -e 's/\.sh/\.log/; s/^.*\///' <<< $0) > > #echo $0 $shfile $logfile > > > > usage=3D"Usage: ./$shfile > > No arguments applicable. This script scans for new True Type or Open > Type Font > > files, converts them to Postscript Type1 Fonts and updates the Fontmap > > (Ghostscript) and @FontDef (Lout) databases. The script and all > associated input > > and output files must be in the local user ghostscript font path." > > > > echo "*****************************************************************= "\ > > >>$logfile > > echo "LOG ENTRY from '$shfile'">>$logfile > > echo -e "Run by $USER on $HOSTNAME at $(date) \n ">>$logfile > > > > if [ $# -gt 0 ] ; then > > echo -e "TERMINATION: Wrong number of arguments. \n" |tee -a $logfi= le > > echo -e "$usage\n" > > exit 1 > > fi > > > > if [[ "$GS_FONTPATH" !=3D "$(pwd)" ]] ; then > > echo -e "TERMINATION: Wrong working directory or GS_FONTPATH not > set.\n" |tee -a $logfile > > echo -e "Current directory: $(pwd)" |tee -a $logfile > > echo -e "GS_FONTPATH: $GS_FONTPATH" |tee -a $logfile > > echo -e "$usage\n" > > exit 2 > > fi > > > > [ ! -f Fontmap ] && echo -e "INFO: Ghostscripts local 'Fontmap' file > missing, will > > be created.\n" |tee -a $logfile && touch Fontmap > > > > ls *.[oOtT][tT][fF] 2>/dev/null 1>&2 > > if [ $? -ne 0 ] ; then > > echo -e "TERMINATION: No True or Open Type Font files (.ttf,.otf) i= n > directory." |tee -a $logfile > > echo -e "$usage\n" > > exit 3 > > fi > > > > availableTTF=3D( $(ls -1 *.[oOtT][tT][fF] | sed 's/\.otf\|\.ttf//i') ) > > installedPFB=3D( $(grep -e '^/' Fontmap | sed 's/^.*(\|\.pfb.*$//g') ) > > > > typeset -i counter > > typeset -i numTTF > > typeset -i numInstalled > > typeset -i numPFB > > numTTF=3D${#availableTTF[*]} > > numInstalled=3D${#installedPFB[*]} > > counter=3D$numInstalled > > numPT1=3D$(ls -1 *.[aApP][fF][bBmM] 2>/dev/null | wc -l ) > > > > let z=3DnumPT1/2 > > let m=3DnumPT1%2 > > > > if (( $numInstalled < z && m =3D=3D 0 )) ; then > > echo -e "WARNING: There are unregistered PS Type1 font files.\n" > |tee -a $logfile > > elif (( $numInstalled > z || m > 0 )) ; then > > echo -e "TERMINATION: There are missing PS Type1 font files. It is > recommend to > > syncronize all files and databases in this directory (delete Fontmap an= d > rerun > > $0)\n" |tee -a $logfile > > exit 4 > > fi > > > > echo -e "STATUS: There are $numInstalled installed Postscript Type1 > Fonts out of $numTTF > > available True Type or Open Type Fonts for user $USER. \n" >>$logfile > > > > if (( $numTTF !=3D $numInstalled )) > > then > > for ii in ${availableTTF[*]}; do > > for jj in ${installedPFB[*]}; do > > if [[ "$ii" !=3D "$jj" ]]; then > > counter=3D$counter-1 > > fi > > done > > if (( $counter =3D=3D 0 )) ; then > > queueFonts=3D("${queueFonts[@]}" "$ii") > > fi > > counter=3D$numInstalled > > done > > else > > echo "INFO: Font database is up-to-date if you have not fiddled wit= h > the > > contents of this directory or the local Fontmap file manually after the > > last run of this script. Consult the log file for history. > > > > Nothing to do. No new fonts installed." |tee -a $logfile > > exit 0 > > fi > > > > for ff in ${queueFonts[@]}; do > > echo > "-----------------------------------------------------------------"\ > > >>$logfile > > echo "START OF TTF2PT1 LOG ENTRY FOR '$ff'" >>$logfile > > echo $(date) >>$logfile > > echo > "-----------------------------------------------------------------"\ > > >>$logfile > > > > ttf2pt1 -b $ff.[oOtT][tT][fF] >>$logfile 2>&1 > > > > fontNames=3D("${fontNames[@]}" "$(grep FontName $ff.afm | cut -d' ' > -f2-)") > > familyNames=3D("${familyNames[@]}" \ > > "$(grep FamilyName $ff.afm | cut -d' ' -f2- | sed 's/ /_/g')") > > faceNames=3D("${faceNames[@]}" \ > > "$(grep Weight $ff.afm | cut -d' ' -f2- | \ > > sed -e' s/^./\U&/g; s/ *//g; s/Regular/Base/i; s/Italic/Slope/i > ')") > > tagNames=3D("${tagNames[@]}" > "${familyNames[@]:(-1)}-${faceNames[@]:(-1)}") > > > > echo "/${fontNames[@]:(-1)} ($ff.pfb);" >>Fontmap > > > > if [[ -z `cat myfontdefs.ld | sed -n '/'"$ff"'.afm/p'` ]] ; then > > cat >>myfontdefs.ld<<LOUT_ENTRY > > { @FontDef > > @Tag { ${tagNames[@]:(-1)} } > > @Family { ${familyNames[@]:(-1)} } > > @Face { ${faceNames[@]:(-1)} } > > @Name { ${fontNames[@]:(-1)} } > > @Metrics { $ff.afm } > > @Mapping { LtLatin1.LCM } > > } > > > > LOUT_ENTRY > > fi > > > > # Correct for whitespace error in afm files > > sed -i 's/.null/space/' $ff.afm > > > > echo > "*****************************************************************"\ > > >>$logfile > > echo -e "Font: ${fontNames[@]:(-1)}; Tag: ${tagNames[@]:(-1)} (has > been \ > > installed.)" |tee -a $logfile > > done > > --000000000000fb779d059d76c9b8 Content-Type: text/html; charset="UTF-8" Content-Transfer-Encoding: quoted-printable <div dir=3D"ltr">Thanks, Guys;<div><br></div><div>The=C2=A0 TTF2AFM.exe cre= ated an afm file, which Lout used, and then distiller rendered</div><div>Th= us, perfect solution found, all on Windows, and no type 1 fonts needed.</di= v><div><br></div><div>Ttf2afm is by Han The Thanh, the author of pdfTex.=C2= =A0</div><div>I got the exe from the MikTex distribution.</div><div>(I had = used Tex and LaTex years ago but even the basic distro has 8K files; it is = a beast.</div><div>The full distro from Tex User Group has over 100K files!= !)<br></div><div><br></div><div>The ttf2afm is described in a TUG boat 2009= article entitled 'A closer look at TrueType fonts and pdfTex'</div= ><div>The only trick was applying an encoding=C2=A0option in its usage; els= e the afm files had -1 index for the glyphs; and the afms provided with Lou= t had a decimal code for the glyphs.<br></div><div>Not all the TT fonts I t= ried worked, though; the newer ones did not seem to recode correctly. Thanh= discusses some of this in his article but I did not really follow it.</div= ><div><br></div><div>PS: I may still work on using Martin's shell scrip= t and investigate whether distiller can use type1 fonts and examine the qua= lity.</div><div>I do have a Linux Mint pc; and have used it for poking arou= nd.</div><div>I tried briefly last night=C2=A0but got an error message abou= t no GS_fontpath (as I recall) even though put the ttf font in a path GS se= arches.</div><div>but no time to work on this again for a week at least.=C2= =A0</div><div><br></div><div>Lout is truly a wonderful gift. Many thanks to= Professor Kingston for such a robust program.</div><div><br></div><div>Dou= g</div></div><br><div class=3D"gmail_quote"><div dir=3D"ltr" class=3D"gmail= _attr">On Fri, Jan 31, 2020 at 1:31 AM William Bader <<a href=3D"mailto:= [email protected]">[email protected]</a>> wrote:<br></div>= <blockquote class=3D"gmail_quote" style=3D"margin:0px 0px 0px 0.8ex;border-= left:1px solid rgb(204,204,204);padding-left:1ex"> <div dir=3D"ltr"> <div style=3D"font-family:Calibri,Helvetica,sans-serif;font-size:12pt;color= :rgb(0,0,0)"> I think that Lout needs only the AFM, so just to run Lout, you can probably= get by without converting the fonts.</div> <div style=3D"font-family:Calibri,Helvetica,sans-serif;font-size:12pt;color= :rgb(0,0,0)"> An alternative to ttf2pt1 is converting the font file through a file conver= sion web site like=C2=A0<a href=3D"http://www.freefontconverter.com/" id=3D= "gmail-m_113942388892256256LPNoLP469266" target=3D"_blank">http://www.freef= ontconverter.com/</a>=C2=A0(which probably runs ttf2pt1 underneath).</div> <div style=3D"font-family:Calibri,Helvetica,sans-serif;font-size:12pt;color= :rgb(0,0,0)"> Regards, William</div> <div> <div style=3D"font-family:Calibri,Helvetica,sans-serif;font-size:12pt;color= :rgb(0,0,0)"> <br> </div> <hr style=3D"display:inline-block;width:98%"> <div id=3D"gmail-m_113942388892256256divRplyFwdMsg" dir=3D"ltr"><font face= =3D"Calibri, sans-serif" color=3D"#000000" style=3D"font-size:11pt"><b>From= :</b> Lout-users <lout-users-bounces+williambader=3D<a href=3D"mailto:ho= [email protected]" target=3D"_blank">[email protected]</a>> on b= ehalf of Martin Michel <<a href=3D"mailto:[email protected]" target=3D"_bl= ank">[email protected]</a>><br> <b>Sent:</b> Thursday, January 30, 2020 3:44 PM<br> <b>To:</b> douglas mcallaster <<a href=3D"mailto:douglas.mcallaster@gmai= l.com" target=3D"_blank">[email protected]</a>><br> <b>Cc:</b> <a href=3D"mailto:[email protected]" target=3D"_blank">lout-= [email protected]</a> <<a href=3D"mailto:[email protected]" target=3D= "_blank">[email protected]</a>><br> <b>Subject:</b> Re: use windows fonts and adobe distiller and lout</font> <div>=C2=A0</div> </div> <div><font size=3D"2"><span style=3D"font-size:11pt"> <div>Hey Doug,<br> <br> author of the script here. William and David already explained the idea<br> of the script very well, I have not much to add. It is basically a<br> wrapper around ttf2pt1 which automates the whole chain of preparation<br> for using a TTF/OTF font within Lout. The Readme on GitHub [1] gives<br> some more details, but you know it probably already.<br> <br> I used the script successful on MacOS and Linux but have no experience<br> with it on Windows. To directly use it, you could try to install Cygwin<br> [2] or MSYS2 [3], install the required programs and follow the steps<br> from the Readme. The dependencies are a bunch of GNU Unix/Linux tools<br> which should come out-of-the box in Cygwin (bash, sed, grep, tee, ...) and<= br> the ttf2pt1 program [4]. Compilation requires specific development<br> headers, e.g. Freetype 2 [5] and build essential tools like make and<br> gcc.=C2=A0 Although all those resource should be accessible by Cygwin's= <br> package system, I have to admit, this is not an easy path if you are<br> completely new to GNU/Linux/Unix. To cut a long story short, I cannot<br> guarantee it will work this way but if you are ambitious and eager to<br> learn something new, just give it a try. (Alternatively, you could<br> install a Linux VM using Virtualbox [6] but this would make your task<br> even bigger=E2=80=A6)<br> <br> If there is another, easier way (Windows or Linux), I would be also very<br= > happy to learn about it from the community.<br> <br> =E2=88=92Martin<br> <br> [1] <a href=3D"https://github.com/smartmic/addfonts" target=3D"_blank">http= s://github.com/smartmic/addfonts</a><br> [2] <a href=3D"https://www.cygwin.com/" target=3D"_blank">https://www.cygwi= n.com/</a><br> [3] <a href=3D"https://www.msys2.org/" target=3D"_blank">https://www.msys2.= org/</a><br> [4] <a href=3D"http://ttf2pt1.sourceforge.net/" target=3D"_blank">http://tt= f2pt1.sourceforge.net/</a><br> [5] <a href=3D"https://www.freetype.org/" target=3D"_blank">https://www.fre= etype.org/</a><br> [6] <a href=3D"https://www.virtualbox.org/" target=3D"_blank">https://www.v= irtualbox.org/</a><br> <br> <br> On Tue, Jan 28, 2020 at 05:33:49PM -0500, douglas mcallaster wrote:<br> > Folks,<br> > <br> > Can lout use the truetype fonts which come with Windows 10?<br> > (And I am using Adobe Distiller to make pdf from the lout generated po= stscript.)<br> > <br> > I found an explanation for using non standard fonts from 20 years ago = (using PFA or PFB and AFM files),<br> > but I assume truetype fonts would provide much higher quality.<br> > <br> > I discovered (on git hub) a script from Martin Michel from 2014 but it= is for Linux and ghostscript.<br> > Has someone made a Windows powershell script which could perform this = magic for me?<br> > <br> > Or perhaps someone could explain the script (copied next under) so tha= t I could try to its steps manually.<br> > =C2=A0<br> > As I understand it, I would have to set up lout to find the AFM file v= ia a myfonts.ld file.<br> > <br> > If someone could reply with the requisite (I assume) AFM file (based o= n some Windows10 truetype font),<br> > and a myfonts.ld file (with the correct matching @name, @family, @face= , @tag, @metrics, @mapping info)<br> > what would be really great. (An early success would keep me going, as = I have a day job.)<br> > <br> > Also, if folks have done this and can suggest a nice Windows Monospace= , Serif, and San Serif font, I welcome it.<br> > <br> > Finally, my thoughts go out to Dr Kingston, who enjoyed hiking in Aust= ralia,<br> > as I wonder how much of his treasured woodlands are now destroyed.<br> > <br> > Thanks, Doug<br> > <br> > #!/bin/bash<br> > #<br> > # addfonts.sh<br> > # Converts True Type or Open Type Fonts to Postscript Type1 Fonts and = populates<br> > # the Ghostscript Fontmap file and the Basser Lout FontDef databases f= or local<br> > # users.<br> > #<br> > # Depends on non-standard commands: ttfpt1 (compiled against Freetype)= <br> > #<br> > #<br> > # Copyright 2014 Martin Michel<br> > #<br> > # =C2=A0 Licensed under the Apache License, Version 2.0 (the "Lic= ense"); you may not<br> > # =C2=A0 use this file except in compliance with the License.=C2=A0 Yo= u may obtain a copy<br> > # =C2=A0 of the License at<br> > #<br> > # =C2=A0 =C2=A0 <a href=3D"http://www.apache.org/licenses/LICENSE-2.0"= target=3D"_blank">http://www.apache.org/licenses/LICENSE-2.0</a><br> > #<br> > # =C2=A0 Unless required by applicable law or agreed to in writing, so= ftware<br> > # =C2=A0 distributed under the License is distributed on an "AS I= S" BASIS, WITHOUT<br> > # =C2=A0 WARRANTIES OR CONDITIONS OF ANY KIND, either express or impli= ed.=C2=A0 See the<br> > # =C2=A0 License for the specific language governing permissions and l= imitations<br> > # =C2=A0 under the License.<br> > =C2=A0 =C2=A0<br> > shfile=3D$(sed 's/^.*\///' <<< $0)<br> > logfile=3D$(sed -e 's/\.sh/\.log/; s/^.*\///' <<< $0)= <br> > #echo $0 $shfile $logfile<br> > <br> > usage=3D"Usage: ./$shfile<br> > No arguments applicable. This script scans for new True Type or Open T= ype Font<br> > files, converts them to Postscript Type1 Fonts and updates the Fontmap= <br> > (Ghostscript) and @FontDef (Lout) databases. The script and all associ= ated input<br> > and output files must be in the local user ghostscript font path."= ;<br> > <br> > echo "***********************************************************= ******"\<br> > =C2=A0 =C2=A0>>$logfile<br> > echo "LOG ENTRY from '$shfile'">>$logfile<br> > echo -e "Run by $USER on $HOSTNAME at $(date) \n ">>$l= ogfile<br> > <br> > if [ $# -gt 0 ] ; then<br> > =C2=A0 =C2=A0 echo -e "TERMINATION: Wrong number of arguments. \n= " |tee -a $logfile<br> > =C2=A0 =C2=A0 echo -e "$usage\n"<br> > =C2=A0 =C2=A0 exit 1<br> > fi<br> > <br> > if [[ "$GS_FONTPATH" !=3D "$(pwd)" ]] ; then<br> > =C2=A0 =C2=A0 echo -e "TERMINATION: Wrong working directory or GS= _FONTPATH not set.\n" |tee -a $logfile<br> > =C2=A0 =C2=A0 echo -e "Current directory: $(pwd)" |tee -a $l= ogfile<br> > =C2=A0 =C2=A0 echo -e "GS_FONTPATH: $GS_FONTPATH" |tee -a $l= ogfile<br> > =C2=A0 =C2=A0 echo -e "$usage\n"<br> > =C2=A0 =C2=A0 exit 2<br> > fi<br> > <br> > [ ! -f Fontmap ] && echo -e "INFO: Ghostscripts local = 9;Fontmap' file missing, will<br> > be created.\n" |tee -a $logfile =C2=A0&& touch Fontmap<br= > > <br> > ls *.[oOtT][tT][fF] 2>/dev/null 1>&2<br> > if [ $? -ne 0 ] ; then<br> > =C2=A0 =C2=A0 echo -e "TERMINATION: No True or Open Type Font fil= es (.ttf,.otf) in directory." |tee -a $logfile<br> > =C2=A0 =C2=A0 echo -e "$usage\n"<br> > =C2=A0 =C2=A0 exit 3<br> > fi<br> > <br> > availableTTF=3D( $(ls -1 *.[oOtT][tT][fF] | sed 's/\.otf\|\.ttf//i= ') )<br> > installedPFB=3D( $(grep -e '^/' Fontmap | sed 's/^.*(\|\.p= fb.*$//g') )<br> > <br> > typeset -i counter<br> > typeset -i numTTF<br> > typeset -i numInstalled<br> > typeset -i numPFB<br> > numTTF=3D${#availableTTF[*]}<br> > numInstalled=3D${#installedPFB[*]}<br> > counter=3D$numInstalled<br> > numPT1=3D$(ls -1 *.[aApP][fF][bBmM] 2>/dev/null | wc -l )<br> > <br> > let z=3DnumPT1/2<br> > let m=3DnumPT1%2<br> > <br> > if (( $numInstalled < z && m =3D=3D 0 )) ; then<br> > =C2=A0 =C2=A0 echo -e "WARNING: There are unregistered PS Type1 f= ont files.\n" |tee -a $logfile<br> > elif (( $numInstalled > z || m > 0 )) ; then<br> > =C2=A0 =C2=A0 echo -e "TERMINATION: There are missing PS Type1 fo= nt files. It is recommend to<br> > syncronize all files and databases in this directory (delete Fontmap a= nd rerun<br> > $0)\n" |tee -a $logfile<br> > =C2=A0 =C2=A0 exit 4<br> > fi<br> > <br> > echo -e "STATUS: There are $numInstalled installed Postscript Typ= e1 Fonts out of $numTTF<br> > available True Type or Open Type Fonts for user $USER. \n" >&g= t;$logfile<br> > <br> > if (( $numTTF !=3D $numInstalled ))<br> > then<br> > =C2=A0 =C2=A0 for ii in ${availableTTF[*]}; do<br> > =C2=A0 =C2=A0 =C2=A0 =C2=A0 for jj in ${installedPFB[*]}; do<br> > =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 if [[ "$ii" !=3D &= quot;$jj" ]]; then<br> > =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 counter=3D$cou= nter-1<br> > =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 fi<br> > =C2=A0 =C2=A0 =C2=A0 =C2=A0 done<br> > =C2=A0 =C2=A0 =C2=A0 =C2=A0 if (( $counter =3D=3D =C2=A00 )) ; then<br= > > =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 queueFonts=3D("${queueF= onts[@]}" "$ii")<br> > =C2=A0 =C2=A0 =C2=A0 =C2=A0 fi<br> > =C2=A0 =C2=A0 =C2=A0 =C2=A0counter=3D$numInstalled<br> > =C2=A0 =C2=A0 done<br> > else<br> > =C2=A0 =C2=A0 echo "INFO: Font database is up-to-date if you have= not fiddled with the<br> > contents of this directory or the local Fontmap file manually after th= e<br> > last run of this script. Consult the log file for history.<br> > =C2=A0 =C2=A0<br> > Nothing to do. No new fonts installed." |tee -a $logfile<br> > =C2=A0 =C2=A0 exit 0<br> > fi<br> > <br> > for ff in ${queueFonts[@]}; do<br> > =C2=A0 =C2=A0 echo "---------------------------------------------= --------------------"\<br> > =C2=A0 =C2=A0 =C2=A0 =C2=A0>>$logfile<br> > =C2=A0 =C2=A0 echo "START OF TTF2PT1 LOG ENTRY FOR '$ff'&= quot; >>$logfile<br> > =C2=A0 =C2=A0 echo $(date) >>$logfile<br> > =C2=A0 =C2=A0 echo "---------------------------------------------= --------------------"\<br> > =C2=A0 =C2=A0 =C2=A0 =C2=A0>>$logfile<br> > <br> > =C2=A0 =C2=A0 ttf2pt1 -b $ff.[oOtT][tT][fF] =C2=A0>>$logfile 2&g= t;&1<br> > <br> > =C2=A0 =C2=A0 fontNames=3D("${fontNames[@]}" "$(grep Fo= ntName $ff.afm | cut -d' ' -f2-)")<br> > =C2=A0 =C2=A0 familyNames=3D("${familyNames[@]}" \<br> > =C2=A0 =C2=A0 =C2=A0 =C2=A0 "$(grep FamilyName $ff.afm | cut -d&#= 39; ' -f2- | sed 's/ /_/g')")<br> > =C2=A0 =C2=A0 faceNames=3D("${faceNames[@]}" \<br> > =C2=A0 =C2=A0 =C2=A0 =C2=A0 "$(grep Weight $ff.afm | cut -d' = ' -f2- | \<br> > =C2=A0 =C2=A0 =C2=A0 =C2=A0 sed -e' s/^./\U&/g; s/ *//g; s/Reg= ular/Base/i; s/Italic/Slope/i ')")<br> > =C2=A0 =C2=A0 tagNames=3D("${tagNames[@]}" "${familyNam= es[@]:(-1)}-${faceNames[@]:(-1)}")<br> > <br> > =C2=A0 =C2=A0 echo "/${fontNames[@]:(-1)} ($ff.pfb);" >&g= t;Fontmap<br> > =C2=A0 =C2=A0<br> > =C2=A0 =C2=A0 if [[ -z `cat myfontdefs.ld | sed -n '/'"$f= f"'.afm/p'` ]] ; then<br> > =C2=A0 =C2=A0 =C2=A0 =C2=A0 cat >>myfontdefs.ld<<LOUT_ENTR= Y<br> > { @FontDef<br> > =C2=A0 =C2=A0 =C2=A0 @Tag { ${tagNames[@]:(-1)} }<br> > =C2=A0 =C2=A0 =C2=A0 @Family { ${familyNames[@]:(-1)} }<br> > =C2=A0 =C2=A0 =C2=A0 @Face { ${faceNames[@]:(-1)} }<br> > =C2=A0 =C2=A0 =C2=A0 @Name { ${fontNames[@]:(-1)} }<br> > =C2=A0 =C2=A0 =C2=A0 @Metrics { $ff.afm }<br> > =C2=A0 =C2=A0 =C2=A0 @Mapping { LtLatin1.LCM }<br> > }<br> > <br> > LOUT_ENTRY<br> > =C2=A0 =C2=A0 fi<br> > =C2=A0 =C2=A0<br> > =C2=A0 =C2=A0 # Correct for whitespace error in afm files<br> > =C2=A0 =C2=A0 sed -i 's/.null/space/' $ff.afm<br> > <br> > =C2=A0 =C2=A0 echo "*********************************************= ********************"\<br> > =C2=A0 =C2=A0 =C2=A0 =C2=A0 >>$logfile<br> > =C2=A0 =C2=A0 echo -e "Font: ${fontNames[@]:(-1)}; Tag: ${tagName= s[@]:(-1)} (has been \<br> > installed.)" |tee -a $logfile<br> > done<br> <br> </div> </span></font></div> </div> </div> </blockquote></div> --000000000000fb779d059d76c9b8--