fix(cli): icon should render explicit svg text node fonts (fix: #10022)#10039
Merged
amrbashir merged 2 commits intotauri-apps:devfrom Jun 12, 2024
Merged
fix(cli): icon should render explicit svg text node fonts (fix: #10022)#10039amrbashir merged 2 commits intotauri-apps:devfrom
amrbashir merged 2 commits intotauri-apps:devfrom
Conversation
amrbashir
requested changes
Jun 12, 2024
Member
amrbashir
left a comment
There was a problem hiding this comment.
Thank you, this PR is almost ready to go, could you please add a change file in .changes directory?
…-apps#10022) added a .change file for the fix
Contributor
Author
|
Sure. Added a |
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
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
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 iconagainst 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 thatfc-matchselects. 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.