On Mon Sep 11 11:58:50 2023 +0000, Nikolay Sivov wrote:
There is a helper called get_char_sa() in dwrite, is it too far off? Another, possibly more important, question I have is how does this work for GGO_GLYPH_INDEX? Isn't 'glyph' already an index in that case? ('index' argument is unused by the way)
The `get_char_sa` function is *really close* to what Windows seems to hardcode (doesn't take from the font's data). It doesn't match 1:1, but it's similar enough that there is definitely strong correlation.
`glyph` here is a bit of a misnomer that I carried over from the calling `get_glyph_outline` function, where it's also called that. `glyph` is the unicode character code (BMP only), `index` is the index in the font that the character was found in.
I wrapped the whole function in an `if (!(format & GGO_GLYPH_INDEX))` for now, but I will need to test how `GGO_GLYPH_INDEX` is handled, and I dropped the `index` parameter.
Note that I will be splitting up this MR into two parts, one for the gdi part and one for the gdiplus part.