I am trying to load a font from my resources. This is the call I use, which currently returns NULL and therefore fails:
HRSRC rsrcData = FindResource(NULL, MAKEINTRESOURCE(IDF_ROBOTBLACK), L"FONT");
I added the font resource to my Resource.rc file, which now lists the following:
/////////////////////////////////////////////////////////////////////////////
//
// Font
//
IDF_ROBOTBLACK FONT "Resources\\Fonts\\Roboto\\Roboto-Black.ttf"
Additionally, this is what my Resource.h looks like:
#define IDF_ROBOTBLACK 108
As far as I can tell, this should be all there is to the whole process.
I already successfully managed to load another resource format, "PNG", which was added as a new, custom resource type as well, following the same procedure while only replacing "FONT" with "PNG" where it is due.
However, compared to my "PNG" loading approach, the "FONT" is never found. FindResource returns NULL, no matter what happens.
The error code returend by GetLastError() is 1813.
My concern is that .ttf is not really supported at all. I previously added all kinds of formats to my solutions resources, like .exe and .png, .jpg, but .ttf was not even suggested in the file picker when adding the resource.
Is it just not meant to be stored this way?