Sets text formatting (bold, italic, color, font, size) for rich text.
Takes richTextBoxID (Int), bold (Int), italic (Int), underline (Int), fontSize (Int), fontName (String), colourR (Int), colourG (Int), and colourB (Int).
Returns 1 on success, 0 if rich text box not found.
BGI GUI
Parameters & Returns
Parameters
richTextBoxIDInt
boldInt
italicInt
underlineInt
fontSizeInt
fontNameString
colourRInt
colourGInt
colourBInt
Returns
Int
Quick Summary
Sets text formatting (bold, italic, color, font, size) for rich text.
Takes richTextBoxID (Int), bold (Int), italic (Int), underline (Int), fontSize (Int), fontName (String), colourR (Int), colourG (Int), and colourB (Int).
Returns 1 on success, 0 if rich text box not found.
Technical Exegesis...
Sets text formatting attributes for a rich text box control. Searches gizmoMap for the rich text box ID. Creates CHARFORMATW structure with CFM_BOLD | CFM_ITALIC | CFM_UNDERLINE | CFM_SIZE | CFM_FACE | CFM_COLOR mask. Sets bold/italic/underline effects based on non-zero parameters (CFE_BOLD, CFE_ITALIC, CFE_UNDERLINE). Converts fontSize to twips (1 point = 20 twips), defaults to 10pt if zero or negative. Converts fontName from UTF-8 to wide string, defaults to Arial if empty.
Sets text formatting attributes for a rich text box control. Searches gizmoMap for the rich text box ID. Creates CHARFORMATW structure with CFM_BOLD | CFM_ITALIC | CFM_UNDERLINE | CFM_SIZE | CFM_FACE | CFM_COLOR mask. Sets bold/italic/underline effects based on non-zero parameters (CFE_BOLD, CFE_ITALIC, CFE_UNDERLINE). Converts fontSize to twips (1 point = 20 twips), defaults to 10pt if zero or negative. Converts fontName from UTF-8 to wide string, defaults to Arial if empty. Sets color with RGB(colourR, colourG, colourB). Stores format in richTextFormatMap for bgiAppendRichText. If text is selected, applies format with EM_SETCHARFORMAT (SCF_SELECTION). If no selection, sets format for insertion point with SCF_SELECTION and SCF_DEFAULT, then gives focus. Returns 1 on success, 0 if rich text box not found.
This function controls text appearance in rich text boxes. When text is selected, immediately applies format to selection. When no text is selected, sets the format for subsequent typed or appended text. Bold/italic/underline parameters are boolean (0=off, non-zero=on). Font size is in points (typical: 8-72). Font name examples: "Arial", "Courier New", "Times New Roman". Color RGB values are 0-255. Use bgiSetRichTextSelection to select text ranges before applying format. Common pattern: select all with (0, -1), apply format, deselect with (0, 0).