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

feat: reload font by updating config and use Rc instead of Arcs #63

Merged
merged 1 commit into from
Dec 15, 2024

Conversation

JarKz
Copy link
Contributor

@JarKz JarKz commented Dec 15, 2024

Motivation

The font doesn't reloads when the config file updates because of expensiveness. I mean that some font files are large like nerd-fonts. So I decided do it more later. Now I think the application is ready to reload fonts.

Main changes

I figured out that there is not need to use Arc<T> because it is enough to throw the Renderer initialization into child thread and initialize the InternalChannel separately. So, now in the renderer module uses Rc<RefCell<T>> which is faster than atomic analogues.

With it I've added the font reload after checking the font name. If the font names are same, font won't reload.

@JarKz JarKz requested a review from jsonmaf1a December 15, 2024 11:50
@JarKz JarKz self-assigned this Dec 15, 2024
@JarKz JarKz merged commit 44abdb4 into main Dec 15, 2024
5 checks passed
@JarKz JarKz deleted the reload-font branch December 15, 2024 12:13
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants