Re: Beginners question

[email protected] Tue, 12 Sep 2023 17:27:25 +0200
Newsgroups gmane.comp.tex.metapost
Message-ID <trinity-0f30b00c-929f-44ec-a06d-2807933d95a9-1694532445436@3c-app-gmx-bs46>
> but I have no idea how this can be implemented or if it has any drawbacks.

Apart from checking plain.mp and the MP manual, the way to find out whether something can be implemented or not is to refer to "The METAFONTbook", particularly the two chapters on macros (definitions), i.e., 18 and 20.  "MetaPost:  A User's Manual" probably doesn't provide enough information.

> Gesendet: Dienstag, 12. September 2023 um 17:18 Uhr
> Von: [email protected]
> An: "Patrick Gundlach" <[email protected]>
> Cc: [email protected]
> Betreff: Re: [metapost] Beginners question
>
> > thank you for your answer, I was more thinking of the interface than the usage of fonts. I have my own font implementation that I would like to use in > metapost.
>
> According to the table on page 80 of "MetaPost:  A User's Manual", `draw' is a macro defined in plain.mp, so I suggest you look up how it's defined there.  On my system (TeXLive) it's here:  /usr/share/texlive/texmf-dist/metapost/base/plain.mp
>
> However, I don't think it does anything than `label' would.  What do you mean by "font implementation"?  Are they PostScript or METAFONT (bit-map) fonts?  There is no particular difficulty in defining a macro using `def' or `vardef' to insert text, but I don't know if it's possible to get the exact syntax you want.  I haven't read through Taco's solution.
>
> > Gesendet: Dienstag, 12. September 2023 um 15:35 Uhr
> > Von: "Patrick Gundlach" <[email protected]>
> > An: [email protected]
> > Betreff: Re: [metapost] Beginners question
> >
> > Hello Laurence,
> >
> > > Am 12.09.2023 um 15:24 schrieb [email protected]:
> > >
> > > In your example, you use a low-level command. Normally, one uses `label' or `dotlabel' to include text in a MetaPost file and this is what I'd recommend.
> >
> > thank you for your answer, I was more thinking of the interface than the usage of fonts. I have my own font implementation that I would like to use in metapost.
> >
> > Currently I have something like:
> >
> > def mytext(expr t, fnt, style) =
> >    runscript("sometext{"& fnt & ":" & style & ":" & t &"}")
> > enddef;
> >
> > to be used like
> >
> > draw mytext( "my text to be output", "Meta Pro", "regular");
> >
> > and I was thinking if this is a good interface.
> >
> > I really like the macros like:
> >
> > draw "my text to be output" infant "Meta Pro" withstyle "regular";
> >
> > but I have no idea how this can be implemented or if it has any drawbacks.
> >
> > Patrick
> >
> >
> >
> > --
> > http://tug.org/metapost/
> >
>
> --
> http://tug.org/metapost/
>

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