SVGImport.wiki
changeset 228 13f07e078365
parent 227 c7897b5d10c5
child 229 5c20e3d492e8
--- a/SVGImport.wiki	Sun Jun 24 21:20:16 2012 +0000
+++ b/SVGImport.wiki	Sun Jun 24 22:55:51 2012 +0000
@@ -14,9 +14,10 @@
 
 Open an SVG. Ideally one of simple line art, without too much use of fill or filters.
 
-1) combine all paths in the drawing (select them, then choose Path->Combine)
+1) Combine all paths in the drawing (select them, then choose Path->Combine). Note. I had some difficulty doing that with some images even after repeated use of ungroup. I ended up just going into the SVG file and deleting all the groups.
+Also, some paths might be worth eliminating altogether.  In order to get a better idea of what it'll look like, try: View->Display Mode->Outline
 
-2) select the combined path, and ungroup
+2) select the combined path, and ungroup.
 
 3) Click on the path, and choose dimensions for W and H that would look good in the game (no more than 4096 for W and 2048 for H).  The Lock button may be helpful here.
 
@@ -32,6 +33,7 @@
 
 9) Edit the file, and delete everything but the path data.  You should have a one-line file starting with something like  M1234.3 456.78L3298.3 9023.34 and so on.  The coordinates should now be rounded unless you plan to handle that yourself in some way.  Here is a vim one-liner to do it.
 {{{:s/[0-9][0-9.]*/\=float2nr(floor(submatch(0)*1))/g}}}
+If instead you have a format like M 1234.678,9875.323 2345.0,123.45  - you'll want to convert if you want to try the crude script in (10) - otherwise a smarter script would be needed.  Here's a Vim one-liner for that syntax {{{s/\(\d\) \(\d\)/\1 L\2/g}}}  and {{{s/,/ /g}}}
 
 10) Convert the path data.  Here is a crude script to do that.
 {{{
@@ -75,4 +77,9 @@
 
 12) Convert to base64 and you're done!
 
-{{{base64 -w0 hwpointdata.Z > mynewhedgewars.hwmap}}}
\ No newline at end of file
+{{{base64 -w0 hwpointdata.Z > mynewhedgewars.hwmap}}}
+
+Enjoy.
+
+Here are some example hwmap files from the process above.  They look better in 0.9.18.
+http://m8y.org/hw/drawn/
\ No newline at end of file