export class TextLogicFunctions { public static getTextVerticalHeight( text: string, pixelFontSize: number, lineHeight: number, ) { const totalTextHeight = pixelFontSize * lineHeight * text.split('\n').length; return totalTextHeight; } public static getRelativeTextSize( fontSize: string, parentRenderedWidth: number, parentLifesizedWidth: number, ) { const parsedFontSize = parseInt( fontSize, 10, ); const scaledFontSize = parsedFontSize * ( parentRenderedWidth / parentLifesizedWidth ); const measurement = fontSize .replace(parsedFontSize.toString(), ''); return scaledFontSize + measurement; } }