On 2026-03-25 Nguyễn Gia Phong via discussion of the GNU roff typesetting 
system and related software wrote:

> Hi,
>
> I want to be able to typeset the maps to symbol in arrow notation,
> e.g. n ↦ n + 1.  The Unicode code point for the character is U+21A6.
>
> Please let me know what I can do to make it happen.

This glyph is not included in the stock groff font files, so first you may
want to see if an externally installed groff font file (in case you have
any) has this glyph. I have some fonts in ~/.groff/fonts, so I would do

  $ grep -r -o 21A6 .groff/fonts
   
.groff/fonts/devpdf/LinuxBiolinumG.pfa:21A6
..

If you haven't any externally installed fonts, then you need to find out
which *.ttf or *.otf font file on your system includes it:

  $ fc-list :charset=21A6
  
Many font files on my system do, e.g. /usr/share/fonts/TTF/LinBiolinum_R_G.ttf

Next, you must convert and install that, or some other font file, to a groff
font file. There is a script, install-font.sh, which was included as part of
groff in version 1.24.0. Take note of the name of the groff version of the
font file. Let's say the name is LinBiolinumRGR. Then the notation

   \f[LinBiolinumRGR]\[u21A6]\f[]

will make the glyph appear in your document. If you need it more than once,
then of course making an alias definition to it near the top of your
document would look a little nicer

   .char \[arrow] \f[LinBiolinumRGR]\[u21A6]\f[]

Then you may just refer to it like this:

  \[arrow]

My own editing mode for the Jed editor, which I announced some time ago,
makes all of this extremely easy. You may actually use it from the command
line, like this: 
  
   $ jed -f groff_mode -f groff_install_font
   $ jed -f groff_mode -f groff_insert_glyph

You may search for a glyph both by name and by hex.

Regards,
Morten


  • ... Nguyễn Gia Phong via discussion of the GNU roff typesetting system and related software
    • ... Morten Bo Johansen
      • ... Nguyễn Gia Phong via discussion of the GNU roff typesetting system and related software
        • ... G. Branden Robinson
          • ... Nguyễn Gia Phong via discussion of the GNU roff typesetting system and related software
        • ... Morten Bo Johansen

Reply via email to