• Global community
    • Language:
      • Deutsch
      • English
      • Español
      • Français
      • Português
  • 日本語コミュニティ
    Dedicated community for Japanese speakers
  • 한국 커뮤니티
    Dedicated community for Korean speakers
Exit
1

FindFont() error

Community Beginner ,
Jan 31, 2018 Jan 31, 2018

Copy link to clipboard

Copied

Hi,

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);

features.SetFont(iFont);

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.

TOPICS
SDK

Views

476

Translate

Translate

Report

Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
Adobe
Advocate ,
Feb 01, 2018 Feb 01, 2018

Copy link to clipboard

Copied

LATEST

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.

Votes

Translate

Translate

Report

Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines