METAFONT 字符

METAFONT 字符

我通过以下程序成功生成了一个 METAFONT 字符。如何在 LaTeX/XeTeX 中使用它。

mf a.mf
gftodvi a.2602gf
a.dvi

即我应该使用什么包以及如何从 METAFONT 程序中使用“b”?

mode_setup;

% parameters are name, width, height over base line, depth below base line
beginchar ("b", 9pt#, 14pt#, 0);

  % define points
  x1 = 0; y1 = 0;
  x9=1;y9=h;
  % define pen
  pickup pencircle scaled 0.1w;

  % draw
  draw z9{1,1}..z1{1,1}..z9{1,1};

  penlabels(1,2,9);
endchar;

end

对我来说不起作用

Command Line:   D:\ProgramFiles\MikTexNEW\miktex\bin\x64\xelatex.exe --interaction=errorstopmode --synctex=-1 "tsta.tex"
Startup Folder: C:\Users\hynek0\Desktop\TH0dipl

This is XeTeX, Version 3.14159265-2.6-0.999991 (MiKTeX 2.9.7050 64-bit)
entering extended mode
(tsta.tex
LaTeX2e <2018-12-01>
(D:\ProgramFiles\MikTexNEW\tex/latex/base\article.cls
Document Class: article 2018/09/03 v1.4i Standard LaTeX document class
(D:\ProgramFiles\MikTexNEW\tex/latex/base\size10.clo)) (tsta.aux)Making a.tfm from .\a.mf...
Running miktex-mf.exe...
This is METAFONT, Version 2.7182818 (MiKTeX 2.9.7050 64-bit)



(D:\ProgramFiles\MikTexNEW\fonts/source/public/levy-font\a.mf

>> readfrom

! Isolated expression.

<to be read again> 

                   (

l.26 if unknown gen_acc : readfrom(

                                   "gen_acc") fi

! Extra tokens will be flushed.

<to be read again> 

                   (

l.26 if unknown gen_acc : readfrom(

                                   "gen_acc") fi

>> cmchar

! Isolated expression.

<to be read again> 

                   "Lowercase alpha"

l.52 cmchar "Lowercase alpha"

                             ;

! Extra tokens will be flushed.

<to be read again> 

                   "Lowercase alpha"

l.52 cmchar "Lowercase alpha"

                             ;

>> width#

! Internal quantity `charwd' must receive a known value.

<to be read again> 

                   ;

beginchar->...byte(EXPR0)else:0fi;charwd:=(EXPR1);

                                                  charht:=(EXPR2);chardp:=(E...

l.53 beginchar("a",dims)

                        ;

>> x_height#

! Internal quantity `charht' must receive a known value.

<to be read again> 

                   ;

beginchar->...0fi;charwd:=(EXPR1);charht:=(EXPR2);

                                                  chardp:=(EXPR3);w:=hround(...

l.53 beginchar("a",dims)

                        ;

>> this_letter

! Isolated expression.

<to be read again> 

                   ;

l.54 this_letter;

                  penlabels(1,2,3,4,5,6,7); endchar;

[97]

>> cmchar

! Isolated expression.

<to be read again> 

                   "Lowercase alpha with grave"

l.58 cmchar "Lowercase alpha with grave"

                                        ;

! Extra tokens will be flushed.

<to be read again> 

                   "Lowercase alpha with grave"

l.58 cmchar "Lowercase alpha with grave"

                                        ;

>> width#

! Internal quantity `charwd' must receive a known value.

<to be read again> 

                   ;

beginchar->...byte(EXPR0)else:0fi;charwd:=(EXPR1);

                                                  charht:=(EXPR2);chardp:=(E...

l.59 beginchar(oct"200",width#,acc_ht#,0)

                                         ;

>> acc_ht#

! Internal quantity `charht' must receive a known value.

<to be read again> 

                   ;

beginchar->...0fi;charwd:=(EXPR1);charht:=(EXPR2);

                                                  chardp:=(EXPR3);w:=hround(...

l.59 beginchar(oct"200",width#,acc_ht#,0)

                                         ;

>> this_letter

! Isolated expression.

<to be read again> 

                   ;

l.60 this_letter;

                  grave(x_baryctr); endchar;

>> grave

! Isolated expression.

<to be read again> 

                   (

l.60 this_letter; grave(

                        x_baryctr); endchar;

! Extra tokens will be flushed.

<to be read again> 

                   (

l.60 this_letter; grave(

                        x_baryctr); endchar;

[128]

>> cmchar

! Isolated expression.

<to be read again> 

                   "Lowercase alpha with rough breathing"

l.62 cmchar "Lowercase alpha with rough breathing"

                                                  ;

! Extra tokens will be flushed.

<to be read again> 

                   "Lowercase alpha with rough breathing"

l.62 cmchar "Lowercase alpha with rough breathing"

                                                  ;

>> width#

! Internal quantity `charwd' must receive a known value.

<to be read again> 

                   ;

beginchar->...byte(EXPR0)else:0fi;charwd:=(EXPR1);

                                                  charht:=(EXPR2);chardp:=(E...

l.63 beginchar(oct"201",width#,acc_ht#,0)

                                         ;

>> acc_ht#

! Internal quantity `charht' must receive a known value.

<to be read again> 

                   ;

beginchar->...0fi;charwd:=(EXPR1);charht:=(EXPR2);

                                                  chardp:=(EXPR3);w:=hround(...

l.63 beginchar(oct"201",width#,acc_ht#,0)

                                         ;

>> this_letter

! Isolated expression.

<to be read again> 

                   ;

l.64 this_letter;

                  spirit(x_baryctr)<; endchar;

>> spirit

! Isolated expression.

<to be read again> 

                   (

l.64 this_letter; spirit(

                         x_baryctr)<; endchar;

! Extra tokens will be flushed.

<to be read again> 

                   (

l.64 this_letter; spirit(

                         x_baryctr)<; endchar;

[129]

>> cmchar

! Isolated expression.

<to be read again> 

                   "Lowercase alpha with smooth breathing"

l.66 ...ar "Lowercase alpha with smooth breathing"

                                                  ;

! Extra tokens will be flushed.

<to be read again> 

                   "Lowercase alpha with smooth breathing"

l.66 ...ar "Lowercase alpha with smooth breathing"

                                                  ;

>> width#

! Internal quantity `charwd' must receive a known value.

<to be read again> 

                   ;

beginchar->...byte(EXPR0)else:0fi;charwd:=(EXPR1);

                                                  charht:=(EXPR2);chardp:=(E...

l.67 beginchar(oct"202",width#,acc_ht#,0)

                                         ;

>> acc_ht#

! Internal quantity `charht' must receive a known value.

<to be read again> 

                   ;

      (

l.103 this_letter; spirit_acute(

                                x_baryctr)>; endchar;

[138]

>> cmchar

! Isolated expression.

<to be read again> 

                   "Lowercase sigma followed by alpha with acute"

l.105 ...rcase sigma followed by alpha with acute"

                                                  ;

! Extra tokens will be flushed.

<to be read again> 

                   "Lowercase sigma followed by alpha with acute"

l.105 ...rcase sigma followed by alpha with acute"

                                                  ;

>> begindoublechar

! Isolated expression.

<to be read again> 

                   (

l.106 begindoublechar(

                      oct"213",dim_sigma);

! Extra tokens will be flushed.

<to be read again> 

                   (

l.106 begindoublechar(

                      oct"213",dim_sigma);

>> mid_sigma

! Isolated expression.

<to be read again> 

                   ;

l.107 mid_sigma;

                 middoublechar(width#,acc_ht#,0);

>> middoublechar

! Isolated expression.

<to be read again> 

                   (

l.107 mid_sigma; middoublechar(

                               width#,acc_ht#,0);

! Extra tokens will be flushed.

<to be read again> 

                   (

l.107 mid_sigma; middoublechar(

                               width#,acc_ht#,0);

>> this_letter

! Isolated expression.

<to be read again> 

                   ;

l.108 this_letter;

                   acute(x_baryctr); endchar;

>> acute

! Isolated expression.

<to be read again> 

                   (

l.108 this_letter; acute(

                         x_baryctr); endchar;

! Extra tokens will be flushed.

<to be read again> 

                   (

l.108 this_letter; acute(

                         x_baryctr); endchar;

[138]

! Extra `endgroup'.

endchar->...makebox(screenrule);showit;fi.endgroup



l.108 this_letter; acute(x_baryctr); endchar

                                            ;

>> cmchar

! Isolated expression.

<to be read again> 

                   "Lowercase alpha with acute and iota subscript"

l.110 ...case alpha with acute and iota subscript"

                                                  ;

! Extra tokens will be flushed.

<to be read again> 

                   "Lowercase alpha with acute and iota subscript"

l.110 ...case alpha with acute and iota subscript"

                                                  ;

>> width#

! Internal quantity `charwd' must receive a known value.

<to be read again> 

                   ;

beginchar->...byte(EXPR0)else:0fi;charwd:=(EXPR1);

                                                  charht:=(EXPR2);chardp:=(E...

l.111 beginchar(oct"214",width#,acc_ht#,iota_dp#)

                                                 ;

>> acc_ht#

! Internal quantity `charht' must receive a known value.

<to be read again> 

                   ;

beginchar->...0fi;charwd:=(EXPR1);charht:=(EXPR2);

                                                  chardp:=(EXPR3);w:=hround(...

l.111 beginchar(oct"214",width#,acc_ht#,iota_dp#)

                                                 ;

>> iota_dp#

! Internal quantity `chardp' must receive a known value.

<to be read again> 

                   ;

beginchar->...R1);charht:=(EXPR2);chardp:=(EXPR3);

                                                  w:=hround(charwd*hppp);h:=...

l.111 beginchar(oct"214",width#,acc_ht#,iota_dp#)

                                                 ;

>> this_letter

! Isolated expression.

<to be read again> 

                   ;

l.112 this_letter;

                   acute(x_baryctr); iota_sub(pos_stem); endchar;

>> acute

! Isolated expression.

<to be read again> 

                   (

l.112 this_letter; acute(

                         x_baryctr); iota_sub(pos_stem); endchar;

! Extra tokens will be flushed.

<to be read again> 

                   (

l.112 this_letter; acute(

                         x_baryctr); iota_sub(pos_stem); endchar;

>> iota_sub

! Isolated expression.

<to be read again> 

                   (

l.112 this_letter; acute(x_baryctr); iota_sub(

                                              pos_stem); endchar;

! Extra tokens will be flushed.

<to be read again> 

                   (

l.112 this_letter; acute(x_baryctr); iota_sub(

                                              pos_stem); endchar;

[140]

>> cmchar

! Isolated expression.

<to be read again> 

                   "Lowercase alpha with rough breathing, acute and iota sub...

l.114 ...ough breathing, acute and iota subscript"

                                                  ;

! Extra tokens will be flushed.

<to be read again> 

                   "Lowercase alpha with rough breathing, acute and iota sub...

l.114 ...ough breathing, acute and iota subscript"

                                                  ;

>> width#

! Internal quantity `charwd' must receive a known value.

<to be read again> 

                   ;

beginchar->...byte(EXPR0)else:0fi;charwd:=(EXPR1);

                                                  charht:=(EXPR2);chardp:=(E...

l.115 beginchar(oct"215",width#,acc_ht#,iota_dp#)

                                                 ;

>> acc_ht#

! Internal quantity `charht' must receive a known value.

<to be read again> 

                   ;

beginchar->...0fi;charwd:=(EXPR1);charht:=(EXPR2);

                                                  chardp:=(EXPR3);w:=hround(...

l.115 beginchar(oct"215",width#,acc_ht#,iota_dp#)

                                                 ;

>> iota_dp#

! Internal quantity `chardp' must receive a known value.

<to be read again> 

                   ;

beginchar->...R1);charht:=(EXPR2);chardp:=(EXPR3);

                                                  w:=hround(charwd*hppp);h:=...

l.115 beginchar(oct"215",width#,acc_ht#,iota_dp#)

                                                 ;

>> this_letter

! Isolated expression.

<to be read again> 

                   ;

l.116 this_letter;

                   spirit_acute(x_baryctr)<; iota_sub(pos_stem); endchar;

>> spirit_acute

! Isolated expression.

<to be read again> 

                   (

l.116 this_letter; spirit_acute(

                                x_baryctr)<; iota_sub(pos_stem); endchar;

! Extra tokens will be flushed.

<to be read again> 

                   (

l.116 this_letter; spirit_acute(

                                x_baryctr)<; iota_sub(pos_stem); endchar;

>> iota_sub

! Isolated expression.

<to be read again> 

                   (

l.116 ...tter; spirit_acute(x_baryctr)<; iota_sub(

                                                  pos_stem); endchar;

! Extra tokens will be flushed.

<to be read again> 

                   (

l.116 ...tter; spirit_acute(x_baryctr)<; iota_sub(

                                                  pos_stem); endchar;

[141]

>> cmchar

! Isolated expression.

<to be read again> 

                   "Lowercase alpha with smooth breathing and acute and iota...

l.118 ...h breathing and acute and iota subscript"

                                                  ;

! Extra tokens will be flushed.

<to be read again> 

                   "Lowercase alpha with smooth breathing and acute and iota...

l.118 ...h breathing and acute and iota subscript"

                                                  ;

>> width#

! Internal quantity `charwd' must receive a known value.

<to be read again> 

                   ;

beginchar->...byte(EXPR0)else:0fi;charwd:=(EXPR1);

                                                  charht:=(EXPR2);chardp:=(E...

l.119 beginchar(oct"216",width#,acc_ht#,iota_dp#)

                                                 ;

>> acc_ht#

! Internal quantity `charht' must receive a known value.

<to be read again> 

                   ;

beginchar->...0fi;charwd:=(EXPR1);charht:=(EXPR2);

                                                  chardp:=(EXPR3);w:=hround(...

l.119 beginchar(oct"216",width#,acc_ht#,iota_dp#)

                                                 ;

! Extra tokens will be flushed.

<to be read again> 

                   "Lowercase sigma followed by alpha"

l.165 cmchar "Lowercase sigma followed by alpha"

                                                ;

>> begindoublechar

! Isolated expression.

<to be read again> 

                   (

l.166 begindoublechar(

                      oct"001",dim_sigma);

! Extra tokens will be flushed.

<to be read again> 

                   (

l.166 begindoublechar(

                      oct"001",dim_sigma);

>> mid_sigma

! Isolated expression.

<to be read again> 

                   ;

l.167 mid_sigma;

                 middoublechar(dims); this_letter; endchar;

>> middoublechar

! Isolated expression.

<to be read again> 

                   (

l.167 mid_sigma; middoublechar(

                               dims); this_letter; endchar;

! Extra tokens will be flushed.

<to be read again> 

                   (

l.167 mid_sigma; middoublechar(

                               dims); this_letter; endchar;

>> this_letter

! Isolated expression.

<to be read again> 

                   ;

l.167 mid_sigma; middoublechar(dims); this_letter;

                                                   endchar;

[248]

! Extra `endgroup'.

endchar->...makebox(screenrule);showit;fi.endgroup



l.167 ...middoublechar(dims); this_letter; endchar

                                                  ;

)

! Emergency stop.

<*> \mode:=ljfour; nonstopmode; input a



Output written on a.2602gf (27 characters, 4164 bytes).

Transcript written on a.log.

METAFONT failed for some reason

Sorry, but maketfm did not succeed.

The log file hopefully contains the information to get MiKTeX going again:

  C:\Users\hynek0\AppData\Local\MiKTeX\2.9\miktex\log\miktex-maketfm.log

! Font \test=a not loadable: Metric (TFM) file or installed font not found.
<to be read again> 
                   \test 
l.5 \test
          b
? 

! Emergency stop.
<to be read again> 
                   \test 
l.5 \test
          b
No pages of output.

_____________________________________________________________________

 PDFLaTeX Compilation Report (Pages: 0)

 Errors: 2   Warnings: 0   Bad Boxes: 0
_____________________________________________________________________

答案1

您正在以校样模式运行 Metafont;Metafont 喜欢校样模式,它会尽一切可能保持校样模式,除非您明确命令它生成真正的字体文件。注意到您的错误消息说它找不到文件了吗.tfm

尝试按如下方式运行:

mf "\mode=localfont; input aaa.mf"
gftopk aaa.600gf aaa.pk

这应该会为您的字体生成一个.tfm合适的.pk文件,然后该文件可以在您的文档中使用。

答案2

将 a.mf 放在 tex 可以找到的地方(例如在当前目录中),然后使用

\documentclass{article}

\begin{document}
\font\test=a 
\test b
\end{document}

在此处输入图片描述

相关内容