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 change adds a cache for already-seen glyphs. The changes affect mainly the font subpackage.
There is no package API breakage in this change. Although it may cause issues in situations where the selected font is meant to be "transparent". This was not considered is because that feature doesn't work anyway.
There is a plan to make this change conditional, only occuring with foreground colors that have opaque alpha channels.
The change works by inserting a cache into frame/font.StringBG. On each call to StringBG, StringBG checks to see if a glyph from a font face has already been printed. If it has, it accesses an opaque image of the font with that certain background color from its cache and performs a src draw.Draw instead of a draw.Over with the font mask.
Some other housekeeping changes apply to other files, along with some new function that are not used at this time (deconvolution of small/blurry fonts).