# SVG

Wikipedia:SVG – Scalable Vector Graphics. Images that consist of lines and shapes and text and fonts, and not pixels. They look the same, but vector graphics can be scaled effortlessly, and could potentially be rearranged without necessarily loosing any information.

I recommend InkScape to edit SVG files. Inkscape used to crash often, but these days I’m very happy with it.

# 2016-03-12 A Day Wasted

Gridmapper is a web application because it runs in a web browser. It consists of an SVG document and some Javascript which adds and removes elements to the SVG document in your browser’s memory. Sadly, where as SVG has a way to get key press events and mouse events and touch events -- all the stuff Javascript knows about -- it doesn’t have text fields and text areas like HTML does. So, what now? In theory, it’s easy: include XHTML in the SVG document – this is possible because both are XML dialects and SVG has an element that reserves space for non-SVG elements: foreignObject. So if I don’t want to re-implement all of the things that text fields and text areas do, all the cursor movements, selection, copy, cut, paste, and all that, then this is what I’ll have to do.

I currently have a way to do that, but I didn’t like it. It looks a bit off on the iPad Pro. It doesn’t look exactly the way I want it to on different operating systems. And so I decided to change it. Replace a lot of the XHTML other than the text area with pure SVG.

And then, when it was nearly done, I ran into weird problems with Chrome.

This was the first problem: When you click on the Download link, it turns invisible and some text that was invisible instead shows up. With the rewrite, making the Download link invisible turned all of the text invisible. Huh? After many iterations, I turned out that if I rearranged the links so that it wasn’t the /first/ link, it worked. Huh?

The second problem was that the text area suddenly started jumping to the left if more than a few lines of code were inserted by the Text Export link. Huh?

I decided to kill it all. And now I’m sad.

Update: And literally !minutes! later, I think of something... try it... works!? The simple addition of “position: fixed” is the solution!? 🙀

Update: Oh well, I just found that the PNG export doesn’t work in Safari. Apparently not an unknown problem. [1] The solution in my case was to create a new SVG node and import all the nodes I need without importing any of the nodes containing the foreign objects:

  // PNG download hides user interface. We must actually *remove* all
// the foreignObject elements because it causes a security exception
// in Safari.
// http://stackoverflow.com/questions/33972254/svgpng-from-canvas-todataurl-throws-dom-exception-18-security-error-in-safari-9
var clone = document.createElementNS("http://www.w3.org/2000/svg", "svg");
var background = svg.getElementById('background');
clone.setAttribute('width', svg.getAttribute('width'));
clone.setAttribute('height', svg.getAttribute('width'));
clone.appendChild(svg.querySelector('defs').cloneNode(true));
clone.appendChild(svg.querySelector('style').cloneNode(true));
clone.appendChild(svg.getElementById('background').cloneNode(true));
clone.appendChild(svg.getElementById('levels').cloneNode(true));
source = btoa(unescape(encodeURIComponent(new XMLSerializer().serializeToString(clone))));

link  = document.getElementById('download_png');

// SVG to PNG using canvas https://gist.github.com/gustavohenke/9073132
var canvas = document.createElementNS(xhtmlNs, 'canvas');
var rect = Map.ui.getBoundingClientRect();
canvas.width = (Map.width + 2) * Map.tileWidth; // see resizeSVG
canvas.height = (Map.width + 2) * Map.tileWidth;
var ctx = canvas.getContext('2d');
var img = document.createElementNS(xhtmlNs, 'img');
img.setAttribute('src', 'data:image/svg+xml;base64,' + source);

// when the image arrived in the canvas, set the link
img.onload = function() {
ctx.drawImage(img, 0, 0);
link.setAttributeNS(xlinkNs, 'href', canvas.toDataURL('image/png'));
};

Update: I think I took care of all these issues and I even implemented a new feature: Z will now cycle through the following three states:

1. hide other levels (the old functionality)
2. use a black background
3. back to the default: light gray background and transparent images of the levels above and below

Not wasted after all.

Tags:

Add Comment

# 2014-01-11 mkhexgrid

My Old School Hex Map Tutorial tells people to use mkhexgrid, if they can. It’s what I’ve been doing for years, now.

On my wife’s laptop we now run Mac 10.9 (”Maverick”) and it no longer builds. As I’ve switched to using Homebrew, I recided to write my own Formula.

