freetypy.Face.get_char_variant_index¶
-
Face.
get_char_variant_index
()¶ Return the glyph index of a given character code as modified by the variation selector.
Parameters: charcode : int
The character code point in Unicode.
variantSelector : int
The Unicode code point of the variation selector.
Returns: glyph_index : int
The glyph index. 0 means either ‘undefined character code’, or ‘undefined selector code’, or ‘no variation selector cmap subtable’, or ‘current CharMap is not Unicode’.
Notes
If you use FreeType to manipulate the contents of font files directly, be aware that the glyph index returned by this function doesn’t always correspond to the internal indices used within the file. This is done to ensure that value 0 always corresponds to the ‘missing glyph’.
This function is only meaningful if a) the font has a variation selector cmap sub table, and b) the current charmap has a Unicode encoding.