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

Increase local fonts priority (resvg.exe) #771

Open
Dimon-II opened this issue Jun 2, 2024 · 4 comments
Open

Increase local fonts priority (resvg.exe) #771

Dimon-II opened this issue Jun 2, 2024 · 4 comments

Comments

@Dimon-II
Copy link

Dimon-II commented Jun 2, 2024

Local fonts may contain a modified version of a font installed in the system. It makes sense to use local fonts first, without refusing to load system fonts.

main.rs
...
fn load_fonts

Change the call sequence

fontdb.load_system_fonts();
and

    for path in &args.font_dirs {
        fontdb.load_fonts_dir(path);
    ...
@RazrFalcon
Copy link
Collaborator

I don't think fontdb cares about fonts order at the moment. Will think about it.

@Dimon-II
Copy link
Author

Dimon-II commented Jun 2, 2024

As far as I understand, the first loaded system font of the same name either prevents the local font from loading, or when selecting a font by name, it appears first.

@RazrFalcon
Copy link
Collaborator

Technically, having the same font family twice is already a bug. But checking for uniqueness would be expensive, therefore we do not do this.

I will think about a proper solution.

@Dimon-II
Copy link
Author

Dimon-II commented Jun 2, 2024

I encountered this situation during testing colored SVG icons font.
I wanted to have a local version of the font having game icons aligned with the text. When working with resvg.dll, I changed the font loading order. It seems to me that this is a logical option for an executable file as well.

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

No branches or pull requests

2 participants