Skip to main content

Text Formatting

Options listed below can must be set using the plug-in page item attribute Initialization JavaScript Code, see an example below.

Initialization JavaScript Code
function( pOptions ){
pOptions.optionName = optionValue;
return pOptions;
}

Font family​

fontFamily​

The option fontFamily defines available fonts for a document.

image-20240419144245005

fontFamilySelection​

The option fontFamilySelection is a boolean flag enabling or disabling preview of the current font family in the toolbar for the currently focused paragraph.

image-20240419151149534

fontFamilyDefaultSelection​

The option fontFamilyDefaultSelection defines what text is displayed when the font family is unknown or nothing is selected.

image-20240419150038451

Font size​

fontSize​

The option fontSize defines the font sizes that appear under the Font Size button from the rich text editor's toolbar.

image-20240419152404396

fontSizeSelection​

The option fontSizeSelection is a boolean flag enabling or disabling preview of the current font size in the toolbar for the currently focused paragraph.

image-20240419152901588

fontSizeDefaultSelection​

The option fontSizeDefaultSelection defines what text is displayed when the font size is unknown or nothing is selected.

image-20240419152156882

fontSizeUnit​

The option fontSizeUnit defines the unit to be used for the font size.

Initialization JavaScript Code
function( pOptions ){
pOptions.fontSizeUnit = 'px';
return pOptions;
}

Styling text​

inlineStyles​

The option inlineStyles defines inline styles applicable to the currently selected text in a document. To remove inline style, the toolbar button clear formatting must be used.

For example, applying default style Big Red results in adding inline styles to currently selected text:

<span style="font-size: 20px; color: red;">United Codes Rich Text Editor Pro</span>

inlineClasses​

The option inlineClasses defines CSS class names applicable to the currently selected text in a document. To remove class, the toolbar button clear formatting must be used.

For example, applying default class Highlighted results in adding class fr-class-highlighted to currently selected text:

<span class="fr-class-highlighted">United Codes Rich Text Editor Pro</span>
Notice about inline classes

Inline classes are only visible when a document is displayed along with a custom CSS rules.

Colors​

colorsBackground​

The option colorsBackground defines colors available in color popup for text background.

image-20240419140738955

colorsText​

The option colorsText defines colors available in color popup for selected text.

image-20240419142611652

colorsStep​

The option colorsStep defines how many colors are displayed in a row in popup for text and background.

image-20240419141209780

colorsHEXInput​

The option colorsHEXInput allows applying custom HEX color through color popup input. When disabled, the color input is not available.

image-20240419135357878