If you want to try it, save it as /usr/local/Library/Formula/mkhexgrid.rb and run brew install mkhexgrid. The only tricky thing is that it requires the GD library to be built with !FreeType, apparently. If you don’t have GD installed, great. This Formula will do the right thing. If not, you might have to brew uninstall gd before proceeding.

require 'formula'

class Mkhexgrid < Formula
homepage 'http://www.nomic.net/~uckelman/mkhexgrid/'
url 'http://www.nomic.net/~uckelman/mkhexgrid/releases/mkhexgrid-0.1.1.src.tar.bz2'
sha1 '3b8e0be3636f90a3217a5e3556bdaf7bb0c49116'

depends_on 'gd' => %w{with-freetype}

def install
inreplace 'Makefile' do |s|
s.change_make_var! "DESTDIR", prefix
s.change_make_var! "CC", ENV.cc
s.gsub! /install (.*) -o 0 -g 0/, 'install \1'
end
inreplace 'mkhexgrid.cpp' do |s|
s.sub! 'catch (exception &e)', 'catch (std::exception &e)'
end
system "make" # needs to be separate
system "make", "install"
end

test do
# test the example from the man page (but without inches)
system "mkhexgrid", "--output=ps", "--image-width=2448",
"--image-height=1584", "--hex-side=36", "--coord-bearing=0",
"--coord-dist=22", "--coord-size=8", "--grid-thickness=1",
"--coord-font=Helvetica", "--grid-grain=h", "--grid-start=o",
"--coord-tilt=-90", "--centered", "-o", "test.ps"
end
end

Tags:

Comments on 2014-01-11 mkhexgrid

These days, it’s part of Homebrew:

alex@Megabombus:~$brew search mkhexgrid homebrew/games/mkhexgrid ✔ alex@Megabombus:~$ brew install mkhexgrid
Warning: homebrew/games/mkhexgrid-0.1.1 already installed
alex@Megabombus:~\$ brew reinstall mkhexgrid
==> Reinstalling homebrew/games/mkhexgrid
==> Downloading http://www.nomic.net/~uckelman/mkhexgrid/releases/mkhexgrid-0.1.
################ 100,0%
==> make
==> make install
🍺  /usr/local/Cellar/mkhexgrid/0.1.1: 14 files, 214.9K, built in 28 seconds
• - Alex Schroeder 2016-04-13 05:41 UTC

Add Comment

# 2013-07-16 Inkscape Mapping and mkhexgrid

Today I needed to add the island of Tirnanog to my campaign map using Inkscape. In order to do that, I needed to add more hexes in the background---I needed to “grow the ocean”. I looked at my Old School Hex Map Tutorial and figured I must have used the Inkscape Boardgames Extension. When I checked, however, I was unable to find the menu. Perhaps Inkscape has changed and it needs to be reinstalled? I decided to give mkhexgrid another try. Fiddling with the spec file for a bit, I determined that these were the correct settings:

output=svg
outfile=hex-layer.svg
hex-side=45pt
rows=17
columns=14
grid-color=7a7a7a
coord-color=008080
coord-size=10pt
coord-distance=28pt
1. start with an odd number!
coord-column-start=37
coord-row-start=01

By now the map is so big, redoing it for Hexographer or Text Mapper seems like a lot of work. When I see the efforts required to update this map in a sluggish Inkscape on a 1024\times768 monitor, however, it seems like a lot of work as well.

Update: I actually wanted to see how much time it took to get a decent result using Text Mapper and compare it with my old style, based on the Old School Hex Map Tutorial I wrote.

I don’t know. I like the colors of the Gnomeyland icons. Check out Map Symbols: Trees & Forests on Old Russian Maps by John Krygier for some source material. But really -- is it much better? Is it much faster? I don’t think so.

Original, from the /Wilderlands of High Fantasy/ box:

My “old school hex map” style:

Text Mapper, using the Gnomeyland icons by Gregory B. !MacKenzie (CC BY SA):

For the curious, here is the source for Text Mapper:

