InputFormat Object
Description
The InputFormat object represents all formatting attributes at the current text input position. If text is selected and the selection has no common value for a certain attribute, the corresponding property is null.
Syntax
InputFormatExamples
The following example demonstrates InputFormat in a practical document-editing workflow. The InputFormat object represents all formatting attributes at the current text input position. If text is selected and the selection has no common value for a certain attribute, the corresponding property is null.
function onTxError(error) {
console.error("TX Text Control error:", error.msg);
error.handled = true;
}
TXTextControl.inputFormat.getAllFrameLines(
function(result) {
if (result) {
console.log("get all frame lines is available.");
} else {
console.warn("get all frame lines is not available in the current document state.");
}
},
onTxError
);Members
Methods
| Method | Description |
|---|---|
| addEventListener | The addEventListener function registers event listener functions on the InputFormat object. |
| getAllFrameLines | Gets a value specifying whether all frame lines, including all inner frame lines, are set for the selected text. |
| getBold | Gets a value specifying whether text is bold at the current input position. |
| getBottomAligned | Gets a value specifying whether text is bottom aligned at the current input position. |
| getBottomDistance | Gets bottom's paragraph distance, in twips, at the current input position. |
| getBoxFrame | Gets a value specifying whether there is a complete frame around the text. |
| getBulletCharacter | Gets the bullet character at the current input position. |
| getBulletedList | Gets a value specifying whether there is a bulleted list at the current input position. |
| getCentered | Gets a value specifying whether text is centered at the current input position. |
| getFontFamily | Gets the font family at the current input position. |
| getFontSize | Gets the font's size, in points, at the current input position. |
| getFrameFillColor | Gets the color used to display the frame fill color at the current input position. |
| getFrameLineColor | Gets the color used to display the color of frame lines at the current text input position. |
| getFrameLineWidth | Gets the line width, in twips, of the paragraph's or table's frame at the current input position. |
| getHangingIndent | Gets the hanging indent, in twips, at the current input position. |
| getInnerHorizontalFrameLines | Gets a value specifying whether all inner horizontal frame lines are set for the selected text. |
| getInnerVerticalFrameLines | Gets a value specifying whether all inner vertical frame lines are set for the selected text. |
| getItalic | Gets a value specifying whether the text is italic at the current input position. |
| getJustified | Gets a value specifying whether text is justified at the current input position. |
| getLeftAligned | Gets a value specifying whether text is left aligned at the current input position. |
| getLeftFrameLine | Gets a value specifying whether there is a frame line at the left side of the text. |
| getLeftIndent | Gets the left indent, in twips, at the current input position. |
| getLeftToRight | Gets a value specifying whether the writung direction is left-to-right at the current input position. |
| getLinespacing | Gets the line spacing, in percent, at the current input position. |
| getNumberedList | Gets a value specifying whether there is a numbered list at the current input position. |
| getNumberedListFormat | Gets the number format for a numbered list at the current input position. |
| getNumberFormats | Gets an array of all supported number formats for numbered and structured lists. |
| getRightAligned | Gets a value specifying whether text is right aligned at the current input position. |
| getRightFrameLine | Gets a value specifying whether there is a frame line at the right side of the text. |
| getRightIndent | Gets the right indent, in twips, at the current input position. |
| getRightToLeft | Gets a value specifying whether the writing direction is right-to-left at the current input position. |
| getStrikeout | Gets a value specifying whether the text is strikeout at the current input position. |
| getStructuredList | Gets a value specifying whether there is a structured list at the current input position. |
| getStructuredListFormat | Gets the number format for a structured list at the current input position. |
| getStructureLevel | Gets the structure level of all selected paragraphs. The level can be between 0 and 10. A level of 0 indicates that the paragraph belongs to the body of the document. |
| getStyleName | Gets the formatting style name at the current input position. |
| getStyleNames | Returns an array of the names of all formatting styles, the document contains. |
| getSubscript | Gets a value specifying whether text is subscript at the current input position. |
| getSuperscript | Gets a value specifying whether text is superscript at the current input position. |
| getSupportedFontFamilies | Returns an array of strings specifying all supported fonts. |
| getSupportedFontSizes | Gets an array of strings specifying all possible font sizes for the font at the text input position. If the font is free scalable, standard sizes are returned. The return value is the list of possible font sizes. Null is returned, if the specified font is not supported or if text is selected and the selection contains several different fonts. |
| getSupportedUnderlineStyles | Gets an array of all supported underline styles. |
| getTextBackColor | Gets the color used to display the text's background color at the current input position. |
| getTextColor | Gets the color used to display the text at the current input position. |
| getTopAligned | Gets a value specifying whether text is top aligned at the current input position. |
| getTopDistance | Gets a top paragraph distance, in twips, at the current input position. |
| getTopFrameLine | Gets a value specifying whether there is a frame line at the top of the text. |
| getUnderline | Gets a value specifying whether text is underlined at the current input position. |
| getUnderlineStyle | Gets a value specifying the style at the current input position. |
| getVerticallyCentered | Gets a value specifying whether text is vertically centered at the current text input position. |
| removeEventListener | The removeListener function removes the specified event listener from the InputFormat object. |
| setAllFrameLines | Sets a value specifying whether all frame lines, including all inner frame lines, are set for the selected text. |
| setBold | Sets a value specifying whether text is bold at the current input position. |
| setBottomAligned | Sets a value specifying whether text is bottom aligned at the current input position. |
| setBottomDistance | Sets a bottom paragraph distance, in twips, at the current input position. |
| setBoxFrame | Sets a value specifying whether there is a complete frame around the text. |
| setBulletCharacter | Sets the bullet character at the current input position. |
| setBulletedList | Sets a value specifying whether there is a bulleted list at the current input position. |
| setCentered | Sets a value specifying whether text is centered at the current input position. |
| setFontFamily | Sets the font family at the current input position. |
| setFontSize | Sets the font's size, in points, at the current input position. |
| setFrameFillColor | Sets the color used to display the frame fill color at the current input position. |
| setFrameLineColor | Sets the color used to display the color of frame lines at the current text input position. |
| setFrameLineWidth | Sets the line width, in twips, of the paragraph's or table's frame at the current input position. |
| setHangingIndent | Sets the hanging indent, in twips, at the current input position. |
| setInnerHorizontalFrameLines | Sets a value specifying whether all inner horizontal frame lines are set for the selected text. |
| setInnerVerticalFrameLines | Sets a value specifying whether all inner vertical frame lines are set for the selected text. |
| setItalic | Sets a value specifying whether the text is italic at the current input position. |
| setJustified | Sets a value specifying whether text is justified at the current input position. |
| setLeftAligned | Sets a value specifying whether text is left aligned at the current input position. |
| setLeftFrameLine | Sets a value specifying whether there is a frame line at the left side of the text. |
| setLeftIndent | Sets the left indent, in twips, at the current input position. |
| setLeftToRight | Sets a value specifying whether the writung direction is left-to-right at the current input position. |
| setLinespacing | Sets the line spacing, in percent, at the current input position. |
| setNumberedList | Sets a value specifying whether there is a numbered list at the current input position. |
| setNumberedListFormat | Sets the number format for a numbered list at the current input position. |
| setRightAligned | Sets a value specifying whether text is right aligned at the current input position. |
| setRightFrameLine | Sets a value specifying whether there is a frame line at the right side of the text. |
| setRightIndent | Sets the right indent, in twips, at the current input position. |
| setRightToLeft | Sets a value specifying whether the writing direction is right-to-left at the current input position. |
| setStrikeout | Sets a value specifying whether the text is strikeout at the current input position. |
| setStructuredList | Sets a value specifying whether there is a structured list at the current input position. |
| setStructuredListFormat | Sets the number format for a structured list at the current input position. |
| setStructureLevel | Sets the structure level of all selected paragraphs. The level can be between 0 and 10. A level of 0 indicates that the paragraph belongs to the body of the document. |
| setStyleName | Sets the formatting style name at the current input position. |
| setSubscript | Sets a value specifying whether text is subscript at the current input position. |
| setSuperscript | Sets a value specifying whether text is superscript at the current input position. |
| setTextBackColor | Sets the color used to display the text background color at the current input position. |
| setTextColor | Sets the color used to display the text at the current input position as a CSS color string. |
| setTopAligned | Sets a value specifying whether text is top aligned at the current input position. |
| setTopDistance | Sets a top paragraph distance, in twips, at the current input position. |
| setTopFrameLine | Sets a value specifying whether there is a frame line at the top of the text. |
| setUnderline | Sets a value specifying whether text is underlined at the current input position. |
| setUnderlineStyle | Sets a value specifying the style at the current input position. |
| setVerticallyCentered | Sets a value specifying whether text is vertically centered at the current text input position. |