Skip to content
Mat Marquis edited this page Mar 2, 2015 · 9 revisions

Makes the selected text bold.

Selection

Determine whether the selected text is composed entirely of bold text:

arte.state("bold"); // boolean

Make the currently selected text bold:

arte.state("bold", true);

As a syntactical shortcut, the following can be used as well:

arte.bold(true);

Remove bold text from the current selection:

arte.state("bold", false);

As a syntactical shortcut, the following can be used as well:

arte.bold(false);

Toggle bold on the current selection

arte.bold();

This is functionally equivalent to using arte.state("bold", !arte.state("bold"));

Note: When toggling bold using the above method in a run of text that contains bolded and unbolded text, it will first set all text to bold, then function as expected on all subsequent toggles.

Global Use

In the event that no text has been selected, all of the above methods will apply to the entire editable area. In the event that text has been selected but changes are meant to apply to the entire editable area, all of the above methods can be used with the .all object.

For example: arte.all.state("bold", true) will change the entire contents of the editable area to bold regardless of the current selection.