3901 water
3902 water
3903 water
3904 water
3905 water island
3906 water
3907 water
3908 water
4001 water
4002 water
4003 water
4004 water
4005 water
4006 water
4007 water island
4008 water
4101 water
4102 water
4103 water
4104 water
4105 water
4106 water
4107 water island "Andaman Isles"
4108 water
4201 water
4202 water
4203 water
4204 soil tower "Marechal"
4205 dark-green forest
4206 water islands
4207 water islands
4208 water
4301 water
4302 water
4303 water
4304 light-grey hill
4305 light-grey mountain
4306 light-grey
4307 water
4308 water
4401 water
4402 water
4403 light-grey hill
4404 grey mountain "Needles Peak"
4405 light-grey hill
4406 water
4407 water
4408 water
4501 water
4502 dark-green forest
4503 light-grey hill
4504 green forest-hill
4505 soil tower "Lanka"
4506 water
4507 water
4508 water
4601 water
4602 soil tower "Calfat"
4603 soil lake keep "Kailasa"
4604 light-grey hill
4605 water
4606 water
4607 water
4608 water
4701 water
4702 light-grey
4703 light-grey hill
4704 soil tower "Heratus"
4705 dark-green forest
4706 water
4707 water
4708 water
4801 water "Windward Peninsula"
4802 soil keep "Dalmaric"
4803 soil keep "Talimanor"
4804 dark-green forest "Pardolock Jungle"
4805 water
4806 water
4807 water
4808 water
4901 water
4902 water island
4903 water
4904 water
4905 water island
4906 water
4907 water
4908 water
5001 water
5002 water
5003 water
5004 water
5005 water
5006 water
5007 water
5008 water
lake xml <circle cx="0" cy="0" r="50" fill="#6ebae7" stroke="black" stroke-width="3"/>
island xml <circle cx="10" cy="10" r="25" fill="#dcddbe" stroke="black" stroke-width="3"/>
islands xml <circle cx="-20" cy="20" r="20" fill="#dcddbe" stroke="black" stroke-width="3"/><circle cx="20" cy="-20" r="15" fill="#dcddbe" stroke="black" stroke-width="3"/>
include https://alexschroeder.ch/contrib/gnomeyland.txt

4603-4903 fjord
4602-4902 fjord
fjord path attributes stroke="#6ebae7" stroke-width="20" fill-opacity="0" stroke-linecap="round"

other <text stroke="white" stroke-width="10px" font-size="50pt" x="6300" y="550" transform="rotate(330 6300,550)">Tirnanog Isle</text><text font-size="50pt" x="6300" y="550" transform="rotate(330 6300,550)">Tirnanog Isle</text>

Tags:

Add Comment

# 2013-06-27 Text Mapper for Traveller

A few years ago I was working on Traveller Subsector Mapper. As I was thinking about the new Text Mapper, I wondered how feasible it would be to generate a Traveller subsector using Text Mapper. I know, it’s a stupid waste of time because I already have the Traveller Subsector Mapper. But I couldn’t resist the lure of showing off how flexible Text Mapper could be. And it works!

Subsector created using Traveller Subsector Mapper:

Subsector created using Text Mapper:

In order to reproduce it, use the following input:

include https://campaignwiki.org/contrib/traveller-example.txt

The example file traveller-example.txt uses the library traveller.txt defining everything it requires.

Comments on 2013-06-27 Text Mapper for Traveller

Nice curved routes! I like it.

BeRKA 2013-06-27 21:38 UTC

Looks gorgeous, actually.

noisms 2013-06-27 21:49 UTC

Thanks!

AlexSchroeder 2013-06-28 07:18 UTC

I like the new version better

– Harald Wagener 2013-07-01 12:08 UTC

I love your random generators (the idea behind TextMapper is fantastic), but as I know next to nothing about programming, I can’t do one thing I’d like: change your Traveller map to generate a larger subsector. The reason is I’d like to use it with your “wilderness” generator. Let me explain. The “travel” and “communication” routes on your Traveller generator could be used to trace important locales in a point-crawl / node-crawl / path-crawl. Expanding those to cover a larger map (let’s say 30x40 hexes) would be a great way to indicate the point of interests in a given region. I hope it’s not too confusing to understand what I’m trying to say.

Marcelo Paschoalin 2015-10-09 14:46 UTC

Yeah, the problem is that the UWP Generator doesn’t produce the output format necessary for Text Mapper. You need to create the Text Mapper input manually. The easiest solution would be to just print out multiple subsectors and connect them manually. For my own Fantasy mapping needs, I often find that placing roads and rivers between settlements is a manual process (example, data with trails and streams at the end).

