[HarfBuzz] How to get a glyph code for a character?

Richard Wordingham richard.wordingham at ntlworld.com
Sat May 25 14:50:38 UTC 2019

On Sat, 25 May 2019 17:26:02 +0300
Eli Zaretskii <eliz at gnu.org> wrote:

> One of the methods an Emacs font-backend should provide is the
> encode_char method, which returns the glyph code of the selected font
> for a character given by its Unicode codepoint.  For example, the XFT
> backend uses the XftCharIndex function for that purpose, and the
> Freetype backend uses FT_Get_Char_Index.

> What is the best way of providing such a method with HarfBuzz on
> MS-Windows?  One possibility is obviously to call hb_shape, but maybe
> there's a simpler way for a single codepoint?

I presume you're after the glyph indicated by the raw cmap, e.g.
without localisation.  Using hb_shape could very well result in the
addition of a dotted circle for a combining mark - is that what you


More information about the HarfBuzz mailing list