Even if this works this way, glyph class test looks suspicious to me, I still think it's misplaced. This most likely should be a part of larger shaping handling, we need to figure out the extent of it in legacy shaping system of gdi32, and do something similar. For example. does GetTextExtentExPoint() work for Arabic text at all? A simple test would be to test lam-alef ligature with some font that's using a single glyph for it, and see what's returned for extents.