– AlexSchroeder 2015-10-09 15:09 UTC

Add Comment

# 2013-06-05 Gnomeyland and Text Mapper

When I wrote my Old School Hex Map Tutorial, I noticed the Gnomeyland Map Icons and the Making Hex Maps With Inkscape tutorial by Gregory B. MacKenzie.

After a futile attempt to write a tool that would extract those icons automatically and make them usable for Text Mapper, I did the work by hand. Look at the example below… Beautiful! And since this is SVG, you can quickly generate your first map and later you can keep working on it using Inkscape.

To regenerate the map above, visit Text Mapper and use the following “map”:

include https://alexschroeder.ch/contrib/gnomeyland-example.txt

This loads the Gnomeyland example map which uses the Gnomeyland library.

The Gnomeyland example map uses the tiles from the library. Here’s what you would need to generate just the lower part of the map:

include https://alexschroeder.ch/contrib/gnomeyland.txt
0005-0806 trail
0105 dark-green fir-forest "to the caves"
0106 dark-green fir-forest
0205 green fir-forest
0206 green fir-forest
0305 green firs
0306 soil keep "The Keep"
0405 light-soil
0406 light-soil
0505 light-grey mountains
0506 light-green forest-hill
0605 grey grass
0606 grey marsh
0706 dark-grey swamp
0806 dark-grey castle "Dolorous Garde"

Just paste it into Text Mapper.

Comments on 2013-06-05 Gnomeyland and Text Mapper

I wonder if it wouldn’t look a bit better if the trail were drawn below the icons.

Andreas Gohr 2013-06-05 14:06 UTC

Hm… I remember moving it behind the text labels, but you’re right, it would make sense to draw hex backgrounds first, then trails, then trails, then things within the hex and finally the text labels…

AlexSchroeder 2013-06-05 14:50 UTC

Add Comment

# 2013-06-05 Another Gnomeyland Example

I wanted to test the recently added Gnomeyland icons for Text Mapper and looked at the following map:

This is the text description I came up with:

include https://alexschroeder.ch/contrib/gnomeyland.txt
0101 water
0102 water
0103 water
0104 water
0105 water
0106 water
0201 water
0202 dark-grey marsh
0203 dark-grey marsh
0204 water
0205 water
0206 water
0301 water
cave xml <line x1="30" y1="45" x2="130" y2="45" stroke="#6ebae7" stroke-width="20" stroke-linecap="round"/><path d="M 30,45 c 0,-20 -20,-20 -20,0 c 2,0 3,0 20,0 z" stroke="black" stroke-width="2"/>
0303 dark-grey tower cave "Portal"
0304 grey grass
0305 grey mountain
0306 water
0401 water
0402 grey trees
0403 water
0404 water
0405 water
0406 water
0501 water
0502 light-green tree "Silberbäume"
0503 soil
0504 water
0505 dark-grey forest-hill
0506 water
0601 water
0602 green forest
0603 green forest "Faule Wald"
0604 green forest
0605 dark-grey trees
0606 water
0701 water
0702 water
0703 dark-grey forest-mountains "Einhorn"
0704 dark-grey forest-mountains
0705 water
0706 water
0801 water
0802 water
0803 water
0804 water
0805 water
0806 water
lake xml <circle cx="45" cy="75" r="30" fill="#6ebae7" stroke="black" stroke-width="3"/>
0302 dark-grey forest  lake "See"

Note some tricks:

1. the “cave” is defined right then and there, not in a library, and it includes a little water connection to the central bay
2. hex 0302 with the lake comes at the end such that the neighboring hexes don’t overwrite the overflow

Result:

I could work on this some more, or I could just take it, import it into Inkscape, and keep working on it.

The big question is: how much easier is it to work with a text description of a map compared to fiddling with Inkscape directly? As I create new maps, I’m no longer sure this map generator is all that useful, to be honest.

Comments on 2013-06-05 Another Gnomeyland Example

I think it could useful as a kind of intermediate language (like MSIL). For instance, you could make a front-end (GUI or website) that lets you tweak some basic things easily (number of roads, cities, amount of water, etc.), and with a push on “Generate”, the front-end then spits out Text Mapper “source code” and feeds it to the back-end, producing the final SVG.

Jensan 2013-06-05 17:31 UTC

