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

Cache glyph sizes for tabular numbers #470

Closed
CryZe opened this issue Nov 6, 2021 · 0 comments · Fixed by #490
Closed

Cache glyph sizes for tabular numbers #470

CryZe opened this issue Nov 6, 2021 · 0 comments · Fixed by #490
Labels
enhancement An improvement for livesplit-core. performance Affects the performance of the code. rendering The issue or pull request is affecting the rendering.

Comments

@CryZe
Copy link
Collaborator

CryZe commented Nov 6, 2021

A lot of our labels are shaped with tabular numbers. For that we manually position the digits based on the widest digit in the font. At the moment we query the font for those 10 digit glyphs every time we want to update a label, even if it is already shaped. We can almost definitely cache it within the font itself when loading it.

@CryZe CryZe added enhancement An improvement for livesplit-core. rendering The issue or pull request is affecting the rendering. performance Affects the performance of the code. labels Nov 6, 2021
kadiwa4 added a commit to kadiwa4/livesplit-core that referenced this issue Dec 11, 2021
Fixes LiveSplit#470.
The max digit width is now calculated when the font is loaded, even
if that font is never used for tabular numbers.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement An improvement for livesplit-core. performance Affects the performance of the code. rendering The issue or pull request is affecting the rendering.
Projects
None yet
Development

Successfully merging a pull request may close this issue.

1 participant