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

Invisible text in svgs after updating to 0.3.0 #870

Closed
PotatoSquid opened this issue May 7, 2021 · 3 comments · Fixed by #1908
Closed

Invisible text in svgs after updating to 0.3.0 #870

PotatoSquid opened this issue May 7, 2021 · 3 comments · Fixed by #1908
Labels
Milestone

Comments

@PotatoSquid
Copy link

PotatoSquid commented May 7, 2021

An svg in iced 0.2.0:

svg in iced 0 2 0

The same svg in iced 0.3.0:

svg in iced 0 3 0

Code:

iced_svg_test.zip

@hecrj hecrj added the feature New feature or request label May 17, 2021
@hecrj
Copy link
Member

hecrj commented May 17, 2021

I think this is caused by resvg switching its renderer to tiny-skia, which does not support text (yet?).

@alec-deason
Copy link
Contributor

I believe this is happening because resvg needs the convert_text method to be called on trees before they are rendered. But that requires a fontdb::Database loaded with fonts. I have a draft PR up (#1908) that shows doing that by naively loading all system fonts, the same way resvg's command line tool does it. And that works for my test case but it seems like the wrong approach given that iced already has a text system with a fontdb::Database in the iced_tiny_skia/iced_wgpu::text::Pipeline structs.

Since I'm brand new to this code base it's not obvious to me how the font database should be shared between the text pipeline and the svg pipeline, but it seems like it should. I'll poke around some more and see if I can work it out but I'd love guidance if anyone has some.

@alec-deason
Copy link
Contributor

I updated the PR with a possible approach to sharing the font database across systems. It feels like it has some ugliness in how the database references get passed around but it works. I'd still love anyone's thoughts on how best to handle this.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
3 participants