Setting properties of a new (text) paragraph style
Hello,
In the GUI it is possible to create a new paragraph style and give it a Font, Fontsize and color. How can I do this with my plugin?
Currently I do the following:
// create a new named paragraph style
newParaStyle = resources.CreateParaStyle( ai::UnicodeString( styleName, kAIPlatformCharacterEncoding).as_ASUnicode().c_str() );
IParaFeatures paraFeatures;
paraFeatures.SetJustification( kRightJustify);
newParaStyle.SetFeatures( paraFeatures);
ICharFeatures has all the properties I need, so I can do this:
ICharFeatures charFeatures;
charFeatures.SetFontSize( pointSize );
AIFontKey fontKey;
iErr = sAIFont->FindFont( fontName, kAIAnyFontTechnology, kRomanAIScript, true, &fontKey );
if (iErr) throw (iErr);
FontRef fontRef;
iErr = sAIFont->FontFromFontKey( fontKey, &fontRef );
if (iErr) throw (iErr);
IFont iFont( fontRef);
charFeatures.SetFont( iFont);
aSwatch = sAISwatchList->GetSwatchByName( colList, ai::UnicodeString( colName) );
iErr = sAISwatchList->GetAIColor( aSwatch, &colorP);
ApplicationPaintRef paintRef = nil;
sAIATEPaint->CreateATEApplicationPaint( &colorP, &paintRef);
IApplicationPaint paint( paintRef);
charFeatures.SetFillColor( paint);
charFeatures.SetFillOverPrint( ovpFill);
iErr = sAISwatchList->GetSwatchList( docP, &colList);
But how can I attach this charFeatures to my Paragraph? In the GUI the Paragraphsdialog also takes character features. Where are these hidden charFeatures and how are they accessible?
Michael