如何停用“dvips”中的“mktexpk”?

如何停用“dvips”中的“mktexpk”?

考慮一下ex-14-5.mf

mode:=ljfour; % 600dpi for dvips (you must run "gftopk")
mode_setup;

beginchar("e",10pt#,7.5pt#,2.5pt#);
pickup pencircle scaled (.4pt+blacker);
draw fullcircle scaled .2w shifted (w/2,(h+d)/2-d);
draw fullcircle scaled .6w shifted (w/2,(h+d)/2-d);
draw fullcircle scaled w shifted (w/2,(h+d)/2-d);
endchar;

end

在其上運行metafont ( mf)。一切都很好:

$ mf ex-14-5
This is METAFONT, Version 2.7182818 (TeX Live 2017) (preloaded base=mf)
(ex-14-5.mf [101] )
Font metrics written on ex-14-5.tfm.
Output written on ex-14-5.600gf (1 character, 696 bytes).
Transcript written on ex-14-5.log.

現在運行tex這個檔案。一切都很好:

\font\x=ex-14-5 \x e \bye
$ tex ex-14-5
This is TeX, Version 3.14159265
(ex-14-5.tex [1] )
Output written on ex-14-5.dvi (1 page, 260 bytes).
Transcript written on ex-14-5.log.

運行時dvips -M0 ex-14-5它會嘗試自動建立pk文件:

This is dvips(k) 5.998 Copyright 2018 Radical Eye Software (www.radicaleye.com)
' TeX output 2019.03.14:1625' -> ex-14-5.ps

kpathsea: Running mktexpk --mfmode ljfour --bdpi 600 --mag 1+0/600 --dpi 600 ex-14-5
<various errors follow>

如果我pk在調用之前手動生成文件dvips ex-14-5,則一切正常:

$ rm *pk
$ gftopk ex-14-5.600gf
$ dvips ex-14-5
This is dvips(k) 5.998 Copyright 2018 Radical Eye Software (www.radicaleye.com)
' TeX output 2019.03.14:1625' -> ex-14-5.ps
<./ex-14-5.600pk></usr/share/texlive/texmf-dist/dvips/base/tex.pro>
</usr/share/texlive/texmf-dist/dvips/base/texps.pro>. 
</usr/share/texlive/texmf-dist/fonts/type1/public/amsfonts/cm/cmr10.pfb>[1] 

除了使用-M0命令行選項之外,我嘗試添加M0-.dvipsrc它沒有幫助。

如何告訴dvips不要嘗試自動產生pk文件?

答案1

如果您透過使用字體./,例如

\font\x=./myfont

那就mktexpk不叫了。

此功能允許mktexpk選擇性地抑制。-M在這種情況下,該選項不可用,因為它禁止mktexpk所有字體。

魔法發生在kpathsea_find_glyph.這是 tex-glyph.c 的相關程式碼

    /* If not an alias, try creating it on the fly with mktexpk,
       unless FONTNAME is absolute or explicitly relative.  */
    if (!ret && !kpathsea_absolute_p (kpse, fontname, true)) {

因此,kpathsea_absolute_p當檔案名稱顯式相對時傳回 true。

dvips現在根據需要使用輸出的相對路徑:

$ dvips -q ex-14-5
dvips: Font ./ex-14-5 not found; using cmr10
dvips: Design size mismatch in font ex-14-5
dvips: Checksum mismatch in font ex-14-5

相關內容