forked from ocornut/imgui
-
Notifications
You must be signed in to change notification settings - Fork 2
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Fix OpenType SVG fonts rendering with LunaSVG 3.0 (by @sammycage)
This is a follow up to these related issues: - ocornut#7187 (which may need to be reopened, since there is a real rendering issue in ImGui) - sammycage/lunasvg#150 ---- SVG Fonts include a set of SVG documents. As per the [OpenType specification](https://learn.microsoft.com/en-us/typography/opentype/spec/svg#glyph-identifiers), 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 did not originally support fonts where each glyph is associated to a distinct document. LunaSvg 3.0.0 now supports this feature This PR thus adds support for LunaSvg (3.0.0), and its author (@sammycage) was kind enough to provide a patch for ImGui: sammycage/lunasvg#150 (comment) Notes ----- - WARNING: the API of LunaSVG has changed inside the latest version (3.0.0): the current code inside imgui_freetype.cpp (without this PR) is not compatible with it! A test for this was added in imgui_freetype.cpp: ```cpp #ifndef LUNASVG_VERSION_MAJOR #error IMGUI_ENABLE_FREETYPE_LUNASVG requires LunaSvg version >= 3.0 #endif #if !(LUNASVG_VERSION_MAJOR >= 3) #error IMGUI_ENABLE_FREETYPE_LUNASVG requires LunaSvg version >= 3.0 #endif ``` - Performance: NotoColorEmoji-Regular is now correctly loaded in approx 1 second (versus > 1 hour with current ImGui) - Alternative PR, using PlutoSvg instead of LunaSvg: There is an alternative PR that would replace LunaSvg by PlutoSvg (ocornut#7927). We will likely have to choose between those two. The present PR does not propose to replace LunaSvg by PlutoSvg, but to update LunaSvg to the latest version. - Demonstration repository: https://github.com/pthom/lunasvg_perf_issue / branch "lunasvg_patch_oct24"
- Loading branch information
Showing
1 changed file
with
121 additions
and
73 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters