Support for RGBA font atlases and custom font engines (+ bitmap fonts) #40
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.
In video games development one often needs to render arbitrary icons/images as part of text (game currency icons, game fractions icons, etc). Rendering them outside of text layout system is proven to be difficult (especially for cases like image-in-between-text). In current shape fontstash doesn't have two features required: color in fonts and bitmap fonts.
To be as less controversial as possible this PR avoids introducing bitmap font engine, simply because it's not obvious which format to choose from (there are many variants of
.fnt
fonts and they are barely interchangeable) and bringing-in whole bitmap font parsing could be a bit too much.Instead this PR focuses on two major enablers:
I've also added a simple barebone example how new functionality could be used: here is an "animated" icon in a middle of the phrase, and the icon also has shadow which would be quite difficult to do other way around.
Please let me know if I can improve this PR.