Re: Feature request: Addition to functionality of `glyph' primitive

luigi scarso <[email protected]> Tue, 11 Jan 2022 19:49:39 +0100
Newsgroups gmane.comp.tex.metapost
Message-ID <CAG5iGsA0eW_TVHQ_o=+2_2PAb--XnR8hEfMqqK8+zZqkXPDmrw@mail.gmail.com>
On Tue, Jan 11, 2022 at 7:45 PM Laurence Finston <[email protected]>
wrote:

> Hello,
>
> A problem that I've been having with the `glyph' primitive is that it
> doesn't return the bounding box of the glyph and therefore also no
> information about the position of the glyph within the bounding box.  This
> information must be stored somewhere and I've been reading up on the topic,
> but haven't gotten to this point yet.
>
> It would be nice if `glyph' would return this information, e.g., in the
> form of two stroked items in the returned `picture';  one for
> the width X height rectangle and one for width X depth one.
>
> Would it be possible to implement this?
>
> In addition, I downloaded the sources from the SVN repository and tried to
> locate the code for `glyph'.  However, there are so many occurences of the
> string "glyph" that I wasn't able to.  Could someone point me to the right
> place?
>

mp.w:
 27727   case mp_glyph_infont:
  27728     if ((mp_type (p) != mp_string_type &&
  27729          mp_type (p) != mp_known) || (mp->cur_exp.type !=
mp_string_type))
  27730       mp_bad_binary (mp, p, mp_glyph_infont);
  27731     else
  27732       mp_set_up_glyph_infont (mp, p);
  27733     break;

-- 
luigi

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