-
Notifications
You must be signed in to change notification settings - Fork 82
Closed
Description
Font Rendering on Canvas for PSD Previews
To generate visible text pixel data for PSD previews, I render on a canvas (skia-canvas currently) setting:
ctx.font = `${canvasFontStyle} ${fontWeight} ${fontSize}px "${fontFamily}"`;
However, if the canvas cannot recognize or resolve the specified font family, it falls back to a default font, causing the PSD preview text to render incorrectly with the wrong font family.
What I tried:
Registering fonts explicitly with FontLibrary.use() by providing the path of .otf font files, e.g.,
FontLibrary.use('Amandine', ['fonts/fonnts.com-Amandine_Bold_Italic.otf']);
This approach requires having all .otf font files locally, which is not reliable or scalable in environments with many or unknown fonts.
Reactions are currently unavailable
Metadata
Metadata
Assignees
Labels
No labels