leandro
08/07/2023, 4:00 PMUnsafeMutablePointer<CGGlyph>
to a C function?
Currently I have this. It compiles but the code doens't work:
val foo: CPointer<UShortVarOf<CGGlyph>> = memScoped {
createValues<CGGlyphVar>(2) { CGGlyph.MIN_VALUE }.ptr
}
Landry Norris
08/07/2023, 4:38 PMLandry Norris
08/07/2023, 4:38 PMleandro
08/07/2023, 4:42 PMfun hasGlyph(emoji: String): Boolean = memScoped {
...
val glyphs = createValues<CGGlyphVar>(2) { CGGlyph.MIN_VALUE }.ptr
return@memScoped CTFontGetGlyphsForCharacters(font, uniChars, glyphs, uniChars.size.toLong())
}
Landry Norris
08/07/2023, 4:48 PMuniChars.size
<= 2? Have you verified that uniChars is correct?Landry Norris
08/07/2023, 4:50 PMleandro
08/08/2023, 12:42 PMglyphs
gets populated if it really can be rendered by the OS. That is, I get what I want if I don't check for the return type of CTFontGetGlyphsForCharacters
, but rather from `glyph`s length...