mtasa-blue icon indicating copy to clipboard operation
mtasa-blue copied to clipboard

LunaSVG: add custom font support

Open Lpsd opened this issue 10 months ago • 4 comments

Makes use of newly added font support with a new Lua API Fonts must be registered before attempting to createSvg referencing the font-family.

bool svgRegisterFont(string fontFamily, string fontPath)
bool svgUnregisterFont(string fontFamily)

Fonts are cached in lunasvg for resource lifetime or until manually unregistered. Loading existing system fonts is also supported (so can load a wider range of default system fonts now) - some discussion here: https://discord.com/channels/801330706252038164/801411628600000522/1458564145984176168 Note: LunaSVG already loads system fonts in our current version, but the latest version improves this

This was tested using a new SVG testing suite resource: svg.zip (say thanks to Claude Opus 4.5, he worked hard on this resource). Just run it and you'll see the UI with various testing presets and tools All seems to be working

Based on #4615 - must be merged after that Awaiting resolution of https://github.com/sammycage/lunasvg/issues/258

Lpsd avatar Jan 08 '26 05:01 Lpsd

This draft pull request is stale because it has been open for at least 90 days with no activity. Please continue on your draft pull request or it will be closed in 30 days automatically.

github-actions[bot] avatar Apr 23 '26 02:04 github-actions[bot]

This draft pull request was closed because it has been marked stale for 30 days with no activity.

github-actions[bot] avatar May 23 '26 03:05 github-actions[bot]

@Lpsd I really liked the idea, but my question is, do you plan to keep it going? Because it will be used a lot and be very useful

tryangelic avatar May 23 '26 23:05 tryangelic

I really liked the idea, but my question is, do you plan to keep it going? Because it will be used a lot and be very useful

This PR requires changes in the vendor library as noted above

Lpsd avatar May 24 '26 08:05 Lpsd