Copy link to clipboard
Copied
Copy link to clipboard
Copied
Hi @DominikLevitsky I'm not sure this is the best forum to ask about this. I think there are developer forums that might be better, or feedback on the beta version. I'm not sure where is the best place to post or who to tag. @Dirk Becker any ideas about this?
Copy link to clipboard
Copied
Are you sure you got a font key at all? I already had problems using AIFont::FontKeyFromFont …
This likely is caused by the new feature that renders text with missing fonts using the subset embedded in the PDF side of the file, rather than the traditional pink.
Somewhere in prefs there might be a toggle to choose the old behaviour. I have not yet even tried to find it, plus figure out whether it works and via what SDK call, currently using something far more convoluted and waiting for a real fix.
A better place to raise such issues is the SDK section in prerelease, and the associated bugbase.
Copy link to clipboard
Copied
I am definitely getting font keys, because if the fonts are not missing the very same method returns all the font names absolutely correctly. Anyway, I'll try to post in the SDK forum.
Copy link to clipboard
Copied
@DominikLevitsky : This is most likely due to the recent feature that renders text with missing fonts with the embedded glyphs in the PDF. Now, in case of missing fonts, the fontkey will be null.
Could you please explain your workflow. From where are your getting the font key, is it from the selection ? Kindly share the details to let us help you further.
Copy link to clipboard
Copied
I was getting the fonts on document open (kAIDocumentOpenedNotifier) like this:
.......
AIArtHandle textFrameArt = NULL;
result = sAIArtSet->IndexArtSet(textFrameArtSet, 0, &textFrameArt); aisdk::check_ai_error(result);
TextFrameRef textFrameRef = NULL;
result = sAITextFrame->GetATETextFrame(textFrameArt, &textFrameRef); aisdk::check_ai_error(result);
ATE::ITextFrame textFrame(textFrameRef);
ATE::IStory story = textFrame.GetStory();
ATE::IStories stories = story.GetStories();
ATE::ITextRanges textRanges = stories.GetTextRanges();
ATE::ICharInspector charInspector = textRanges.GetCharInspector();
ATE::IArrayFontRef fontRefArray = charInspector.GetFont();
ai::int32 fonts = fontRefArray.GetSize();
.......
ai::int32 i = 0;
while (i < fonts) {
ATE::IFont currentFont = fontRefArray.Item(i);
if (!currentFont.IsNull()) {
FontRef fontRef = currentFont.GetRef();
AIFontKey fontKey = NULL;
result = sAIFont->FontKeyFromFont(fontRef, &fontKey);
aisdk::check_ai_error(result);
char postScriptName[256];
result = sAIFont->GetPostScriptFontName(fontKey, postScriptName, 256);
aisdk::check_ai_error(result);
}
i++;
}
.......
Get ready! An upgraded Adobe Community experience is coming in January.
Learn more