Open igormironchik opened 6 months ago
Can't reproduce, I just tried rendering both with resvg
and this is what I get:
And how it's possible? Did you try C-API in viewsvg
tool?
What command did you use to generate PNG
?
Hm, I tried:
./resvg paragraph_after.svg 1.png
Warning (in usvg::text::layout:1229): No match for 'sans-serif' font-family.
Warning (in usvg::text::layout:1229): No match for 'sans-serif' font-family.
Warning (in usvg::text::layout:1229): No match for 'sans-serif' font-family.
Warning (in usvg::text::layout:1229): No match for 'sans-serif' font-family.
Warning (in usvg::text::layout:1229): No match for 'sans-serif' font-family.
Warning (in usvg::text::layout:1229): No match for 'sans-serif' font-family.
Warning (in usvg::text::layout:1229): No match for 'sans-serif' font-family.
Warning (in usvg::text::layout:1229): No match for 'sans-serif' font-family.
Warning (in usvg::text::layout:1229): No match for 'sans-serif' font-family.
Warning (in usvg::text::layout:1229): No match for 'sans-serif' font-family.
Warning (in usvg::text::layout:1229): No match for 'sans-serif' font-family.
Warning (in usvg::text::layout:1229): No match for 'sans-serif' font-family.
Warning (in usvg::text::layout:1229): No match for 'sans-serif' font-family.
Maybe this issue is because of missing font?
Hey, I caught it! On Windows
everything is fine! This issue is on Linux
only! Check on Linux
please.
What does fc-match sans-serif
returns on your Linux machine?
Also try running ./resvg paragraph_after.svg 1.png --list-fonts
fc-match sans-serif
Arimo-Regular.ttf: "Arimo" "Regular"
./resvg paragraph_after.svg 1.png --list-fonts
prints:
And ./resvg paragraph_after.svg 1.png
produces PNG
without text at all.
Try calling ./resvg --list-fonts
using the latest commit and paste the first 5 lines here. It should look something like:
serif: Times New Roman
sans-serif: Arial
cursive: Comic Sans MS
fantasy: Impact
monospace: Courier New
I've got:
serif: Times New Roman
sans-serif: Arial
cursive: Comic Sans MS
fantasy: Impact
monospace: Courier New
Ok, so your SVG file requests sans-serif
, which fontconfig
resolves as Arial, but there is no Arial font on your machine.
Can you try calling fc-match --format=%{file} sans-serif
or fc-match --format=%{file} Arial
?
Sure, resvg could try fallbacking to a random font, but it doesn't do this now.
Even worse, I guess resvg fails to read fontconfig
to begin with. fc-match
reports Arimo
as sans-serif
, no Arial
.
I guess your fontconfig
config is so complicated that the library we use to parse it fails. No sure if it can be fixed... Try using explicit font names for now.
I guess this issue is basically this: https://github.com/RazrFalcon/fontdb/issues/24
fc-match --format=%{file} sans-serif
fc-match --format=%{file} sans-serif
/usr/share/fonts/truetype/croscore/Arimo-Regular.ttf
fc-match --format=%{file} Arial
fc-match --format=%{file} Arial
/usr/share/fonts/truetype/croscore/Arimo-Regular.ttf
No sure if it can be fixed... Try using explicit font names for now.
Sure, I will workaround this.
I guess this issue is basically this: https://github.com/RazrFalcon/fontdb/issues/24
Don't know. You know better. I said - you know :)
The following
SVG
files render wrong withresvg
.With
resvg
they render like: