I'm trying to use the FindFont() method as follows:
error = sAIFont->FindFont("Comic Sans MS", kAIAnyFontTechnology, kRomanAIScript, true, &fontKey);
error = sAIFont->FontFromFontKey(fontKey, &fontRef);
The value returned in the error variable is 1430996551 instead of 0 and I'm assuming this indicates an error. I tried to iterate through all fonts using the code snippet SnpText::IterateAllFonts() and it did show "Comic Sans MS". Why then would FindFont() return an error? Further, the FontKey variable contains NULL and an exception is thrown on the SetFont() method.
I've also tried replacing kRomanAIScript with kNativeAIScript without any success.
Can anyone help me with this please?
You need to use the postscript name of the font for the FindFont function. "Comic Sans MS" looks like the display name of the font.