ContentEditingFormatter

Interface for formatting text in content editing mode. This interface provides methods to apply various text formatting options such as font family, size, color, bold, and italic to the currently selected text or cursor position in a PDF document.

Properties

Link copied to clipboard
abstract val availableFontSizes: List<Int>

Returns the list of supported font sizes for content text.

Functions

Link copied to clipboard
abstract fun applyFormat(styleInfo: StyleInfo)

Applies the given format to the currently selected content.

Link copied to clipboard
open fun decreaseFontSize(currentStyleInfo: StyleInfo)

Decreases the font size by one point from the current style. If the current size has a fractional value, it rounds down to the previous integer using floor. The minimum size is limited by the lowest value in availableFontSizes.

Link copied to clipboard
open fun increaseFontSize(currentStyleInfo: StyleInfo)

Increases the font size by one point from the current style. If the current size has a fractional value, it rounds up to the next integer using ceil. The maximum size is limited by the highest value in availableFontSizes.

Link copied to clipboard
open fun isDecreaseFontSizeEnabled(currentStyleInfo: StyleInfo?): Boolean

Checks whether the font size can be decreased from the current style.

Link copied to clipboard
open fun isIncreaseFontSizeEnabled(currentStyleInfo: StyleInfo?): Boolean

Checks whether the font size can be increased from the current style.

Link copied to clipboard
open fun setBold(bold: Boolean)

Sets the bold property for the current selection/cursor position.

Link copied to clipboard
open fun setFaceName(faceName: String)

Sets a font for the current selection/cursor position.

Link copied to clipboard
open fun setFontColor(@ColorInt color: Int)

Sets the font color for the current selection/cursor position.

Link copied to clipboard
open fun setFontSize(size: Float)

Sets the font size for the current selection/cursor position.

Link copied to clipboard
open fun setItalic(italic: Boolean)

Sets the italic property for the current selection/cursor position.

Link copied to clipboard
abstract fun setLineSpacing(lineSpacing: Float)

Sets the line spacing for the current selection/cursor position.

Link copied to clipboard
abstract fun setTextAlignment(alignment: Alignment)

Sets the text alignment for the current selection/cursor position.