Take the 2-minute tour ×
TeX - LaTeX Stack Exchange is a question and answer site for users of TeX, LaTeX, ConTeXt, and related typesetting systems. It's 100% free, no registration required.

I have bought the mathematical-pi font volume in type1 format and I want to use it in LaTeX. I already know that I have to rename *.pfb and *.afm files using the instructions described in Karl Berry' fontname, then get *.tfm files from the afm ones using afm2tfm.

But I also need the virtual font files because I want to use the following instructions of mathtime package, that allow you to use mathematical-pi 6 in blackboard format:

  \DeclareMathAlphabet\mathbb{U}{mh6}{m}{n}

(In addition, Karl Berry's instructions suggest to rename these pi fonts into ppi02#, where # is 0 for mathematicalpi-one and 5 for mathematicalpi-six, but the line above seems to force you to rename those mh#). So, I can't get *.pl and *.vpl files, and I can't create *.fd files in order to get an encoding of these fonts.

share|improve this question

1 Answer 1

I haven't used it in a number of years (ran under WIndows 2000), so I can't guarantee it has stayed up with Windows and/or MikTeX developments, but I wrote a batch file for preparing T1 fonts for use with my LaTeX installation. You could try to adapt it, or just examine the logic to figure out how to do it yourself. The part that produced the vf files was a program vptovf, which comes with the MikTeX installation. I have the batch file set up to install a single font, a family of 2, or a family of 4.

Obviously, a bunch of local directories and encoding schemes are set at the beginning of the file, which you will need to change. I make no promises about its suitability to more modern computer systems, but it may get you to where you are going.

FYI, I posted a similar answer on a different question, with regard to TrueType font installation: Displaying medieval scriptures and neumes in TeX

First, here is the batch file

@echo off
REM  This file will create LaTeX fonts given a family of
REM  Adobe Type 1 files.  The files should be of the type:
REM
REM  The default standard-font filename includes the word Regular, which 
REM  will need editing if it is otherwise.
REM
REM  The syntax of the command is mkT1font <font supplier> <font family>
REM
REM    DEFAULT FONT TYPE NAMES & OPTIONS
set STD=Regular
set BLD=Bold
set SLNT=.167
REM    ENCODING:
set ENCODE=T1-WGL4.enc
REM    FILE LOCATIONS:
set HDIR="C:\Documents and Settings\steven\TeX\Fonts"
set SEDEXE="C:\Documents and Settings\steven\TeX\Fonts\sed.exe"
set LOCALTEX=c:\localtexmf
rem       set LOCALTEX=c:\DOCUME~1\Steven\TeX\Fonts\T1\ltex
set FONTDIR=%LOCALTEX%\fonts
set DVIPDIR=%LOCALTEX%\dvips
set PSDIR=%LOCALTEX%\pdftex
set LATEXFONTDIR=%LOCALTEX%\tex\latex\fonts
set DVIPMAP=%LOCALTEX%\dvips\config\ps2pk.map
set PSMAP=%LOCALTEX%\pdftex\config\psfonts.map

REM================= Confirm number of arguments ========================

if "%2"=="" goto BADSYNTAX
goto CONTINUE1

:BADSYNTAX
echo Two arguments required: mkT1font font-supplier font-family
goto THEEND

:CONTINUE1

REM================= Ascertain font filenames ===========================

REM
set FNM=%1%2
if EXIST %FNM%%STD%.pfb goto JUSTFINE
if EXIST %FNM%.pfb goto FIXSTD
if EXIST %2%STD%.pfb goto FIXFNM
if EXIST %2.pfb goto FIXBOTH

echo.
echo For the standard font's filename, what word comes between 
echo ...%2 and .pfb (example: ...%2%STD%.pfb)?

SET /P STD=? 

if EXIST %FNM%%STD%.pfb goto JUSTFINE
if EXIST %2%STD%.pfb goto FIXFNM

echo Can't find specified font file, either
echo %FNM%%STD%.pfb
echo nor
echo %2%STD%.pfb
echo Aborting run.

goto THEEND

goto JUSTFINE

:FIXSTD

set STD=

goto JUSTFINE

:FIXFNM

set FNM=%2

goto JUSTFINE

:FIXBOTH

set FNM=%2
set STD=

:JUSTFINE

REM================= Confirm existence of all font files ================

echo.
echo How many font files do you wish to install from this family
Set /P NUM=(1, 2, 3, or 4)? 

IF "%NUM%"=="1" goto SKIPACNT
IF "%NUM%"=="2" goto SKIPACNT
IF "%NUM%"=="3" goto GETACTYP
IF "%NUM%"=="4" goto GETACTYP

echo.
echo Not prepared to install %NUM% fonts.
echo Aborting job.
goto THEEND

:GETACTYP

if NOT EXIST %FNM%Italic.pfb goto TYPEB
set ACNT=Italic
goto SKIPACNT

:TYPEB

if NOT EXIST %FNM%Oblique.pfb goto TYPEC
set ACNT=Oblique
goto SKIPACNT

:TYPEC

if NOT EXIST %FNM%i.pfb goto TYPED
set ACNT=i
goto SKIPACNT

:TYPED

if NOT EXIST %FNM%o.pfb goto GETACNT
set ACNT=o
goto SKIPACNT

:GETACNT

echo.
echo What filename phrase denotes the font accent
Set /P ACNT=(e.g. Italic, Oblique, i, o, etc.)?

:SKIPACNT

if %NUM%==1 goto SKIPBOLD

if NOT EXIST %FNM%Bold.pfb goto BOLDTYPEB
set BLD=Bold
goto SKIPBOLD

:BOLDTYPEB

if NOT EXIST %FNM%b.pfb goto GETBLD
set BLD=b
goto SKIPBOLD

:GETBLD

echo.
echo What filename phrase denotes the "bold" font
Set /P BLD=(e.g. Bold, b, Zier, etc.)?

:SKIPBOLD

echo.
echo Expected File(s):
echo.
if     EXIST %FNM%%STD%.pfb echo Standard Font:    %FNM%%STD%.pfb  Found.
if NOT EXIST %FNM%%STD%.pfb goto FILEMSNGSP
if     EXIST %FNM%%STD%.afm echo                   %FNM%%STD%.afm  Found.
if NOT EXIST %FNM%%STD%.afm goto FILEMSNGSA

if %NUM%==1 goto DONEFILES

if     EXIST %FNM%%BLD%.pfb echo Bold Font:        %FNM%%BLD%.pfb  Found.
if NOT EXIST %FNM%%BLD%.pfb goto FILEMSNGBP
if     EXIST %FNM%%BLD%.afm echo                   %FNM%%BLD%.afm  Found.
if NOT EXIST %FNM%%BLD%.afm goto FILEMSNGBA

if %NUM%==2 goto DONEFILES

if     EXIST %FNM%%ACNT%.pfb echo Accent Font:      %FNM%%ACNT%.pfb  Found.
if NOT EXIST %FNM%%ACNT%.pfb goto FILEMSNGAP
if     EXIST %FNM%%ACNT%.afm echo                   %FNM%%ACNT%.afm  Found.
if NOT EXIST %FNM%%ACNT%.afm goto FILEMSNGAA

if %NUM%==3 goto DONEFILES

if EXIST %FNM%%BLD%%ACNT%.pfb echo^
 Bold Accent Font: %FNM%%BLD%%ACNT%.pfb  Found
if NOT EXIST %FNM%%BLD%%ACNT%.pfb goto FILEMSNGBAP
if     EXIST %FNM%%BLD%%ACNT%.afm echo^
                   %FNM%%BLD%%ACNT%.afm  Found.
if NOT EXIST %FNM%%BLD%%ACNT%.afm goto FILEMSNGBAA

goto DONEFILES

:FILEMSNGSP
echo Standard Font:    %FNM%%STD%.pfb  Missing.
goto ABORT
:FILEMSNGSA
echo                   %FNM%%STD%.afm  Missing.
goto ABORT
:FILEMSNGBP
echo Bold Font:        %FNM%%BLD%.pfb  Missing.
goto ABORT
:FILEMSNGBA
echo                   %FNM%%BLD%.afm  Missing.
goto ABORT
:FILEMSNGAP
echo Accent Font:      %FNM%%ACNT%.pfb  Missing.
goto ABORT
:FILEMSNGAA
echo                   %FNM%%ACNT%.afm  Missing.
goto ABORT
:FILEMSNGBAP
echo Bold Accent Font: %FNM%%BLD%%ACNT%.pfb  Found
goto ABORT
:FILEMSNGBAA
echo                   %FNM%%BLD%%ACNT%.afm  Found.

:ABORT
echo.
echo Aborting Job.
goto THEEND

:DONEFILES
echo.
pause

REM================= Prepare the placeholder ============================

echo.
echo Preparing Placeholder font (fQQ) for use with fontinst.
copy %HDIR%\fi.tex .

echo.
echo Copying pfb and afm files to placeholder files.

copy %FNM%%STD%.pfb fQQr8a.pfb
copy %FNM%%STD%.afm fQQr8a.afm

if %NUM%==1 goto DONEPREP

copy %FNM%%BLD%.pfb fQQb8a.pfb
copy %FNM%%BLD%.afm fQQb8a.afm

if %NUM%==2 goto DONEPREP

copy %FNM%%ACNT%.pfb fQQri8a.pfb
copy %FNM%%ACNT%.afm fQQri8a.afm

if %NUM%==3 goto DONEPREP

copy %FNM%%BLD%%ACNT%.pfb fQQbi8a.pfb
copy %FNM%%BLD%%ACNT%.afm fQQbi8a.afm

:DONEPREP

REM================= Unleash fontinst on placeholder fonts ==============

texify fi.tex
del fi.tex fi.log

REM================= Determine actual fontnames from mtx files ==========

IF EXIST %SEDEXE% goto GETFNTNMS

echo You need to have sed.exe (sed stream editor) in the directory:
echo %HDIR%
echo It is available through gnu.org.
echo Aborting installation.
goto THEEND

:GETFNTNMS

echo.
echo Associated fontnames:

type fQQr8a.mtx | %SEDEXE% -n /storemapdata/p > F1.OUT
type F1.OUT | %SEDEXE% s/\\storemapdata{fQQr8a}{\\fromafm{fQQr8a}{// >F2.OUT
type F2.OUT | %SEDEXE% s/}//g > F3.OUT
type F3.OUT | %SEDEXE% s/{//g > FONTNAME.OUT
for /F %%A IN ('type FONTNAME.OUT') DO (
  set FNTNMS=%%A
)
del F1.OUT F2.OUT F3.OUT FONTNAME.OUT

if %NUM%==1 goto DONEFNTNMS

type fQQb8a.mtx | %SEDEXE% -n /storemapdata/p > F1.OUT
type F1.OUT | %SEDEXE% s/\\storemapdata{fQQb8a}{\\fromafm{fQQb8a}{// >F2.OUT
type F2.OUT | %SEDEXE% s/}//g > F3.OUT
type F3.OUT | %SEDEXE% s/{//g > FONTNAME.OUT
for /F %%A IN ('type FONTNAME.OUT') DO (
  set FNTNMB=%%A
)
del F1.OUT F2.OUT F3.OUT FONTNAME.OUT

if %NUM%==2 goto DONEFNTNMS

type fQQri8a.mtx | %SEDEXE% -n /storemapdata/p > F1.OUT
type F1.OUT | %SEDEXE% s/\\storemapdata{fQQri8a}{\\fromafm{fQQri8a}{// >F2.OUT
type F2.OUT | %SEDEXE% s/}//g > F3.OUT
type F3.OUT | %SEDEXE% s/{//g > FONTNAME.OUT
for /F %%A IN ('type FONTNAME.OUT') DO (
  set FNTNMA=%%A
)
del F1.OUT F2.OUT F3.OUT FONTNAME.OUT

if %NUM%==3 goto DONEFNTNMS

type fQQbi8a.mtx | %SEDEXE% -n /storemapdata/p > F1.OUT
type F1.OUT | %SEDEXE% s/\\storemapdata{fQQbi8a}{\\fromafm{fQQbi8a}{// >F2.OUT
type F2.OUT | %SEDEXE% s/}//g > F3.OUT
type F3.OUT | %SEDEXE% s/{//g > FONTNAME.OUT
for /F %%A IN ('type FONTNAME.OUT') DO (
  set FNTNMBA=%%A
)
del F1.OUT F2.OUT F3.OUT FONTNAME.OUT

:DONEFNTNMS

echo %FNM%%STD%.pfb: %FNTNMS%

if %NUM%==1 goto DONEFECHO

echo %FNM%%BLD%.pfb: %FNTNMB%

if %NUM%==2 goto DONEFECHO

echo %FNM%%ACNT%.pfb: %FNTNMA%

if %NUM%==3 goto DONEFECHO

echo %FNM%%BLD%%ACNT%.pfb: %FNTNMBA%

:DONEFECHO
echo.
pause

REM================= Replace placeholder references in each vpl file ====

dir /b/-p fQQ*.vpl > VPLLIST.OUT
for /F %%A IN ('type VPLLIST.OUT') DO (
  echo Revising %%A
  type %%A | %SEDEXE% s/fQQ/%2/g > TEMP.VPL
  copy TEMP.VPL %%A
  del TEMP.VPL
)
del VPLLIST.OUT

REM================= Generate pfb and afm files with font family name ===

rename %FNM%%STD%.pfb %FNM%%STD%.pfx
rename %FNM%%STD%.afm %FNM%%STD%.afx
copy fQQr8a.pfb %2r8a.pfb
copy fQQr8a.afm %2r8a.afm

if %NUM%==1 goto DONEPFB

rename %FNM%%BLD%.pfb %FNM%%BLD%.pfx
rename %FNM%%BLD%.afm %FNM%%BLD%.afx
copy fQQb8a.pfb %2b8a.pfb
copy fQQb8a.afm %2b8a.afm

if %NUM%==2 goto DONEPFB

rename %FNM%%ACNT%.pfb %FNM%%ACNT%.pfx
rename %FNM%%ACNT%.afm %FNM%%ACNT%.afx
copy fQQri8a.pfb %2ri8a.pfb
copy fQQri8a.afm %2ri8a.afm

if %NUM%==3 goto DONEPFB

rename %FNM%%BLD%%ACNT%.pfb %FNM%%BLD%%ACNT%.pfx
rename %FNM%%BLD%%ACNT%.afm %FNM%%BLD%%ACNT%.afx
copy fQQbi8a.pfb %2bi8a.pfb
copy fQQbi8a.afm %2bi8a.afm

:DONEPFB

REM================= Generate raw tfm files =============================

dir /b/-p fQQ*.pl > PLLIST.OUT
type PLLIST.OUT | %SEDEXE% s/.pl// | %SEDEXE% s/fQQ// > STRIPLIST.OUT
for /F %%A IN ('type STRIPLIST.OUT') DO (
  echo Processing fqq%%A.pl
  pltotf fQQ%%A.pl %2%%A.tfm
)
del PLLIST.OUT STRIPLIST.OUT

REM================= Generate cooked tfm files ==========================

dir /b/-p fQQ*.vpl > VPLLIST.OUT
type VPLLIST.OUT | %SEDEXE% s/.vpl// | %SEDEXE% s/fQQ// > STRIPLIST.OUT
for /F %%A IN ('type STRIPLIST.OUT') DO (
  echo Processing fqq%%A.vpl
  vptovf fQQ%%A.vpl %2%%A.vf %2%%A.tfm
)
del VPLLIST.OUT STRIPLIST.OUT

REM================= Delete files no longer needed ======================

del fQQ*.mtx fQQ*.pl fQQ*.vpl fQQ*.afm fQQ*.pfb

REM================= Revise fd files to remove placeholder ==============

dir /b/-p *fQQ.fd > FDLIST.OUT
for /F %%A IN ('type FDLIST.OUT') DO (
  echo Revising %%A
  type %%A | %SEDEXE% s/fQQ/%2/g > TEMP1.FD
  type TEMP1.FD | %SEDEXE% s/fqq/%2/g > TEMP2.FD
  copy TEMP2.FD %%A
  del TEMP1.FD TEMP2.FD
)
del FDLIST.OUT

REM================= Rename fd files ====================================

dir /b/-p *fqq.fd > FDLIST.OUT
type FDLIST.OUT | %SEDEXE% s/fqq.fd// > STRIPLIST.OUT
for /F %%A IN ('type STRIPLIST.OUT') DO (
  echo Renaming %%Afqq.fd
  copy %%Afqq.fd %%A%2.fd
  del %%Afqq.fd
)
del FDLIST.OUT STRIPLIST.OUT

REM================= Ascertain new psfont & dvips map enties ============

echo fQQ"%2r8r %FNTNMS% " TexBase1Encoding ReEncodeFont^
 " <8r.enc <%2r8a.pfbfQQ" > ENTRY.MAP
echo fQQ"%2ro8r %FNTNMS% " 0.167 SlantFont TexBase1Encoding ReEncodeFont^
 " <8r.enc <%2r8a.pfbfQQ" >> ENTRY.MAP

if %NUM%==1 goto DONEMAPENTRIES

echo fQQ"%2b8r %FNTNMB% " TexBase1Encoding ReEncodeFont^
 " <8r.enc <%2b8a.pfbfQQ" >> ENTRY.MAP
echo fQQ"%2bo8r %FNTNMB% " 0.167 SlantFont TexBase1Encoding ReEncodeFont^
 " <8r.enc <%2b8a.pfbfQQ" >> ENTRY.MAP

if %NUM%==2 goto DONEMAPENTRIES

echo fQQ"%2ri8r %FNTNMA% " TexBase1Encoding ReEncodeFont^
 " <8r.enc <%2ri8a.pfbfQQ" >> ENTRY.MAP

if %NUM%==3 goto DONEMAPENTRIES

echo fQQ"%2bi8r %FNTNMBA% " TexBase1Encoding ReEncodeFont^
 " <8r.enc <%2bi8a.pfbfQQ" >> ENTRY.MAP

:DONEMAPENTRIES

echo %% Done font %2! on %date% at %time% >> ENTRY.map

%SEDEXE% s/fQQ"""//g -i ENTRY.MAP
copy sedDOSSUX ENTRY.MAP
del sedDOSSUX

echo.
echo Updated map entries:
type ENTRY.MAP

REM================= Create target directories ==========================

IF NOT EXIST %FONTDIR% mkdir %FONTDIR%

IF NOT EXIST %FONTDIR%\type1       mkdir %FONTDIR%\type1
IF NOT EXIST %FONTDIR%\type1\%1    mkdir %FONTDIR%\type1\%1
IF NOT EXIST %FONTDIR%\type1\%1\%2 mkdir %FONTDIR%\type1\%1\%2

IF NOT EXIST %FONTDIR%\tfm       mkdir %FONTDIR%\tfm
IF NOT EXIST %FONTDIR%\tfm\%1    mkdir %FONTDIR%\tfm\%1
IF NOT EXIST %FONTDIR%\tfm\%1\%2 mkdir %FONTDIR%\tfm\%1\%2

IF NOT EXIST %FONTDIR%\vf       mkdir %FONTDIR%\vf
IF NOT EXIST %FONTDIR%\vf\%1    mkdir %FONTDIR%\vf\%1
IF NOT EXIST %FONTDIR%\vf\%1\%2 mkdir %FONTDIR%\vf\%1\%2

IF NOT EXIST %FONTDIR%\afm       mkdir %FONTDIR%\afm
IF NOT EXIST %FONTDIR%\afm\%1    mkdir %FONTDIR%\afm\%1
IF NOT EXIST %FONTDIR%\afm\%1\%2 mkdir %FONTDIR%\afm\%1\%2

IF NOT EXIST %LATEXFONTDIR% mkdir %LATEXFONTDIR%
IF NOT EXIST %LATEXFONTDIR%\%1 mkdir %LATEXFONTDIR%\%1
IF NOT EXIST %LATEXFONTDIR%\%1\%2 mkdir %LATEXFONTDIR%\%1\%2

IF NOT EXIST %DVIPDIR%      mkdir %DVIPDIR%
IF NOT EXIST %DVIPDIR%\config mkdir %DVIPDIR%\config
IF NOT EXIST %DVIPMAP% type nul > %DVIPMAP%

IF NOT EXIST %PSDIR%      mkdir %PSDIR%
IF NOT EXIST %PSDIR%\config mkdir %PSDIR%\config
IF NOT EXIST %PSMAP% type nul > %PSMAP%

REM================= Ascertain duplicate dvip map entries ===============

type %DVIPMAP% | %SEDEXE% -n /"%2r8r %FNTNMS%"/p > DUPDVIP.OUT
type %DVIPMAP% | %SEDEXE% -n /"%2ro8r %FNTNMS%"/p >> DUPDVIP.OUT

if %NUM%==1 goto DONEDUP1

type %DVIPMAP% | %SEDEXE% -n /"%2b8r %FNTNMB%"/p >> DUPDVIP.OUT
type %DVIPMAP% | %SEDEXE% -n /"%2bo8r %FNTNMB%"/p >> DUPDVIP.OUT

if %NUM%==2 goto DONEDUP1

type %DVIPMAP% | %SEDEXE% -n /"%2ri8r %FNTNMA%"/p >> DUPDVIP.OUT

if %NUM%==3 goto DONEDUP1

type %DVIPMAP% | %SEDEXE% -n /"%2bi8r %FNTNMBA%"/p >> DUPDVIP.OUT

:DONEDUP1
type %DVIPMAP% | %SEDEXE% -n /"Done font %2"/p >> DUPDVIP.OUT

copy %DVIPMAP% DVITEMP.MAP
type nul > ZERO.OUT

fc DUPDVIP.OUT ZERO.OUT | FIND "no differences encountered"
if not errorlevel=1 goto DONESCRUB1

echo.
echo Duplicates in dvip map file shown between v and ^^ arrows:
echo vvvvvvvvvvv
type DUPDVIP.OUT
echo ^^^^^^^^^^^^^^^^^^^^^^
echo.

REM================= Determine how to deal with duplicate entries =======

set SCRUBDVIP=no
SET /P SCRUBDVIP=Remove these conflicting map entries from the dvip^
 map (y/n)?
if %SCRUBDVIP%==y goto SCRUBDV
if %SCRUBDVIP%==Y goto SCRUBDV

echo.
echo By choosing no, you may have to manually edit
echo %DVIPMAP%
echo in order to address the potential conflicts.
echo.
pause

goto DONESCRUB1

REM================= Scrub duplicates from dvip map file ================

:SCRUBDV

echo Scrubbing
type %DVIPMAP% | %SEDEXE% /"Done font %2"/d > DVITEMP.MAP
type DVITEMP.MAP | %SEDEXE% /"%2r8r %FNTNMS%"/d > DVITEMP2.MAP
type DVITEMP2.MAP | %SEDEXE% /"%2ro8r %FNTNMS%"/d > DVITEMP.MAP

if %NUM%==1 goto DONESCRUB1

type DVITEMP.MAP | %SEDEXE% /"%2b8r %FNTNMB%"/d > DVITEMP2.MAP
type DVITEMP2.MAP | %SEDEXE% /"%2bo8r %FNTNMB%"/d > DVITEMP.MAP

if %NUM%==2 goto DONESCRUB1

type DVITEMP.MAP | %SEDEXE% /"%2ri8r %FNTNMA%"/d > DVITEMP2.MAP
type DVITEMP2.MAP | %SEDEXE% /"%2bi8r %FNTNMBA%"/d > DVITEMP.MAP

:DONESCRUB1

del DVITEMP2.MAP ZERO.OUT DUPDVIP.OUT

REM================= Append new dvip map file entries to file ===========

copy %DVIPMAP% %DVIPMAP%.OLD
copy DVITEMP.MAP+ENTRY.MAP %DVIPMAP%
del DVITEMP.MAP

REM================= Ascertain duplicate ps map entries =================

type %PSMAP% | %SEDEXE% -n /"%2r8r %FNTNMS%"/p > DUPPS.OUT
type %PSMAP% | %SEDEXE% -n /"%2ro8r %FNTNMS%"/p >> DUPPS.OUT

if %NUM%==1 goto DONEDUP2

type %PSMAP% | %SEDEXE% -n /"%2b8r %FNTNMB%"/p >> DUPPS.OUT
type %PSMAP% | %SEDEXE% -n /"%2bo8r %FNTNMB%"/p >> DUPPS.OUT

if %NUM%==2 goto DONEDUP2

type %PSMAP% | %SEDEXE% -n /"%2ri8r %FNTNMA%"/p >> DUPPS.OUT

if %NUM%==3 goto DONEDUP2

type %PSMAP% | %SEDEXE% -n /"%2bi8r %FNTNMBA%"/p >> DUPPS.OUT

:DONEDUP2
type %PSMAP% | %SEDEXE% -n /"Done font %2"/p >> DUPPS.OUT

copy %PSMAP% PSTEMP.MAP
type nul > ZERO.OUT

fc DUPPS.OUT ZERO.OUT | FIND "no differences encountered"
if not errorlevel=1 goto DONESCRUB2

echo.
echo Duplicates in psfonts map file shown between v and ^^ arrows:
echo vvvvvvvvvvv
type DUPPS.OUT
echo ^^^^^^^^^^^^^^^^^^^^^^
echo.

REM================= Determine how to deal with duplicate entries =======

set SCRUBPSFONTS=no
SET /P SCRUBPSFONTS=Remove these conflicting map entries from the psfonts^
 map (y/n)?
if %SCRUBPSFONTS%==y goto SCRUBPS
if %SCRUBPSFONTS%==Y goto SCRUBPS

echo.
echo By choosing no, you may have to manually edit
echo %PSMAP%
echo in order to address the potential conflicts.
echo.
pause

goto DONESCRUB2

REM================= Scrub duplicates from psfonts map file =============

:SCRUBPS

echo Scrubbing
type %PSMAP% | %SEDEXE% /"Done font %2"/d > PSTEMP.MAP
type PSTEMP.MAP | %SEDEXE% /"%2r8r %FNTNMS%"/d > PSTEMP2.MAP
type PSTEMP2.MAP | %SEDEXE% /"%2ro8r %FNTNMS%"/d > PSTEMP.MAP

if %NUM%==1 goto DONESCRUB2

type PSTEMP.MAP | %SEDEXE% /"%2b8r %FNTNMB%"/d > PSTEMP2.MAP
type PSTEMP2.MAP | %SEDEXE% /"%2bo8r %FNTNMB%"/d > PSTEMP.MAP

if %NUM%==2 goto DONESCRUB2

type PSTEMP.MAP | %SEDEXE% /"%2ri8r %FNTNMA%"/d > PSTEMP2.MAP
type PSTEMP2.MAP | %SEDEXE% /"%2bi8r %FNTNMBA%"/d > PSTEMP.MAP

:DONESCRUB2

del PSTEMP2.MAP ZERO.OUT DUPPS.OUT

REM================= Append new dvip map file entries to file ===========

copy %PSMAP% %PSMAP%.OLD
copy PSTEMP.MAP+ENTRY.MAP %PSMAP%
del PSTEMP.MAP

REM================= Move files to target directories ===================

copy %2*.pfb %FONTDIR%\type1\%1\%2\

REM for pfb install, afm files will have same name as pfbs
REM for ttf install, this will not be the case, necessarily
copy *%2*.afm %FONTDIR%\afm\%1\%2

copy *%2*.tfm %FONTDIR%\tfm\%1\%2\

copy *%2*.vf %FONTDIR%\vf\%1\%2\

copy *%2.fd %LATEXFONTDIR%\%1\%2\


REM================= Clean up loose ends ================================

del ENTRY.MAP

REM Restore original names to pfb and afm files
REM They were earlier changed to avoid copying them to localtexmf

rename %FNM%%STD%.pfx %FNM%%STD%.pfb
rename %FNM%%STD%.afx %FNM%%STD%.afm

if %NUM%==1 goto DONERENAME

rename %FNM%%BLD%.pfx %FNM%%BLD%.pfb
rename %FNM%%BLD%.afx %FNM%%BLD%.afm

if %NUM%==2 goto DONERENAME

rename %FNM%%ACNT%.pfx %FNM%%ACNT%.pfb
rename %FNM%%ACNT%.afx %FNM%%ACNT%.afm

if %NUM%==3 goto DONERENAME

rename %FNM%%BLD%%ACNT%.pfx %FNM%%BLD%%ACNT%.pfb
rename %FNM%%BLD%%ACNT%.afx %FNM%%BLD%%ACNT%.afm

:DONERENAME

REM Alert User to filename<->TeXname correspondence

echo.
echo Installation Note:
echo.
echo Files originally named %FNM%%STD%...
echo are named %2r8a... in the LaTeX Type1 and afm directories

if %NUM%==1 goto DONEMSG

echo.
echo Files originally named %FNM%%BLD%...
echo are named %2b8a... in the LaTeX Type1 and afm directories

if %NUM%==2 goto DONEMSG

echo.
echo Files originally named %FNM%%ACNT%...
echo are named %2ri8a... in the LaTeX Type1 and afm directories

if %NUM%==3 goto DONEMSG

echo.
echo Files originally named %FNM%%BLD%%ACNT%...
echo are named %2bi8a... in the LaTeX Type1 and afm directories

:DONEMSG

REM Parting guidance

echo.
echo If this is a revision of an existing installation,
echo you will need to delete all the preexisting pk
echo fonts with the name %2, below the directory named
echo %FONTDIR%\pk

echo.
set /P HASHNOW=Would you like to update the MikTeX filename data base now? 
if %HASHNOW%==y goto DOHASH
if %HASHNOW%==Y goto DOHASH

echo.
echo You will need to update the MikTeX database before using this font.
goto THEEND

:DOHASH

texhash
echo.

:THEEND

And then there are the .fd file stencils, that go with each of the respective installations (1, 2, or 4 fonts)

MAKEt1STENCIL1.fd

\ProvidesFile{t1STENCIL.fd}[TrueType font STENCIL]

\DeclareFontFamily{T1}{STENCIL}{}

\DeclareFontShape{T1}{STENCIL}{b}{n} {<-> COOKED}{}
\DeclareFontShape{T1}{STENCIL}{b}{sl}{<-> COOKEDo}{}
\DeclareFontShape{T1}{STENCIL}{b}{it}{<-> COOKEDo}{}

\DeclareFontShape{T1}{STENCIL}{m}{n} {<-> COOKED}{}
\DeclareFontShape{T1}{STENCIL}{m}{sl}{<-> COOKEDo}{}
\DeclareFontShape{T1}{STENCIL}{m}{it}{<-> COOKEDo}{}

\DeclareFontShape{T1}{STENCIL}{bx}{n} {<->ssub * STENCIL/b/n}{}
\DeclareFontShape{T1}{STENCIL}{bx}{sl}{<->ssub * STENCIL/b/sl}{}
\DeclareFontShape{T1}{STENCIL}{bx}{it}{<->ssub * STENCIL/b/it}{}

\endinput

MAKEt1STENCIL2.fd

\ProvidesFile{t1STENCIL.fd}[TrueType font STENCIL]

\DeclareFontFamily{T1}{STENCIL}{}

\DeclareFontShape{T1}{STENCIL}{b}{n} {<-> COOKEDb}{}
\DeclareFontShape{T1}{STENCIL}{b}{sl}{<-> COOKEDbo}{}
\DeclareFontShape{T1}{STENCIL}{b}{it}{<-> COOKEDbo}{}

\DeclareFontShape{T1}{STENCIL}{m}{n} {<-> COOKED}{}
\DeclareFontShape{T1}{STENCIL}{m}{sl}{<-> COOKEDo}{}
\DeclareFontShape{T1}{STENCIL}{m}{it}{<-> COOKEDo}{}

\DeclareFontShape{T1}{STENCIL}{bx}{n} {<->ssub * STENCIL/b/n}{}
\DeclareFontShape{T1}{STENCIL}{bx}{sl}{<->ssub * STENCIL/b/sl}{}
\DeclareFontShape{T1}{STENCIL}{bx}{it}{<->ssub * STENCIL/b/it}{}

\endinput

MAKEt1STENCIL4.fd

\ProvidesFile{t1STENCIL.fd}[TrueType font STENCIL]

\DeclareFontFamily{T1}{STENCIL}{}

\DeclareFontShape{T1}{STENCIL}{b}{n} {<-> COOKEDb}{}
\DeclareFontShape{T1}{STENCIL}{b}{sl}{<-> COOKEDbo}{}
\DeclareFontShape{T1}{STENCIL}{b}{it}{<-> COOKEDbi}{}

\DeclareFontShape{T1}{STENCIL}{m}{n} {<-> COOKED}{}
\DeclareFontShape{T1}{STENCIL}{m}{sl}{<-> COOKEDo}{}
\DeclareFontShape{T1}{STENCIL}{m}{it}{<-> COOKEDi}{}

\DeclareFontShape{T1}{STENCIL}{bx}{n} {<->ssub * STENCIL/b/n}{}
\DeclareFontShape{T1}{STENCIL}{bx}{sl}{<->ssub * STENCIL/b/sl}{}
\DeclareFontShape{T1}{STENCIL}{bx}{it}{<->ssub * STENCIL/b/it}{}

\endinput
share|improve this answer

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.