Hm, good point. Perhaps somebody could write a random map generator without having to implement the map drawing aspect.

AlexSchroeder 2013-06-05 20:24 UTC

I like the text mapper. I would rather write the textual description than trying to do this in inkscape. At your level of artistic talent, maybe it’s not that useful …

Harald 2013-06-05 20:33 UTC

Well, even for people not into the artistic aspect of it could get by reasonably, I assume, by opening the Gnomeyland template, for example, and using copy and paste. I haven’t tried it, however. Something to consider.

AlexSchroeder 2013-06-05 21:09 UTC

I agree with Jensan, a GUI Editor of some sort would be really helpful I guess.

Andreas Gohr 2013-06-06 08:54 UTC

Add Comment

# 2013-03-04 Text Mapper With Lines

SVG Mapper now knows how to draw lines. These lines try to flow from hex to hex...

Example input:

2114 hill
2115 hill
2213 forest
2214 forest "Delan"
2215 hill
2314 forest
2315 forest
2414 hill "Forest Bight Fortress"
2415 forest
2515 forest "Boghra Little"

2214-2615 river
river path attributes fill-opacity="0" stroke="black" stroke-width="5"

include https://alexschroeder.ch/contrib/default.txt

Result:

I think that I’m not quite understanding how the viewBox is supposed to work. But anyway: these lines can be used for roads, rivers, borders, cliffs, and the like. If they’re very straight, they don’t look too good. There’s no random waviness. One feature I definitely have to add is providing more intermediary points such that the user can guide rivers around the hills or to allow rivers to merge.

Tags:

Comments on 2013-03-04 Text Mapper With Lines

Hello there. My first time posting. Really hoping you respond. I have been playing with textmapper, learning about SVG, and trying to take it farther on my own. Things would be going much better if I was a computer programmer instead of a chemist. The Viewbox thing has been annoying for me as I have used your website to make ever more complex maps. If I could figure out how to run it locally I would, a big plus would be adding my own content to defaults.txt.

In the above image I THINK you are trying to assign the upper left and lower right corners as it shows here viewBox=”2990 2028 3910 2784”> But what you should be doing is assigning the upper left corner and then the width and height viewBox=”2990 2028 920 756”>. There is still something going on with my bigger maps but they are fully on screen when manually edited this way.

On a related note, in https://alexschroeder.ch/contrib/black-and-white.txt the default attributes are fill=”#ffffff” stroke=”black” stroke-width=”3” That fill attribute causes all the hexes to be blank unless I set the fill-opacity=0.0 with manual editing. I think it should be fill=”none”.

Yeah I really need to get this to work locally, so many possibilities.

• - Craig Peters 2014-02-15 02:50 UTC
• ---

Wow, this is great! Regarding a local installation. What sort of computer do you have? All you really need is Apache and Perl. If you have a Mac, these come already installed. If you have a GNU/Linux system, you just need to install Apache. If you use Windows, there’s always WAMP.

If you can’t get Apache installed but you have Perl, then you can also run the command from the command-line. It’s somewhat awkward, but if that’s how you’d prefer to use it, usability can always be improved.

Here’s what I did. First I created a file in /tmp/map.txt containing the following

0308 jungle "Affeninsel"
include https://alexschroeder.ch/contrib/default.txt

Then I ran the command as follows:

perl text-mapper.pl map=include+file:///tmp/map.txt | tail -n +5 > map.svg

The map just needs to get an escaped URL -- replace spaces with + and you should be good to go if all you do is use a simple /include/ statement. The next problem is that you need to provide a local file URL. Instead of starting the URL with http:// you start it with file:// and then you add the file name. The script output contains some HTTP headers which you need to get rid of. I used the tail program, but you could just as well save the output and remove those extra lines manually:

perl text-mapper.pl map=include+file:///tmp/map.txt > map.svg

If those file URLs are giving your problems, try using your browser to “open” these files and copy the URL from the address bar.

If you’re mostly interested in providing a different default library, then all you need to do is find a site that will allow you to host text files. Perhaps a Gist on GitHub would work for you?

Example Gist:

Viewed as a raw text file (the link will be shown when viewing your Gist):

Or, if you decide to work locally as seen above, then your libraries can also use file URLs.

As for your two bug reports: Both confirmed, fixed, and installed. Thank you very much! The viewBox issue bugged me in the past until I decided that I was no longer going to waste time looking at it. I must have gotten confused because I was computing the two corners, and then width and height, and then ignoring them and using the two corners instead.

