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

Implements font glyph cache sharing between multiple sources #275

Merged
merged 1 commit into from May 13, 2023

Conversation

cipharius
Copy link
Contributor

Primarily fonts are cached based on the following properties: font file, font size, horizontal and vertical DPI.

Unfortunately the loaded fonts can be mutated by changing their hinting and style.
Due to these mutations an extra indirection is required for font struct access, so that it would be possible to fork cached font and apply the mutation on the new copy. This ensures that other references to the original font are not affected by local mutation.

Although such indirection and forking considerably increases caching complexity, it comes with benefits such as amortising font style changes in heavily formatted text, which normally would require glyph cache flush on every font style or hinting change.

@cipharius cipharius changed the title Implements font glyph cache sharing between multiple sources WIP: Implements font glyph cache sharing between multiple sources Mar 21, 2023
@cipharius cipharius changed the title WIP: Implements font glyph cache sharing between multiple sources Implements font glyph cache sharing between multiple sources Mar 21, 2023
src/engine/arcan_ttf.c Outdated Show resolved Hide resolved
@letoram letoram merged commit 8080da8 into letoram:master May 13, 2023
2 checks passed
@cipharius cipharius deleted the feature/shared-glyph-cache branch May 13, 2023 18:25
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
2 participants