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

fix(cli): icon should render explicit svg text node fonts (fix: #10022) #10039

Merged
merged 2 commits into from
Jun 12, 2024

Conversation

roylaurie
Copy link
Contributor

This fixes the first problem mentioned in #10022: SVG text nodes are generally not rendering in cargo tauri icon.

After applying this patch, it should be observed that running cargo tauri icon against an SVG with a <text> node no longer warns about not finding fonts that exist on a (Linux) system. Further, visually reviewing the resulting image files created should now show text rendered.

However, the correct font is still not selected for generic font-families on Linux systems that are using fontconfig. This includes "sans-serif", "sans", "comic", etc. In reviewing the fontdb library, which is used for font selection, I found that the font that the library selects for generic families is not the one that fc-match selects. There is no warning associated here, the user would have to visually confirm that this is the case.

The fontdb team is aware of the issue and has an open issue for it:
fontdb: Support automatic determination of default family names on Linux from fontconfig #24

For the time being, I would recommend explicitly defining the exact font to use in an SVG, which is typically the case anyway. Of course, distributing the font with the SVG would ensure better cross-platform compatibility regardless.

@roylaurie roylaurie requested a review from a team as a code owner June 11, 2024 20:04
Copy link
Member

@amrbashir amrbashir left a comment

Choose a reason for hiding this comment

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

Thank you, this PR is almost ready to go, could you please add a change file in .changes directory?

@roylaurie
Copy link
Contributor Author

Sure. Added a .changes file.

Copy link
Member

@amrbashir amrbashir left a comment

Choose a reason for hiding this comment

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

Thank you

@amrbashir amrbashir merged commit 79542f4 into tauri-apps:dev Jun 12, 2024
11 checks passed
pewsheen pushed a commit to pewsheen/tauri that referenced this pull request Jun 13, 2024
…-apps#10022) (tauri-apps#10039)

* fix(cli): icon should render explicit svg text node fonts (fix: tauri-apps#10022)

* fix(cli): icon should render explicit svg text node fonts (fix: tauri-apps#10022)

added a .change file for the fix
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