-
-
Notifications
You must be signed in to change notification settings - Fork 380
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Use SVG icons in PiGui fonts #5608
Merged
Merged
Conversation
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
Allow rendering wiith user-provided material and transform Allow inverting DrawData size for Y-flip
The new names follow convention better and correctly reflect the fact that these are widely available generic data formats.
- Avoid copying and modifying the entire reference font-face chain with every font instance - Allow ImGUI to determine which font face is responsible for a glyph - Simplify handling multiple font files and improve maintainability - Architecture supports modifying font definitions with new faces at runtime
- Also pass reference to owning application to avoid need to reference Pi namespace inside PiGui::Instance
Allow loading SVG icons into an existing PiFont, using the same existing mechanisms for glyph tracking and font size handling as character fonts. This massively simplifies using icons in editor code, and will improve the quality of icons in the main game as well.
- Allows using a more familiar and less complex syntax when iterating over files.
Existed only for OldUI/NewUI, entirely obsoleted by PiGui font handling.
- Remove old/unused font definitions - Provide definitions for monospace, icon-only, and current pionillium/orbiteer fonts - Avoids compiling icon grid size into binary (instead, need to update all font definition json files on change)
- If a font doesn't provide a used glyph in any of its faces, avoid constantly rebuilding the font atlas every frame. - Remove PiFont::sortUsedRanges, as ImFontGlyphRangesBuilder already provides the same functionality.
sturnclaw
force-pushed
the
font-icons
branch
2 times, most recently
from
August 25, 2023 08:55
667d366
to
54f1c69
Compare
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
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.
This is a fun one - I've refactored the PiGui font handling to be a bit more efficient, and added support for loading icons from our icons.svg file as font glyphs (using the Unicode Private Use Range). This allows icon rendering to take advantage of the same pipeline for on-demand glyph rendering and font size management as regular text rendering, and when integrated will solve some issues with icon blurriness our current icon rendering system has.
This PR only implements the technical capability to load icons from SVG files and does not convert any Lua code to use the new capability.
TODO: