Skip to content

piFontSize - DfBaseRichEdit

Sets or returns font size of selected text

Type: Property
Access: Read/Write
Data Type: integer
Parameters: None

Syntax

Property integer piFontSize
Access Type Syntax
Read Access: Get piFontSize to integerVariable
Write Access: Set piFontSize to integerVariable/Value

Description

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

This property uses twips, which are 1/1440 of an inch, or 1/20 of a printer's point.

Sample

This sample sets the font size of the selected text in control oRichEdit1 to 14 printer's points.

Procedure SetFontSize
    integer iFontSize iPoints

    // number of printer's points
    move 14 to iPoints

    // 20 twips = 1 printer's point
    set piFontSize of oRichEdit1 to (iPoints * 20)
End_Procedure  // SetFontSize

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

Sample

This sample gets the value of piFontSize, then checks if piFontSize 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 iFontSize iLastErrorCode
get piFontSize to iFontSize
get LastErrorCode to iLastErrorCode
if (iLastErrorCode = ERR_RE_ATTR_INCONSISTENT_THROUGH_SELECTION) begin
    // do something
end