Skip to content
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

Smallcache #38

Merged
merged 4 commits into from
Dec 7, 2017
Merged

Smallcache #38

merged 4 commits into from
Dec 7, 2017

Conversation

as
Copy link
Owner

@as as commented Dec 7, 2017

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).

@as
Copy link
Owner Author

as commented Dec 7, 2017

Note; the unprintable glyph replacement hex font has grown by 50%. This increases the visibility of the replacement font at low resolutions.

@as as merged commit 4cf749a into master Dec 7, 2017
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

1 participant