And finally, /please share/ your maps!

Wow, that was fast. Thank you so much. I will try the offline thing once I load Apache and have some free hours. In the meantime here is the first of soon to be 5 maps to be used in a kingmaker D&D campaign. You have said elsewhere on this site that entering text to make a map may not be worth the trouble. I agree, but it is good for editing once you have had a look at the final map. Thats why I’m use excel to input one letter keycodes (like your oldschool mapper) that then make the HTTP using concatenate.

http://tinyurl.com/ke5ay9h in black and white http://tinyurl.com/lhfryo3 in color

I’ll need to attend to ocean/sea/rivers in black and white and must not set hatched hexes to white, but its a good start. Wish me luck.

• - Craig Peters 2014-02-17 04:47 UTC
• ---

Good luck! I like the black & white map. It has a certain lightness to it.

Add Comment

# 2013-03-01 Text Mapper Progress

I’m a big fan of the Forgotten Depths. I wanted to use its map as the goal for my Text Mapper. As the mapper now allows the inclusion of other files, I’ve saved my library of colors and icons as default.txt and I’ve saved the map as forgotten-depths.txt. That’s why all you need to do now is include the map:

If you see white hexes, then I haven’t added any definitions for them, yet.

Comments on 2013-03-01 Text Mapper Progress

Wow, this looks great! I think I’ll need to re-map parts of the Mystara campaign … I may have some time on Sunday.

– Harald 2013-03-01 10:56 UTC

Too bad creating new icons takes so damn long. Also, two line labels would be nice. And big, diagonal labels to label areas. “Mirkwood” or something like it. Nice coastlines, roads, rivers…

Regarding roads and rivers: I’m discovering that Bézier curves need a bit more effort since simply doing a quadratic curveto (’T’ in the SVG spec) the hex midpoints isn’t working very well. I will need to rediscover my trigonometry basics!

AlexSchroeder 2013-03-01 12:00 UTC

Add Comment

# 2013-02-27 SVG Filters

I need help with SVG filters. This question is also on StackOverflow.

This is what I want to achieve:

Previously, I’d duplicate the text element, make the background white, and blur it:

  <defs>
<filter id="label-glow">
<feGaussianBlur stdDeviation="1" />
</filter>
</defs>
<text stroke="white" stroke-width="5" filter="url(#label-glow)">Harald's Repose</text>
<text>Harald's Repose</text>

I’m trying not to duplicate the text element. Here’s how to do it using filters:

  <defs>
<filter id="label-glow">
<feFlood flood-color="white"/>
<feComposite in2="SourceGraphic" operator="in"/>
<feGaussianBlur stdDeviation="2"/>
<feComposite operator="over"/>
<feComposite operator="over"/>
<feComposite operator="over"/>
<feComposite operator="over"/>
<feComposite in="SourceGraphic"/>
</filter>
</defs>
<text filter="url(#label-glow)">Harald's Repose</text>

Unfortunately the output of the Gaussian blur is very weak which is why I need to overlay it multiple times. What am I missing?

Update: As I’ve been experimenting with it, I’ve decided to drop filters altogether. When using Firefox and printing the map to PDF, the filters all result in bitmap elements that don’t scale well.

Tags:

Add Comment

# 2013-02-27 New Text Mapper Shapes

How to create new shapes for Text Mapper?

First, start with an empty SVG file:

<?xml version="1.0" encoding="UTF-8" standalone="no"?>
<svg xmlns="http://www.w3.org/2000/svg"
height="200px"
width="200px">
</svg>

I like to draw stuff using the !calligraphy! tool (c). I usually !simplify! the nodes a lot (Ctrl+L), !unify! the shapes (Ctrl++), edit the nodes by hand (n) until you’re happy with the fewest number of nodes you can manage.

Now move the entire shape such that it is centered on the !top left corner!. This is (0,0) as far as SVG is concerned. Save it.

Look at the SVG file and notice something like this:

