Added support to render OpenType SVG fonts using plutosvg as an alternative to lunasvg (fix #7187) #7927
+46
−9
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Bonjour Omar,
This is a follow up to these related issues:
SVG Fonts include a set of SVG documents. As per the OpenType specification, some SVG fonts (such as NotoColorEmoji) may group several glyphs in a common svg document (by selecting a subset of the elements in this document).
LunaSvg does support fonts where each glyph is associated to a distinct document. Unfortunately, it is not able to render a subset of a svg document, and will likely not be able to do so in the future.
Its cousin project plutosvg (by the same author):
Example: sammycage/lunasvg#150 shows an example where a single svg document included in the font may contains thousands of glyphs (each glyph is a subset of the svg document).
Pros and Cons
Since this commit may add some complexity in the build process here is a study of the pros and cons:
Pros:
Cons:
Compilation hints for plutovg/plutosvg
Compilation hints for plutovg
plutovg/source/*.c
plutovg/include
+plutovg/stb
Compilation hints for plutosvg
plutosvg/source/plutosvg.c
plutosvg/source
PLUTOSVG_HAS_FREETYPE
Demonstration repository
https://github.com/pthom/lunasvg_perf_issue
(a demo repro which can renders all the glyphs of NotoColorEmoji using plutosvg)