> I need to obtain the glyph index and that could be done using the
> two methods .i.e * FTC_CMapCache_Lookup
> <https://www.freetype.org/freetype2/docs/reference/ft2-cache_subsystem.html#ftc_cmapcache_lookup>*
> and *FT_Get_Char_Index
> <https://www.freetype.org/freetype2/docs/reference/ft2-base_interface.html#ft_get_char_index>*
> .

IMHO, `FT_Get_Char_Index' is sufficient.  For displaying single
characters in `ftinspect' (or a bunch of them once in a separate
window for ftview-like stuff) you don't need a cache for speeding up
things.

> - Now, Considering FTC_CMapCache_Lookup, it expects int type
>   character code which is fine but along with that, it expects index
>   of character map which is being used but since it could have more
>   than one character map, index of which character map should be
>   provided or how to know which character map is being used?

`FTC_CMapCache_Lookup' is agnostic of the cmap.  It simply caches
(cmap index, character code, glyph index) triplets.  If the glyph
index is not in the cache, the function uses the cmap index value to
temporarily switch to the proper cmap before accessing the character
code.

Normally, an application uses a single cmap only.  In that case you
would set up the cmap in advance, then passing -1 as the value for the
cmap index to the function.


    Werner

_______________________________________________
Freetype-devel mailing list
[email protected]
https://lists.nongnu.org/mailman/listinfo/freetype-devel

Reply via email to