export function parseFontStyle(fontString) { let fontWeight, fontSizeAndLineHeight, fontFamily const parts = fontString.match(/(?:[^\s"]+|"[^"]*"|'[^']*')+/g) if (parts) { [fontWeight, fontSizeAndLineHeight, ...fontFamily] = parts fontFamily = fontFamily.join(' ').replace(/["']/g, '') } const [fontSize, lineHeight] = fontSizeAndLineHeight.split('/') return { family: fontFamily, size: fontSize, weight: fontWeight, lineHeight, } }