nothings / stb

stb single-file public domain libraries for C/C++
https://twitter.com/nothings
Other
26.37k stars 7.69k forks source link

[stb_truetype] How to read all avaliable codepoints ? #674

Open RodrigoSantiago opened 5 years ago

RodrigoSantiago commented 5 years ago

Using FreeType I simply do the following:

FT_ULong  charcode;
FT_UInt   gindex;
charcode = FT_Get_First_Char( face, &gindex );
while (gindex != 0) {
    charcode = FT_Get_Next_Char( face, charcode, &gindex );
}

It is possible to iterate through the glyphs with 'numGlyphs', but I do not know how to associate the glyph to a codepoint

nothings commented 5 years ago

Yes, I am positive there was another issue for this previously, but I can't find it now. It should definitely be added.

pixelblender commented 5 years ago

Could it be #405 ?

henrik-lindqvist commented 4 years ago

Was this ever implemented?

nothings commented 4 years ago

I don't think so.

If you're writing an offline tool it's maybe not too expensive to just iterate from 1 to 0xEFFFF and call stbtt_FindGlyphIndex though.