Adds line breaks to a string every x pixels, using string-pixel-width for measuring the width.
Returns an object containing the new string and the number of lines.
Only fonts measured by the string-pixel-width library are supported.
Be careful: This check excludes arrays, even though they are objects in JavaScript.
Merge plugin default settings with incoming config settings.
Any default setting can be set to an object with a 'merge' custom function. In that case this function is responsible for merging the incoming setting with default settings. The custom merge function will get the incoming setting as first parameter and should return the merged setting.
the incoming config settings
the default settings object, possible containing objects with custom merge functions
Given a relation member, returns the other relation member
the relation
the first relation member
the second relation member
Splits a string at least every x characters. If useSpaces is true,
Returns an array of substrings.
Splits a string every x pixels, using string-pixel-width for measuring the width of the current line.
Returns an array of substrings with width <= maxWidth.
Only fonts measured by the string-pixel-width library are supported.
Generated using TypeDoc
Sanitization methods for config settings. These can be used for simple type checking and overwriting config settings.
Plugins should use these methods together with mergeDefaults.