Re: Anyone have notes / test files for METAFONT?

William Adams <[email protected]> Wed, 28 Jun 2017 23:01:22 -0400
Newsgroups gmane.comp.tex.metapost
Message-ID <CAENrYJCqggxv8H9S4xU5oA+zvaEhwFhceo5ascj6RxJVaqPoRg@mail.gmail.com>
Thanks! Picked up a copy of the Millenium Edition of _The METAFONTbook_ in
preparation for this, made one pass through reading it, and need to find
the time and energy for a re-read and to try to do the exercises.

William

On Wed, Jun 28, 2017 at 4:13 AM, luigi scarso <[email protected]>
wrote:

> On Wed, Jun 28, 2017 at 5:56 AM, William Adams <[email protected]>
> wrote:
> > Thanks for the resources!
> >
> >
> > Added the following to my tex.stackexchange query:
> >
> > Okay, given a `METAFONT` eight.mf:
> >     mode_setup;
> >     u# := 2mm#;
> >     define_pixels(u);
> >
> >     beginchar("A", 8u#, 9u#, 5u#);
> >       z1 = ( 0u,  0u);
> >       z2 = ( 8u,  0u);
> >       z3 = ( 1u,  8u);
> >       z4 = ( 7u,  8u);
> >       pickup pencircle scaled 1u#;
> >       draw z4 ..  z1 .. z2 ..  z3 .. cycle;
> >       pickup pencircle scaled 3u#;
> >       drawdot z1;
> >       drawdot z2;
> >       drawdot z3;
> >       drawdot z4;
> >     endchar;
> >
> >     \end
> > we process it using
> >     mf eight.mf
> > and get the file eight.2602gf
> > we then run
> >     gftodvi eight.2602gf
> > which gets us eight.dvi, but when we open that we see:
> > [![eight.dvi screengrab][1]][1]
> >
> >   [1]: https://i.stack.imgur.com/JrRQI.png
> > Ideally I'd like a solution which makes use of lualatex and PDF --- I'd
> like
> > to be able to open up a metafont file in a text editor, tweak / edit it,
> > then compile the project and instantly see it overlaid on a pixel image
> (and
> > possibly surprinted by a vector PDF.
> >
> > I think it's something basic and simple which I'm missing or failing to
> > communicate.
>
>
> GF fonts are bitmap fonts, you can inspect them with gftype -images
> It's quite easy with lua to translate the output of gftype -images
> into a metapost bitmap
> graphics, but also it's not hard  to write a gftype program in lua.
>
> In any case, The METAFONTbook ans a recent texlive (ie the latest
> 2017) are almost a must;
> you can find more info on gftype  with texdoc -l gftype
>
> In principle, wiht luatex  it's possible to use gf (or pk)  font files
> directly without going to dvi:
> it'a a matter of a proper encoding, and right resolution.
> There is an example here, subsection 3
> http://www.guitex.org/home/images/ArsTeXnica/AT021/latino-article.pdf
> Of course, in most cases the same results can be obtained with Metapost,
>
>
> --
> luigi
>

--
http://tug.org/metapost/