-
Notifications
You must be signed in to change notification settings - Fork 230
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
C-API resvg_options_set_font_family
doesn't work in release v0.28.0
#566
Comments
Do you have the While there were indeed some changes to |
Yes, the Using |
The only thing that have changed is the missing font resolving. If It seems like the issue is with your SVG. Does your SVG has a missing font? |
The SVG I'm using does not have a If I use I am using |
This is very strange. |
I've tried calling both with the same value, and |
I found the bug. I was handling missing |
You can try master branch. I will publish a new release later this week. |
I've tried it and it still doesn't work unfortunately. |
Can you add For me, when rendering an SVG without
And it matches |
It doesn't print anything. I'm using resvg as a static library, and don't really know rust. |
I did tried using resvg via C API and it works just fine. Can you provide a sample of your SVG? |
Also, if |
Can you try emulating your use case using c-api/examples/cairo/example.c? Do you load system fonts at all? |
Dumb question, but have you rebuild your project from scratch after updating resvg? Otherwise it will still be using non-fixed version. |
I think I've solved the problem. In v0.27.0, the font family set using In v0.28.0, the font family set using The default values I got when I added
All I did was remove the |
So your SVG does have |
The SVG I'm using doesn't have |
Maybe this condition wasn't actually needed then? |
Can you send me a sample SVG? |
|
The current logic is correct and works as expected. I have no idea why it's broken for you. I'm missing some info. Can you add: dbg!(&font_family);
dbg!(&families); to |
It seems you're correct. |
Try adding And then Somehow, a font resolving is either skipped or failed. |
I've realized that the problem I was facing was caused by an SVG that had As the list of font names wasn't empty, the font family I was providing was being ignored. That's why the change I made in #567 made text render as it did in v0.27.0 when the fallback font was always being added to the list. Sorry I got my SVGs mixed up. I've attached the SVG I'm talking about. |
Great! No problem. There were indeed a bug with missing Just to clarify, the value set by |
Hello, I tried to use the function in my C++ project as I've done before, but when rendering the svg, text is not displayed after providing a font and calling the function with the font family. This used to work in releases before v0.28.0.
I see in the commit history that this function was removed then added back, so maybe something was missed when reverting that change?
The C++ project I'm referring to is: https://github.com/ANSH3LL/Graphics-Extensions-for-Solar2D and the line where I'm using the function is: https://github.com/ANSH3LL/Graphics-Extensions-for-Solar2D/blob/23151db1257915cf0aaa47df7728f6c0c4291b30/shared/PluginGfxe.cpp#L772
The text was updated successfully, but these errors were encountered: