1 Reply Latest reply on Feb 1, 2018 10:04 AM by LeoTaro

    FindFont() error

    sameeullahqazi Level 1



      I'm trying to use the FindFont() method as follows:


      error = sAIFont->FindFont("Comic Sans MS", kAIAnyFontTechnology, kRomanAIScript, true, &fontKey);

      FontRef fontRef;

      error = sAIFont->FontFromFontKey(fontKey, &fontRef);

      IFont iFont(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?

      Thank you.