I've had a problem with tracking fonts. I can load the font image just fine, but when I call CreateFont() it returns 0x80070057 (E_INVALIDARG), which isn't a documented return code for CreateFont(). This all happens after GapiDraw is initialized & whatnot.
Bearing in mind using the font files for the two font types (SimpleFont.png and SampleFont.png from the SDK), if I tell it to create a bitmap font w/ SimpleFont, it works, but when I try a tracking font using SampleFont, it fails with that error code.
My code, for what its worth (surf being a CGapiBitmapFont reference, and IDR_SAMPLEFONT is a valid resource ID w/ data):
HRESULT hr;
hr = surf->CreateSurface(GDSURFACE_SYSTEMMEMORY, hInst, IDR_SAMPLEFONT, _T("PNG"));
hr = surf->CreateFont(NULL, RGB(255,0,255), GDCREATEFONT_TRACKING, NULL);
Bearing in mind using the font files for the two font types (SimpleFont.png and SampleFont.png from the SDK), if I tell it to create a bitmap font w/ SimpleFont, it works, but when I try a tracking font using SampleFont, it fails with that error code.
My code, for what its worth (surf being a CGapiBitmapFont reference, and IDR_SAMPLEFONT is a valid resource ID w/ data):
HRESULT hr;
hr = surf->CreateSurface(GDSURFACE_SYSTEMMEMORY, hInst, IDR_SAMPLEFONT, _T("PNG"));
hr = surf->CreateFont(NULL, RGB(255,0,255), GDCREATEFONT_TRACKING, NULL);