How to know the exact number of glyphs for CID keyed fonts?
Francesco Pretto <[email protected]> Mon, 30 Dec 2024 10:32:22 +0100
| Newsgroups | gmane.comp.fonts.freetype.devel |
|---|---|
| Message-ID | <CALas-ihJyZ9rVz_NR1tPBfMbThvQVr6SyP3zp9G_GTODv0i2XQ@mail.gmail.com> |
Hello, I noticed there exists FT_Get_CID_From_Glyph_Index[1] that allows you to access glyphs by a contiguous random index, albeit it may be suboptimal because it still ends requiring glyphs to be accessed with the fetched CID. While this works, I am still missing a method that can return the exact number of contiguous glyphs in a CID keyed font, which can be quite informative. FT_FaceRec.num_glyphs for CID keyed fonts is really the number of last CID - 1, so it's not the correct number. Questions are: - Is there any existing API that I can hack to retrieve the real number of contiguous glyphs in the font? - why isn't there simply a couple of specialized methods to retrieve the real glyph count and to load the glyph by contiguous indices? Cheers, Francesco [1] https://freetype.org/freetype2/docs/reference/ft2-cid_fonts.html#ft_get_cid_from_glyph_index [2] https://freetype.org/freetype2/docs/reference/ft2-face_creation.html#ft_facerec