6

I successfully generated a METAFONT character by the program below. How do I use it in LaTeX/XeTeX.

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

I.e. what packages should I use and how do I use "b" from that METAFONT program?

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

DOESN'T WORK FOR ME

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
_____________________________________________________________________

2 Answers 2

7

You're running Metafont in proof mode; Metafont loves proof mode and will do anything it can to stay in proof mode unless you specifically command it to produce real font files. Notice that your error message says that it couldn't find a .tfm file?

Try running it this way:

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

This should crank out a .tfm and appropriate .pk file for your font, which should then work in your document.

3

Put the a.mf where tex can find it (e.g. in the current directory) and then use

\documentclass{article}

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

enter image description here

3
  • Please see my edit. Commented Nov 7, 2019 at 17:06
  • his is \openout1 = `tsta.aux'. LaTeX Font Info: Checking defaults for OMX/cmex/m/n on input line 3. LaTeX Font Info: ... okay on input line 3. LaTeX Font Info: Checking defaults for U/cmr/m/n on input line 3. LaTeX Font Info: ... okay on input line 3. ! Font \test=aaa 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 End of file on the terminal! Commented Nov 7, 2019 at 17:17
  • Hm. in texlive it works fine, only miktex fails. It could be worth a bug report in the miktex tracker. Commented Nov 7, 2019 at 18:05

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .