将 matetical pi 6 字体 (type1) 转换为 *.vf 文件

将 matetical pi 6 字体 (type1) 转换为 *.vf 文件

我购买了 type1 格式的数学 pi 字体卷,我想在 LaTeX 中使用它。我已经知道我必须使用 Karl Berry 的字体名称中描述的说明重命名 *.pfb 和 *.afm 文件,然后使用 afm2tfm 从 afm 文件获取 *.tfm 文件。

但是我还需要虚拟字体文件,因为我想使用 mathtime 包的以下指令,这些指令允许您以黑板格式使用数学 pi 6:

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

(此外,Karl Berry 的说明建议将这些 pi 字体重命名为 ppi02#,其中 # 为 0(代表数学 pi-1)和 5(代表数学 pi-6),但上面一行似乎强迫您将这些重命名为 mh#)。因此,我无法获取 *.pl 和 *.vpl 文件,也无法创建 *.fd 文件以获取这些字体的编码。

答案1

我已经有好几年没用它了(在 Windows 2000 下运行),所以我不能保证它与 Windows 和/或 MikTeX 的发展同步,但我编写了一个批处理文件,用于准备 T1 字体以供我的 LaTeX 安装使用。您可以尝试调整它,或者只是检查逻辑以弄清楚如何自己做。生成 vf 文件的部分是一个程序 vptovf,它随 MikTeX 安装一起提供。我已将批处理文件设置为安装单个字体、2 个字体系列或 4 个字体系列。

显然,文件开头设置了一堆本地目录和编码方案,您需要更改它们。我不能保证它适用于更现代的计算机系统,但它可能会帮助您实现目标。

仅供参考,我在另一个问题上发布了类似的答案,关于 TrueType 字体安装:在 TeX 中显示中世纪经文和纽姆

首先,这是批处理文件

@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

然后有 .fd 文件模板,与相应的安装(1、2 或 4 种字体)配套使用

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

相关内容