framemaker

How set FontName to TextRange in Framemaker?


This is my code , set font of TextRange

iFont=119, font name ="Tunga"

var oTypedValRp = new TypedVal();
oTypedValRp.valType = Constants.FT_Integer;
oTypedValRp.iVal = iFont;                                                  
oDoc.SetTextVal (oTextRange,Constants.FP_FontFamily, oTypedValRp);  

But Result :TextRange has font name ="Symbol"

Why? How can set font to TextRange?

Thanks all!


Solution

  • i set font ok by code:

    var props = AllocatePropVals(1);  
    props[0].propIdent.num = Constants.FP_FontFamily;  
    props[0].propVal.valType = Constants.FT_Integer;  
    props[0].propVal.ival = iFont;     
    
    oDoc.SetTextProps(textRange, props);