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 system fonts in wxOSX #2499

Merged
merged 2 commits into from Aug 27, 2021
Merged

Cache system fonts in wxOSX #2499

merged 2 commits into from Aug 27, 2021

Conversation

vadz
Copy link
Contributor

@vadz vadz commented Aug 26, 2021

This replaces #2497.

Call CTFontCreateUIFontForLanguage() only once for every
CTFontUIFontType value and cache the results, as it is expensive to do
it every time wxSystemSettings::GetFont() is called.

Closes wxWidgets#19191.

This commit is best viewed ignoring whitespace-only changes.
Use "new" (available since 10.5, for most part) values of the enum
instead of the deprecated ones, which are still defined, but might not
be in the future.

No real changes.
Copy link
Contributor

@csomor csomor left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

thanks for your help, I've verified the normal and small system fonts get cleaned up properly, their ref is at 2 when this module OnExit is called, since there exist local statics in wxWindowMac::DoSetWindowVariant, so only decremented to 1 here, but when the statics get destroyed, ref is down to 0 and data deleted

@vadz vadz merged commit de49566 into wxWidgets:master Aug 27, 2021
@vadz vadz deleted the mac-cache-fonts branch August 27, 2021 12:26
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.

None yet

2 participants