Commons:Graphics village pump/January 2020

From Wikimedia Commons, the free media repository
Jump to navigation Jump to search

Diagonally striped pattern on svg country map

Hello guys, I'm trying to fill countries with a diagonally striped pattern on a svg world map in this kind of style, however, just filling countries instead of regions would be fine. Colors should be able to be determined with the ability to create transparent stripes. There are instructions on how to entirely fill and circle countries, but the above feature is missing. Anyone here who could extend the instructions or comment? Would like to use this map outside of Wikipedia in case there are different rendering requirements. — Preceding unsigned comment added by MiMoHo (talk • contribs) 09:42, 11 April 2018 (UTC)

User:MiMoHo I've uploaded a new version of the map. You can replace the fill of any country by changing its class="xxx" code to fill="url(#diagonalHatch)". See if that is good enough. Ian Furst (talk) 20:40, 9 January 2020 (UTC)
@Ian Furst: I don't think uploading a broken version (an SVG that doesn't validate anymore) for an image which is widely used across multiple Wiki projects – in order just to teach a user how to do a style element – is a proper way to go here. I've reverted the file to the previous version. @MiMoHo: if you want to do striping, either look at an older revision that User:Ian Furst uploaded (which I'm not sure does the trick validly, at least from the SVG-standard perspective), or take a look at File:G20.svg for another (working and SVG-valid!) example of how this is done. Cherkash (talk) 00:06, 10 January 2020 (UTC)

Text / display issue

I uploaded an SVG with both graphics and text. I have uploaded hundreds, probably thousands over the years, but this one is not displaying properly. I did not do the original graphic it is based on, but I did redo the text labels, or some of them. I thought it might be some hidden code in the SVG, but it displays correctly in one format and not in another: in the PNG conversion something goes wrong.

The file is: Map of Queen Elizabeth Land, BAT.svg (also Map of Queen Elizabeth Land & BAT in Antarctica.svg).

I have tried many times with this one. When the SVG standards changed recently and a new version of Inkscape with it, I resaved it, and redefined every the text object. I used Liberation Sans. It makes no difference.

Most of the text objects are displayed shoved over to the left and some off the screen. (Some 'text' is actually converted to a path object, and this is unaffected.) Some actual text is still in the right place.

Shown on the File page, the graphic has gone wrong. However displayed on a browser, looking at the upload screen it displays correctly (or at least it does on my computer).

Has anyone come across this sort of thing before? Any suggestions?

Hogweard (talk) 23:44, 8 January 2020 (UTC)

I had the same issue with an svg image. See the discussion at the phabricator lab. As best I could tell, it's a comparability issue with various browsers and whatever converts to png in Wikipedia. In my case, I had a couple of spaces in the text definition that didn't bother Chrome but messed everything else up. See Wiki SVG help. Also the discussion here for the cafe logo and just above that, the DNA replacement image for a copyvio. Each has the same problem with text. I looked at the code and it seems like the textpath objects are rendering properly but the basic text elements are not. Each of the is using the tspan which, I think, positions them relative to the previous object? Presumably the first text object is not rendering properly and everything else is following suite. I ended up removing excess spaces (which you don't have) and switching to sans-serif (although they say libersation sans should work too). My bet is it's in the way you're using the tspan elements. good luck. Ian Furst (talk) 00:59, 9 January 2020 (UTC)
Amendment: easy answer is to convert text to paths. Ian Furst (talk) 01:00, 9 January 2020 (UTC)
Thanks - I will have a look at the tspan code if I can find it - or just convert the text to paths. I'll get it sorted somehow.Hogweard (talk) 14:04, 9 January 2020 (UTC)
Hogweard, not sure how comfy you are with svg code (I'm not) but I use Notepad++ to make basic edits and frequent use of svgomg to clean things up generated by Illustrator. Ian Furst (talk) 19:30, 9 January 2020 (UTC)
I think I've done it. I could not work the code out sufficiently, so I went back to Inkscape, neglected my family for hours on end, copied and pasted text which was displaying properly and basically rewrote it all. Hogweard (talk) 15:14, 12 January 2020 (UTC)

png-Preview doesn't show rotations

I've uploaded: . The diagram is supposed to be rotated via CSS which doesn't work in the png-Preview. Is there any way to improve this? TIA --MScharwies (talk) 09:17, 25 January 2020 (UTC)