freetype-devel
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: [ft-devel] [GSoC'19] ftinspect questions


From: Werner LEMBERG
Subject: Re: [ft-devel] [GSoC'19] ftinspect questions
Date: Wed, 03 Jul 2019 07:43:07 +0200 (CEST)

> 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



reply via email to

[Prev in Thread] Current Thread [Next in Thread]