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

Behdad Esfahbod behdad at behdad.org
Sat May 25 15:01:31 UTC 2019


On Sat, May 25, 2019 at 10:26 AM 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?
>

hb_font_get_nominal_glyph().

Use of such facilities in an application is quite suspect though.


> Btw, what does hb_font_get_glyph() return?
>

Boolean indicating whether the font supports that character.


> TIA
> _______________________________________________
> HarfBuzz mailing list
> HarfBuzz at lists.freedesktop.org
> https://lists.freedesktop.org/mailman/listinfo/harfbuzz



-- 
behdad
http://behdad.org/
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <https://lists.freedesktop.org/archives/harfbuzz/attachments/20190525/6a4ba481/attachment.html>


More information about the HarfBuzz mailing list