Setting the font


i trying figure out how set font , have come up far:

 

aifontkey fontkey;

error = saifont->findfont( "arial", kaianyfonttechnology, kromanaiscript, true, &fontkey );

if (error) throw (error);

fontref fontref;

error = saifont->fontfromfontkey( fontkey, &fontref );

if (error) throw (error);

ifont ifont( fontref);

features.setfont( ifont);

 

i not sure if doing correct. took of code form post, was  not sure how implement code.

 

i trying set font , using below code set font size , position of text:

 

ate::iparafeatures justif;

ate::icharfeatures features;

justif.setleadingtype(ate::kromanleadingtype);

justif.setstartindent(kairealzero);

justif.setfirstlineindent(kairealzero);

features.settracking(kairealzero);

//justification.

justif.setjustification(kcenterjustify);

//size

features.setfontsize(10);

aiarthandle artgroup = null;

error = saiart->getfirstartoflayer(null, &artgroup);

aisdk::check_ai_error(error);

// add new point text item layer.

aitextorientation orient = khorizontaltextorientation;

airealpoint anchor = {this->fendpoint.h,this->fendpoint.v-4};

aiarthandle textframe = null;

error = saitextframe->newpointtext(kplaceaboveall, artgroup, orient, anchor, &textframe);

aisdk::check_ai_error(error);

// set contents of text range.

textrangeref range = null;

error = saitextframe->getatetextrange(textframe, &range);

aisdk::check_ai_error(error);

itextrange crange(range);

crange.setlocalcharfeatures(features);

crange.setlocalparafeatures(justif);

crange.insertafter("x");

 

 

any daniel

what behaviour seeing? have working in our plugin, should able figure out, first need know & isn't working. font? everything?



More discussions in Illustrator SDK


adobe

Comments

Popular posts from this blog

Hur installera Joomla på One.com - Joomla! Forum - community, help and support

removing index.php from URL address - Joomla! Forum - community, help and support

「イメージマップのアンカー名には、...」のエラーが出ないようにしたい