Metafont "forgets" to put in my glyphs

Showing 1-11 of 11 messages
Metafont "forgets" to put in my glyphs Felix.leg 4/19/12 3:11 AM
Hi,

I've got a really weird issue and don't even know where to start with:
I'm designing a font for my conlang and I've just read the
METAFONTbook until 11 ch. but I want to do some glyphs now. Based on
examples from the book (and some else books I found). The problem
appears when I want to test my font with TeX's "testfont" utility. In
case of the books' examples it puts right glyphs in right places, BUT
if I do the same with my font (I mean *exactly* the same: the same
\mode= , the same way of my .mf file is written, etc.) I don't see my
glyphs. Instead, there are plain serf characters, definitely not ones
I designed. There is no errors in log, nor there is any font in my
system with a coincidental, identical name.

If someone want to try, here is my file (compiled with 'mode=ljfour',
my system's equivalent of 'mode=localfont').
It's not all characters of course, but it doesn't make any difference.

%BEGIN vfont10.mf
font_size 10pt#;

%---------------------- [Dimensions ]
%golden number
numeric Phi,aPhi,mPhi;
Phi := (1+sqrt5)/2;
aPhi := Phi - 1;
mPhi := 1 - aPhi;

em# := 10pt#;
en# := .5em#;
enn# := .75em#;
cap# := em# -  1/3pt#;
o# := 5/100cap#;

sp# := 0.3 * 0.9 * em#;

%pen sizes
thick# := 1/7em#;
thin# := .5thick#;

mode_setup;

define_pixels(em,en,enn,cap,sp);
define_blacker_pixels(thin,thick);
define_corrected_pixels(o);

%--------------------------[ char defs ]

beginchar("f", .8em# , em# , 0);
        pickup pencircle xscaled thick yscaled 2;
        lft z0=(0,h); lft z1=(0,en); rt z2=(w,0);

        draw z0{right}..z1{left}; draw z1..{right}z2;
endchar;

beginchar("g", em# , em# , 0);
        pickup pencircle xscaled thin yscaled .3thin rotated 20;
        vertbar := w/2;
        top z0=(vertbar,h); z1=(vertbar,en); rt z2=(w,en); z3=(vertbar/4,en/
4);
        draw z0--z1{down}..{dir 135}z3..{right}z1--z2;
endchar;

beginchar("x", em# , em# , 0);
        pickup pencircle xscaled thin yscaled .3thin rotated 20;
        vertbar := w*mPhi;
        top z0=(vertbar,h); z1=(vertbar,en); rt z2=(w,en); z3=(vertbar/4,en/
4);
        draw z0--z1{down}..{dir 135}z3..{right}z1--z2;
        z4=.5[z1,z2];z5= (.8[x1,x2] , 2/5en);
        draw z4..{dir 45}z5;
endchar;

%---------------------[ char defs end ]

end
Re: Metafont "forgets" to put in my glyphs Robin Fairbairns 4/19/12 11:50 AM
"Felix.leg" <feli...@gmail.com> writes:

> I've got a really weird issue and don't even know where to start with:
> I'm designing a font for my conlang and I've just read the
> METAFONTbook until 11 ch. but I want to do some glyphs now. Based on
> examples from the book (and some else books I found). The problem
> appears when I want to test my font with TeX's "testfont" utility. In
> case of the books' examples it puts right glyphs in right places, BUT
> if I do the same with my font (I mean *exactly* the same: the same
> \mode= , the same way of my .mf file is written, etc.) I don't see my
> glyphs. Instead, there are plain serf characters, definitely not ones
> I designed. There is no errors in log, nor there is any font in my
> system with a coincidental, identical name.
>
> If someone want to try, here is my file (compiled with 'mode=ljfour',
> my system's equivalent of 'mode=localfont').
> It's not all characters of course, but it doesn't make any difference.
>
> %BEGIN vfont10.mf
> font_size 10pt#;
> [...]

it doesn't "forget" to produce output; it spews out a lot of error
messages, making clear it doesn't think much of your code.  i'm afraid i
don't know enough metafont to spot which is the crucial error that
causes it to give up on your font altogether.  (i last wrote a metafont
font more than 20 years ago -- my brain seems to have let the knowledge
seep out.  there are people who read this list who are relatively fluent
users of metafont; if you're lucky one of them might drop in and help.)
--
Robin Fairbairns, Cambridge
sorry about all this posting.  i'll go back to sleep in a bit.
Re: Metafont "forgets" to put in my glyphs Dan Luecking 4/19/12 12:07 PM
On Thu, 19 Apr 2012 03:11:17 -0700 (PDT), "Felix.leg"
<feli...@gmail.com> wrote:

>Hi,
>
>I've got a really weird issue and don't even know where to start with:
>I'm designing a font for my conlang and I've just read the
>METAFONTbook until 11 ch. but I want to do some glyphs now. Based on
>examples from the book (and some else books I found). The problem
>appears when I want to test my font with TeX's "testfont" utility. In
>case of the books' examples it puts right glyphs in right places, BUT
>if I do the same with my font (I mean *exactly* the same: the same
>\mode= , the same way of my .mf file is written, etc.) I don't see my
>glyphs. Instead, there are plain serf characters, definitely not ones
>I designed. There is no errors in log, nor there is any font in my
>system with a coincidental, identical name.
>
>If someone want to try, here is my file (compiled with 'mode=ljfour',
>my system's equivalent of 'mode=localfont').

This worked for me:

  mf \mode:=ljfour; input vfont10.mf
  gftopk vfont10.600gf
  tex testfont      

At the prompts I typed vfont10 for the font, \table for
the command, and then \end.

Then I could view testfont.dvi in my dvi viewer and, after
  dvips testfont
I could view testfont.ps in GSview. Also
  dvipdfm testfont
produced an acceptable pdf file. And even
  pdftex testfont
worked.

There are three glyphs shown in the table, at positions "66,
"67 and "78. The first looks kind of like an "R" with the
vertical missing, the second like a "d" with an extra
horizontal line extending right, and the third like a
ligature of the second with a "c".

Did you maybe omit the second step (gftopk)? Almost all
programs that can handle metafont output require the pk
file (vfont10.600pk).


Dan
To reply by email, change LookInSig to luecking
Re: Metafont "forgets" to put in my glyphs Felix.leg 4/20/12 12:34 AM
On 19 Kwi, 21:07, Dan Luecking <LookIn...@uark.edu> wrote:
> [...]
> There are three glyphs shown in the table, at positions "66,
> "67 and "78. The first looks kind of like an "R" with the
> vertical missing, the second like a "d" with an extra
> horizontal line extending right, and the third like a
> ligature of the second with a "c".
>
> Did you maybe omit the second step (gftopk)? Almost all
> programs that can handle metafont output require the pk
> file (vfont10.600pk).

You got the right results. But I didn't forget about gftopk.
I made .tfm , .pk and even .fd file (because I read LaTeX will need
it).
Nothing works :(.

Re: Metafont "forgets" to put in my glyphs Felix.leg 4/20/12 12:27 AM
On 19 Kwi, 20:50, Robin Fairbairns <r...@cl.cam.ac.uk> wrote:
>
> it doesn't "forget" to produce output; it spews out a lot of error
> messages, making clear it doesn't think much of your code.
> --
> Robin Fairbairns, Cambridge
> sorry about all this posting.  i'll go back to sleep in a bit.

Oh man...If MF have said about *any* error in my file then I could
(maybe) find a way. MF is very productive when he wants to 'help' ;).
But in my case MF says everything is clean. Other programs too :(.

It becomes weirder and weirder...
Re: Metafont "forgets" to put in my glyphs Dan Luecking 4/20/12 2:19 PM
Don't use latex at all, please. It is not expected
to work with self-made metafonts, unless you _really_
know what you are doing.

>Nothing works :(.

It is time for you to explain what you actually did,
from start to finish.

Start with just vfont10.mf in the current directory,
run the commands I listed or your own (but tell us
exactly what each of them is). If you still can't
see the font, submit the screen messages or log
file from all programs. If you view the postscript
in GSview, ask to see the GhostScript messages. If
you view in PDF, request a listing of fonts. Any
information you can squeeze out, send it.

Finally: that word "exactly" above? I mean that literally.
Re: Metafont "forgets" to put in my glyphs Felix.leg 4/21/12 3:52 AM
On 20 Kwi, 23:19, Dan Luecking <LookIn...@uark.edu> wrote:
>
> It is time for you to explain what you actually did,
> from start to finish.
>

All right, here's is my terminal (lines with $>> is what I type, the
rest are responses):

$>> mf '\mode=ljfour; input vfont10'
This is METAFONT, Version 2.718281 (TeX Live 2009/Debian)
(vfont10.mf [102] [103] [120] )
Font metrics written on vfont10.tfm.
Output written on vfont10.600gf (3 characters, 812 bytes).
Transcript written on vfont10.log.
$>> gftopk vfont10.600gf
$>> tex testfont
This is TeX, Version 3.1415926 (TeX Live 2009/Debian)
(/usr/share/texmf-texlive/tex/plain/base/testfont.tex

Name of the font to test = vfont10
Now type a test command (\help for help):)
*\sample

*\bye
[1]
Output written on testfont.dvi (1 page, 2048 bytes).
Transcript written on testfont.log.

After that my testfont.dvi contains this: http://i.imgur.com/9nTe3.png
Re: Metafont "forgets" to put in my glyphs Dan 4/21/12 9:13 PM
On Apr 21, 5:52 am, "Felix.leg" <felix....@gmail.com> wrote:
> On 20 Kwi, 23:19, Dan Luecking <LookIn...@uark.edu> wrote:
>
>
> All right, here's is my terminal (lines with $>> is what I type, the
> rest are responses):
>
> $>> mf '\mode=ljfour; input vfont10'
> This is METAFONT, Version 2.718281 (TeX Live 2009/Debian)
> (vfont10.mf [102] [103] [120] )
> Font metrics written on vfont10.tfm.
> Output written on vfont10.600gf (3 characters, 812 bytes).
> Transcript written on vfont10.log.
> $>> gftopk vfont10.600gf
> $>> tex testfont
> This is TeX, Version 3.1415926 (TeX Live 2009/Debian)
> (/usr/share/texmf-texlive/tex/plain/base/testfont.tex
>
> Name of the font to test = vfont10
> Now type a test command (\help for help):)
> *\sample
>
> *\bye
> [1]
> Output written on testfont.dvi (1 page, 2048 bytes).
> Transcript written on testfont.log.
>
> After that my testfont.dvi contains this:http://i.imgur.com/9nTe3.png

You haven't taken my words literally enough. I said tell us _exactly_
what you did. That includes telling us what program you used to view
the dvi  (xdvi?, dviout?, YAP? dvips+gv?). If that png is not a screen
shot,
it might be useful to know how it was produced.

Thinking that "testfont.dvi contains" something is an incorrect point
of view.
All a dvi file contains are instructions about what to put where on
the page.
It contains no fonts, only their names. That image you posted is what
program X displays/prints/produces from that set of instructions.
That's
why it is important to know what X is.

I think it likely your dvi viewer is one that doesn't look in the
current directory
for fonts. Knowing what that dvi viewer is would likely help diagnose
the
problem.

Or maybe you moved  the font into a texmf tree, but forgot to refresh
the
filename database?


Dan
Re: Metafont "forgets" to put in my glyphs Peter Flynn 4/22/12 4:28 AM
On 19/04/12 20:07, Dan Luecking wrote:
> On Thu, 19 Apr 2012 03:11:17 -0700 (PDT), "Felix.leg"
> <feli...@gmail.com> wrote:
>
>> Hi,
>>
>> I've got a really weird issue and don't even know where to start with:
>> I'm designing a font for my conlang and I've just read the
>> METAFONTbook until 11 ch. but I want to do some glyphs now. Based on
>> examples from the book (and some else books I found). The problem
>> appears when I want to test my font with TeX's "testfont" utility. In
>> case of the books' examples it puts right glyphs in right places, BUT
>> if I do the same with my font (I mean *exactly* the same: the same
>> \mode= , the same way of my .mf file is written, etc.) I don't see my
>> glyphs. Instead, there are plain serf characters, definitely not ones
>> I designed. There is no errors in log, nor there is any font in my
>> system with a coincidental, identical name.
>>
>> If someone want to try, here is my file (compiled with 'mode=ljfour',
>> my system's equivalent of 'mode=localfont').
>
> This worked for me:
>
>   mf \mode:=ljfour; input vfont10.mf
>   gftopk vfont10.600gf
>   tex testfont      

[snip]

I took the other way: I wrote a 5-line LaTeX document that said:

\documentclass{article}
\font\test=vfont10
\begin{document}
This is fgx: \test fgx
\end{document}

When processed, this cleanly created the vfont10.tfm file, and opening
the .dvi file in kdvi it cleanly created a vfont10.600gf and it seems to
display just fine.

///Peter
Re: Metafont "forgets" to put in my glyphs Felix.leg 4/22/12 5:52 AM
On 22 Kwi, 06:13, Dan <lueck...@uark.edu> wrote:
> All a dvi file contains are instructions about what to put where on
> the page.
> It contains no fonts, only their names. That image you posted is what
> program X displays/prints/produces from that set of instructions.

Now I may sound like a total dumb, but
I really didn't know dvi *does NOT contain any font*!
<facepalm>
Now I remember some of other examples also "didn't"
work when I compiled them as dvi, but work perfectly
when they were pushed thru pdfLaTeX.
<facepalm x2>

I'm using...wrong...I used to use Evince, because that is
the default document viewer on my system, and since now
I haven't any reason to complain about it.

Now I'm installing everything which has "a DVI viewer" in its
description.
And it seems everything else *works*.

I'm goin' to put up my dunce cap now... >_>
Re: Metafont "forgets" to put in my glyphs Dan Luecking 4/23/12 9:28 AM
Actually, you usually want it to create vfont10.600pk
(not gf). Most dvi viewers will creat the PK, move
it to some directory in some texmf tree and then delete
the GF file.

Moving the PK file is a problem while the font is in
development. This is because a lot of dvi processors
will look for the PK file in texmf directory trees before
the current directory, and thus an old version will be
used instead of the expected new-and-improved version.

The same can be true of the tfm file if TeX is allowed to
create it on the fly.

One really wants to run mf and gftopk oneself. I ran
across this problem once, years ago, when I forgot to
run gftopk and the debugging session was long and
frustrating (partly because the DVI viewer I was using
hid the PK file generation from me).

A similar thing happened to me with auto TFM generation,
but the screen messages made it clear it was happening.