Page MenuHomePhabricator

Liberation Sans font-family don't work in SVG rendering for SVG files created with Adobe Illustrator
Closed, DuplicatePublic

Description

The font family Liberation Sans is a free font, and mentioned in the compatible fonts list : https://meta.wikimedia.org/wiki/SVG_fonts. But this font don't work and is badly rendered by Wikimedia Commons render system : see https://commons.wikimedia.org/wiki/File:Text_test_file.svg and https://commons.wikimedia.org/wiki/File:Isotope_CNO.svg for example.

Do you know where does this bug come from ?

Event Timeline

Here it does work without problems in the SVG rendering; the problem is only in the PNG thumbnail of the SVG image?

Yes, the SVG is working (on Chrome and Firefox) but if you look to the PNG render (the first one in the Commons page) you can see that the 4 different font-families I used are rendered in the same font family.

The render font families are on the left, right fonts are vectorized one (just to be sure you are looking the good side).

@Aklapper I found from where does this bug come from. The problem is Illustrator and he got also others problems when he saves files in SVG. To fix the bug I did this :

  • open the .ai (file format of Illustrator) in Inkscape (I didn't know it was possible but it works perfectly);
  • save the file in SVG with Inkscape.
Aklapper renamed this task from Liberation Sans font-family don't work in SVG rendering to Liberation Sans font-family don't work in SVG rendering for SVG files created with Adobe Illustrator.Apr 24 2018, 6:00 PM

This is the same bug as T184369. AI is putting quotation marks around the font name, and librsvg gets confused by the marks.

Here's the style element from an early version of the file:

<style type="text/css">
.st0{fill:#0000FF;}
.st1{fill:#FFFFFF;}
.st2{fill:#00FF00;}
.st3{fill:#FF0000;}
.st4{font-family:'Arial-BoldMT';}
.st5{font-size:25px;}
.st6{fill:none;stroke:#000000;stroke-width:3;stroke-miterlimit:10;}
.st7{font-family:'ArialMT';}
.st8{font-size:20px;}
.st9{font-family:'Arial-BoldItalicMT';}
</style>

So this should be closed as a duplicate.

By the way, setting the font family to Arial-BoldItalicMT is not the right method. It should be

font-family:Arial;
font-weight:bold;
font-style:italic;

@Glrx: You can close tasks as duplicate via Edit Related Tasks...Close As Duplicate

@Glrx this you said about the

Arial-BoldMT

is set by default in Illustrator, and it is the subject of T25643.