refactor(ComparisonView): unify pretext font string generation with a utility function
This commit is contained in:
@@ -0,0 +1,11 @@
|
||||
/**
|
||||
* Formats a font configuration into a string format required by @chenglou/pretext.
|
||||
*
|
||||
* @param weight - Numeric font weight (e.g., 400).
|
||||
* @param sizePx - Font size in pixels.
|
||||
* @param fontName - The font family name.
|
||||
* @returns A formatted font string: `"weight sizepx \"fontName\""`.
|
||||
*/
|
||||
export function getPretextFontString(weight: number, sizePx: number, fontName: string): string {
|
||||
return `${weight} ${sizePx}px "${fontName}"`;
|
||||
}
|
||||
Reference in New Issue
Block a user