Package com.pspdfkit.contentediting
Interface ContentEditingFormatter
-
- All Implemented Interfaces:
public interface ContentEditingFormatter
-
-
Method Summary
Modifier and Type Method Description Unit
setFaceName(String faceName)
Sets a font for the current selection/cursor position Unit
setFontSize(Float size)
Sets the font size for the current selection/cursor position Unit
setFontColor(@ColorInt() Integer color)
Sets the font color for the current selection/cursor position Unit
setBold(Boolean bold)
Sets the bold property for the current selection/cursor position Unit
setItalic(Boolean italic)
Sets the italic property for the current selection/cursor position abstract Unit
applyFormat(StyleInfo styleInfo)
Apply the given format to the currently selected content. Boolean
isIncreaseFontSizeEnabled(StyleInfo currentStyleInfo)
Functions called from the ContentEditingStylingBar to handle the increase/decrease fontsize buttons Boolean
isDecreaseFontSizeEnabled(StyleInfo currentStyleInfo)
Unit
increaseFontSize(StyleInfo currentStyleInfo)
Usually we'd increase font-sizes by 1 point. Unit
decreaseFontSize(StyleInfo currentStyleInfo)
abstract Unit
setTextAlignment(Alignment alignment)
abstract Unit
setLineSpacing(Float lineSpacing)
abstract List<Integer>
getAvailableFontSizes()
Returns the supported fontsizes for content text. -
-
Method Detail
-
setFaceName
Unit setFaceName(String faceName)
Sets a font for the current selection/cursor position
-
setFontSize
Unit setFontSize(Float size)
Sets the font size for the current selection/cursor position
-
setFontColor
Unit setFontColor(@ColorInt() Integer color)
Sets the font color for the current selection/cursor position
-
setItalic
Unit setItalic(Boolean italic)
Sets the italic property for the current selection/cursor position
-
applyFormat
abstract Unit applyFormat(StyleInfo styleInfo)
Apply the given format to the currently selected content.
-
isIncreaseFontSizeEnabled
Boolean isIncreaseFontSizeEnabled(StyleInfo currentStyleInfo)
Functions called from the ContentEditingStylingBar to handle the increase/decrease fontsize buttons
-
isDecreaseFontSizeEnabled
Boolean isDecreaseFontSizeEnabled(StyleInfo currentStyleInfo)
-
increaseFontSize
Unit increaseFontSize(StyleInfo currentStyleInfo)
Usually we'd increase font-sizes by 1 point. Except if the current size has a fractional value, the we go first for the next Integer (using the floor or ceil). As limits for increasing and decreasing we take the lowest and highest value of the available font sizes.
-
decreaseFontSize
Unit decreaseFontSize(StyleInfo currentStyleInfo)
-
setTextAlignment
abstract Unit setTextAlignment(Alignment alignment)
-
setLineSpacing
abstract Unit setLineSpacing(Float lineSpacing)
-
getAvailableFontSizes
abstract List<Integer> getAvailableFontSizes()
Returns the supported fontsizes for content text.
-
-
-
-