<path
style="fill:#000000;fill-opacity:1;stroke:none"
d="m 7.647323,-20.341905 c -5.784973,-11.791839
-36.204242,-5.139394 -43.951039,7.112364 8.922877,-5.977096
34.793258,-11.641806 37.046343,-5.498373 -17.505656,0.485788
-29.019956,5.940662 -33.027811,23.8472764 C
-21.859546,-12.603312 -7.5022983,-14.191144 2.47485,-12.984161
-8.2112223,6.06712 -19.987316,13.477858 -15.788864,50.225619 c
3.988368,3.362713 8.6116517,-5.097214 4.510279,-7.531518
-0.559084,-6.64895 -0.875559,-13.360661 -0.08632,-20.004922 C
-9.6892813,9.718021 1.072969,-6.510207 8.835372,-12.256094
26.823805,-7.758432 35.550312,0.1756144 34.450001,15.351883
44.387089,3.7916614 29.882349,-11.701263 14.406587,-15.219388
28.287217,-15.939127 40.549839,-6.589098 45.412784,1.4541824
47.026796,-8.361333 28.866764,-19.205208 16.79733,-20.277164 c
10.765708,-6.95198 25.316253,-3.074379 29.792108,3.226712
-4.893545,-14.115874 -36.158133,-10.60357 -38.942114,-3.291453
z"
id="path3007"
inkscape:connector-curvature="0"
sodipodi:nodetypes="ccccccccccccccc" />

You can already extract this path and use it! Usually it takes several attempts to get the placement right. Once I’m happy, I turn all these floating point numbers into integers in order to save space. Personally, I use Emacs to do it (EmacsWiki:RoundFloatingPoints).

This is what I want:

m 8,-20 c -6,-12 -36,-5 -44,7 9,-6 35,-12 37,-5 -18,0 -29,6 -33,24 C -22,-13
-8,-14 2,-13 -8,6 -20,13 -16,50 c 4,3 9,-5 5,-8 -1,-7 -1,-13 0,-20 C -10,10 1,-7
9,-12 27,-8 36,0 34,15 44,4 30,-12 14,-15 28,-16 41,-7 45,1 47,-8 29,-19 17,-20
c 11,-7 25,-3 30,3 -5,-14 -36,-11 -39,-3 z

Example input:

0202 jungle
jungle attributes fill="white" stroke="#b3b3ff" stroke-width="3"
jungle path m 8,-20 c -6,-12 -36,-5 -44,7 9,-6 35,-12 37,-5 -18,0 -29,6 -33,24 C -22,-13 -8,-14 2,-13 -8,6 -20,13 -16,50 c 4,3 9,-5 5,-8 -1,-7 -1,-13 0,-20 C -10,10 1,-7 9,-12 27,-8 36,0 34,15 44,4 30,-12 14,-15 28,-16 41,-7 45,1 47,-8 29,-19 17,-20 c 11,-7 25,-3 30,3 -5,-14 -36,-11 -39,-3 z

Output:

Example input:

0101 jungle
jungle attributes fill="#9acd32" stroke="black" stroke-width="3"
jungle path attributes fill="#228b22"
jungle path m 8,-20 c -6,-12 -36,-5 -44,7 9,-6 35,-12 37,-5 -18,0 -29,6 -33,24 C -22,-13 -8,-14 2,-13 -8,6 -20,13 -16,50 c 4,3 9,-5 5,-8 -1,-7 -1,-13 0,-20 C -10,10 1,-7 9,-12 27,-8 36,0 34,15 44,4 30,-12 14,-15 28,-16 41,-7 45,1 47,-8 29,-19 17,-20 c 11,-7 25,-3 30,3 -5,-14 -36,-11 -39,-3 z
text font-size="20pt" dy="15px"

Output:

Comments on 2013-02-27 New Text Mapper Shapes

Not enough trees for a jungle At a watering hole and you have a decent oasis …

– Harald 2013-02-27 11:17 UTC

There you go!

I think I like how easy it turns out to be.

AlexSchroeder 2013-02-27 11:29 UTC

I’m still pondering how to do labels.

AlexSchroeder 2013-02-27 12:01 UTC

Very nice and readable!

– Harald 2013-02-27 12:37 UTC

Thank you for the feedback. Added.

AlexSchroeder 2013-02-27 14:10 UTC

Add Comment

More...

## Comments

Please make sure you contribute only your own work, or work licensed under the GNU Free Documentation License. See Info for text formatting rules. You can edit the comment page if you need to fix typos. You can subscribe to new comments by email without leaving a comment.

To save this page you must answer this question:

Please say HELLO.