Open main menu
Archive This is an archive of past discussions. Do not edit the contents of this page. If you wish to start a new discussion or revive an old one, please do so on the current talk page.

Screw SVG nominal sizes

 
Try to read this graph. :(

Commons has some wonderful SVG vector graphics that unfortunately become unusable because their small nominal size. This causes little problems when viewed through their Commons page, as Commons offer a number of sizes from 200px to 2000px for rendering the SVG file as a PNG image. The problem arises when viewing the image on Wikipedia. The Wikipedia pop-up image viewer shows the image at the nominal size, which may be little larger then the thumbnail size used in the article.

I guess Wikipedia or the Wikimedia software could address the issue by showing vector graphics at a larger resolution. But let's first see what we can do on Commons. The first step would be creating an image cleanup template {{SVG too small}}. Some bot could then change the size data embedded in the SVG file. Maybe we could have some automated system for identifying problem graphics.

Currently there seems to be no way of addressing this issue. I year ago I marked File:Thermal conductivity.svg with a cleanup template. Nothing has happened in a year. Today I ran into File:PEM fuelcell.svg. I guess it would look good when viewed on a 5 years old smartphone. -- Petri Krohn (talk) 04:42, 23 March 2017 (UTC)

The real solution would be to fix the image viewer (I strictly avoid it). AnonMoos (talk) 15:51, 27 March 2017 (UTC)
Both illustrations are poor and little used.
File:Thermal conductivity.svg is a one-dimensional graph with some strange 2D data points. Thermal grease has a nice range, but why does Portland cement have any vertical component to it at all? It is not a good graph.
File:PEM fuelcell.svg is too busy and has redundant labels (oxygen flow explanation, oxidant with arrows showing flow, and oxidant flow field). Detailed descriptions in a figure are too detailed and almost impossible to translate in the same space. The figure should label the structures, but it should not have a description of how the cell works. That description should be in the articles where the illustration is used. Figures should not have a lot of text (and neither should captions).
Glrx (talk) 17:34, 6 April 2017 (UTC)

File:Global Terrorism Index 2016 by country.svg thumbnail is not colored

  Resolved

Could this be another one of those librsvg bugs? The thumbnail and PNG export are not colored, but the full file displayed in Chromium 57.0.2987.98 browser and Inkscape 0.92 is colored.

What could be done? Faking type="text/css" in second stylesheet, or using one <style/> only? I don't have previous experience with this issue. WubTheCaptain (talk) 15:06, 11 April 2017 (UTC)

Found the answer myself with Commons:Commons SVG Checker, it's the attribute type (phab:T68672). WubTheCaptain (talk) 15:24, 11 April 2017 (UTC)

Inkscape fonts not recognized

Hello all

 
Badly rendered SVG

This question involves the use of Wikimedia Commons supported fonts in Inkscape where the resulting SVG fails to convert to PNG properly. I believe this is a font substitution issue. I am using Inkscape 0.92.1 on Ubuntu Linux 16.10.

I spent quite some time trying to identify this problem and look for solutions and bug reports. Indeed I made myself some notes on the topic here. The fonts I used are:

  • Liberation Sans : Bold (the title)
  • DejaVu Sans : Normal and Bold (the annotation)

I checked the conversion locally using rsvg-convert and that worked fine.

Concentrating just on DejaVu. Here are the current related fonts on the Wikimedia server farm (filtered from https://noc.wikimedia.org/conf/fc-list):

DejaVu Sans Mono:style=Bold
DejaVu Sans Mono:style=Book
DejaVu Sans:style=Bold
DejaVu Sans:style=Book
DejaVu Serif:style=Bold
DejaVu Serif:style=Book

Here are the fonts on my Ubuntu Linux system (fc-list output, duly filtered and formatted):

DejaVuSans-BoldOblique.ttf                DejaVu Sans                                       style=Bold Oblique
DejaVuSans-Bold.ttf                       DejaVu Sans                                       style=Bold
DejaVuSansCondensed-BoldOblique.ttf       DejaVu Sans,DejaVu Sans Condensed                 style=Condensed Bold Oblique,Bold Oblique
DejaVuSansCondensed-Bold.ttf              DejaVu Sans,DejaVu Sans Condensed                 style=Condensed Bold,Bold
DejaVuSansCondensed-Oblique.ttf           DejaVu Sans,DejaVu Sans Condensed                 style=Condensed Oblique,Oblique
DejaVuSansCondensed.ttf                   DejaVu Sans,DejaVu Sans Condensed                 style=Condensed,Book
DejaVuSans-ExtraLight.ttf                 DejaVu Sans,DejaVu Sans Light                     style=ExtraLight
DejaVuSansMono-BoldOblique.ttf            DejaVu Sans Mono                                  style=Bold Oblique
DejaVuSansMono-Bold.ttf                   DejaVu Sans Mono                                  style=Bold
DejaVuSansMono-Oblique.ttf                DejaVu Sans Mono                                  style=Oblique
DejaVuSansMono.ttf                        DejaVu Sans Mono                                  style=Book
DejaVuSans-Oblique.ttf                    DejaVu Sans                                       style=Oblique
DejaVuSans.ttf                            DejaVu Sans                                       style=Book

And here is an extract from the offending SVG file:

    <text
       xml:space="preserve"
       style="font-style:normal;font-variant:normal;font-weight:normal;font-stretch:normal;font-size:4.23333311px;line-height:110.00000238%;font-family:'DejaVu Sans';-inkscape-font-specification:'DejaVu Sans, Normal';font-variant-ligatures:normal;font-variant-caps:normal;font-variant-numeric:normal;font-feature-settings:normal;text-align:start;letter-spacing:0px;word-spacing:0px;writing-mode:lr-tb;text-anchor:start;fill:#000000;fill-opacity:1;stroke:none;stroke-width:0.26458332px;stroke-linecap:butt;stroke-linejoin:miter;stroke-opacity:1"
       x="196.34752"
       y="93.929092"
       id="text5013"><tspan
         sodipodi:role="line"
         id="tspan5015"
         x="196.34752"
         y="93.929092">Prices for fossil fuels and </tspan><tspan
         sodipodi:role="line"
         id="tspan5017"
         x="196.34752"
         y="98.585762">carbon-intensive products </tspan><tspan
         sodipodi:role="line"
         x="196.34752"
         y="103.24242"
         id="tspan5019">increase</tspan></text>

Maybe the "Normal" qualifier has something to do with it? I don't know where Inkscape got that from. But "Normal" doesn't explain the full story. Any comments and suggestions would be really welcome. With best wishes. RobbieIanMorrison (talk) 12:16, 6 April 2017 (UTC)

Hey RobbieIanMorrison, I mean it is rendered in that font, what we see here unfortunately is bug phab:T36947. PS: Many of the style attributes in your example are senseless or not interpreted (especially line-height, font-stretch, stroke anyway). -- User: Perhelion 13:48, 6 April 2017 (UTC)
Many thanks Perhelion. And for adding my example to the bug thread. I'll wait and see how things develop. But you are right, this is a priority bug. Best wishes. RobbieIanMorrison (talk) 15:37, 6 April 2017 (UTC)
@RobbieIanMorrison: Not at all! Current workaround would be to use a font-size of approximately 75px, so you must change the dimension of your graphic. Then you can test it on COM:Commons SVG Checker. Keep working! :-) PS: I would also crop some space around it. -- User: Perhelion 16:46, 6 April 2017 (UTC)
Thanks again Perhelion. Noted. I will experiment and test on the Commons SVG checker as you suggest. Regarding the excessive white space, you are quite correct. Am still thinking about how to use the one SVG file for PDF export (with some air around the diagram) and as a Wikimedia Commons graphic (with a tighter crop). Perhaps a smaller page object (canvass) and a white A4 rectangle which can either be visible or hidden. With best wishes. RobbieIanMorrison (talk) 07:19, 7 April 2017 (UTC)
Good, maybe you(we can use/create some template like {{Whitespace is intentional}} (counter part of {{Trimming}}) or a very similar one {{Border is intentional}} (counter part of {{Remove border}}), similar to {{Original}}. -- User: Perhelion 11:29, 7 April 2017 (UTC)
@RobbieIanMorrison: Incidentally I found this, with nothing to find. -- User: Perhelion 09:33, 14 April 2017 (UTC)