If you want to get a glyph outline, why not just use GetGlyphOutline
? There's the theoretical limitation that this is limited to TrueType fonts, but given the percentage of other fonts typically used on Windows, that's rarely a concern...
Edit: Yes, if you want to avoid using GetGlyphOutline
, using a path instead will work (though only with TrueType fonts, not bitmapped fonts). The sample code included with the documentation for CDC::BeginPath
shows how to do exactly what you seem to be after (though I'd strongly recommend using std::vector
instead of new[]
and delete[]
as it does). One minor detail: that sample includes an implementation of PolyDraw
. You'd only need (or want) this if you need to support ancient 16-bit versions of Windows -- all NT-based versions of Windows include it.