Problem with setting font in a LiveEffect
I'm adding text objects within a LiveEffect plugin.
Firstly, the text objects that are created has the illustrator default font (Myriad-Pro regular), and not the font currently set in the Character style panel (which is the font I get If I create a new text object myself).
Getting the font from the character style dialog is straight forward.
ATE::CharFeaturesRef cfRef; sCurrentTextFeature->GetCurrentCharFeature( &cfRef); ATE::ICharFeatures charFeatures( cfRef); bool isAssigned; ATE::IFont theFont = charFeatures.GetFont( &isAssigned);
Then setting the font within a LifeEffect results in a EXC_BAD_ACCESS error:
TextFrameRef ateTextRef; AIX( sAITextFrame->GetATETextFrame( textArt, &ateTextRef)); ATE::ITextFrame ateText( ateTextRef); ATE::ITextRange ateRange = ateText.GetTextRange(); ICharFeatures charFeatures; charFeatures.SetFont( theFont); ateRange.SetLocalCharFeatures( charFeatures);
I've encountered a number of things that is "illegal" in a live effect, but is legal in a filter. Is this one of them?
Setting the font size works however...