@gpa-gemstone/helper-functions
Version:
Helper Functions for gpa-gemstone packages
14 lines (13 loc) • 762 B
TypeScript
/**
* GetTextWidth returns the width of a piece of text given its font, fontSize, and content.
* @param font: Determines font of given text
* @param fontSize: Determines size of given font
* @param word: Text to measure
* @param cssStyle: Optional css style
* @param height: Optional set height of measurement (default: 'auto')
* @param whiteSpace: Optional white space arguement (default: 'no-wrap')
* @param containerWidth: Optional width of the container wrapping the text, useful when the text is multiline and width is limited
* @returns Width of text
*/
declare function GetTextWidth(font: string, fontSize: string, word: string, cssStyle?: string, height?: string, whiteSpace?: string, containerWidth?: string): number;
export { GetTextWidth };