font/utils
Constants
-
FONT_BACKGROUND_COLOR : 'fontBackgroundColor'module:font/utils~FONT_BACKGROUND_COLORThe name of the font background color plugin.
-
FONT_COLOR : 'fontColor'module:font/utils~FONT_COLORThe name of the font color plugin.
-
FONT_FAMILY : 'fontFamily'module:font/utils~FONT_FAMILYThe name of the font family plugin.
-
FONT_SIZE : 'fontSize'module:font/utils~FONT_SIZEThe name of the font size plugin.
Type Definitions
-
module:font/utils~FontColorSelectorDropdownView -
module:font/utils~FontConverterDefinition
Functions
-
addColorSelectorToDropdown( options = { options.colorPickerLabel, options.colorPickerViewConfig, options.colors, options.columns, [options.documentColorsCount], [options.documentColorsLabel], options.dropdownView, options.removeButtonLabel } ) → ColorSelectorViewinternalmodule:font/utils~addColorSelectorToDropdownA helper that adds
ColorSelectorViewto the color dropdown with proper initial values.Parameters
options : objectConfiguration options
Propertiesoptions.colorPickerLabel : stringThe label for the color picker button.
options.colorPickerViewConfig : false | ColorPickerViewConfigConfiguration of the color picker view.
options.colors : Array<ColorDefinition>An array with definitions representing colors to be displayed in the color selector.
options.columns : numberThe number of columns in the color grid.
[ options.documentColorsCount ] : numberThe number of document colors inside the dropdown.
[ options.documentColorsLabel ] : stringThe label for the section with document colors.
options.dropdownView : FontColorSelectorDropdownViewThe dropdown view to which a
ColorSelectorViewwill be added.options.removeButtonLabel : stringThe label for the button responsible for removing the color.
Returns
ColorSelectorViewThe new color selector view.
-
buildDefinition( modelAttributeKey, options ) → FontConverterDefinitioninternalmodule:font/utils~buildDefinitionBuilds a proper converter definition out of input data.
Parameters
modelAttributeKey : stringoptions : Array<FontFamilyOption> | Array<FontSizeOption>
Returns
-
renderDowncastElement( styleAttr ) → ( modelAttributeValue: string, __namedParameters: DowncastConversionApi ) => ViewAttributeElementinternalmodule:font/utils~renderDowncastElementA font color and font background color helper responsible for downcasting a color attribute to a
<span>element.Note: The
styleAttrparameter should be either'color'or'background-color'.Parameters
styleAttr : string
Returns
( modelAttributeValue: string, __namedParameters: DowncastConversionApi ) => ViewAttributeElement
-
renderUpcastAttribute( styleAttr ) → ( viewElement: ViewElement ) => stringinternalmodule:font/utils~renderUpcastAttributeA font color and font background color helper responsible for upcasting data to the model.
Note: The
styleAttrparameter should be either'color'or'background-color'.Parameters
styleAttr : string
Returns
( viewElement: ViewElement ) => string