psTypeFace - DfBaseRichEdit

Sets or returns font typeface of selected text

Type: Property

Access: Read/Write

Data Type: String

Parameters: None

 Property String psTypeFace

Read Access: Get psTypeFace to StringVariable
Write Access: Set psTypeFace to StringVariable/Value


Sets or returns the font typeface of the selected text in the control.


This sample returns the typeface of the selected text in control oRichEdit1 to variable sTypeFace and then displays it in a message box to the user.

Procedure SetTypeFace
    string sTypeFace

    get psTypeFace of oRichEdit1 to psTypeFace

    send Info_Box sTypeFace "Current TypeFace"
End_Procedure  // SetTypeFace


This sample sets the typeface of the selected text of control oRichEdit1 to Courier.

Procedure SetTypeFace
    set psTypeFace of oRichEdit1 to "Courier"
End_Procedure  // SetTypeFace

If you get this property and it is not consistent throughout the selection, it will return the psTypeFace value for the first character of the selection, and LastErrorCode will equal ERR_RE_ATTR_INCONSISTENT_THROUGH_SELECTION.


This sample gets the value of psTypeFace, then checks if psTypeFace was not consistent throughout the selected text by checking if LastErrorCode is equal to ERR_RE_ATTR_INCONSISTENT_THROUGH_SELECTION. If so, you can do any special handling you wish in the begin...end code block.

integer iLastErrorCode
string sTypeFace

get psTypeFace to sTypeFace
get LastErrorCode to iLastErrorCode
    // do something