PDA

View Full Version : Raw SVG



Jeff_Wilson63
09-29-2009, 06:17 PM
So today I fired up Inkscape again. For the fifth time I went in and tried to do stuff and couldn't. I couldn't resize the sheet, couldn't move the path block, couldn't do a symmetrical resize of the paths, couldn't figure out where paths will be on an exported image, couldn't export just the paths. I looked at the documentation (again) and was still completely baffled. I came to the conclusion that there's something fundamental about this program that completely escapes me. This is more than needing an explanation, there's something about this program that is totally alien to how I think and work.

While contemplating what to do next I remembered that svg was supposed to be a text format and, out of curiosity, decided to open up a couple of the svg files I'd created. To my surprise, I took one look and immediately understood them. Oh, not the details, but the concepts and how things are set up are obvious and easy to work with. Looking up the svg documentation I had no trouble whatsoever doing, with a text editor directly on the svg file, all the things that had frustrated me to no end (and I thought were pretty basic) when I tried to do them through Inkscape. (OK. One minor problem. It would be nice if you could start and end an elliptical arc at the same point.)

I'm now going through the svg documentation and loving it. Is there anyone else here to prefers to work with raw svg, or finds raw svg easier to use than Inkscape?

ravells
09-29-2009, 06:30 PM
Wow! I wish my mind worked in that way!

RobA
09-30-2009, 12:51 AM
So today I fired up Inkscape again. For the fifth time I went in and tried to do stuff and couldn't. I couldn't resize the sheet, couldn't move the path block, couldn't do a symmetrical resize of the paths, couldn't figure out where paths will be on an exported image, couldn't export just the paths. I looked at the documentation (again) and was still completely baffled. I came to the conclusion that there's something fundamental about this program that completely escapes me. This is more than needing an explanation, there's something about this program that is totally alien to how I think and work.

Wow. Not even sure how to respond to that! I find Inkscape to be simple and intuitive to use ;)

spend a bit of time and watch a few heathenX screencasts on Inkscape http://screencasters.heathenx.org/ to get a better feel for the way the software is meant to be used... that might help. (unless you would prefer to work in text files. I know I like POVRay for 3D rendering, as it is all text file sourced...never got the hang of 3D modelling software...THis could be similar for you!)

Not sure if you are looking for answeres, but for reference...

Resize the sheet -> under document properties, slong with BG colour, units, etc.
Move a path-> with the select tool, click and drag an object to move it.
Resize of path-> Click once with the select tool, (second click would switch to rotate mode). drag a corner arrow to rescale. Either use the padlock in the infobar at the top to lock the X and Y aspect, or just hold the ctrl key down while dragging. There are some toggles to select if strokes, patterns or other things scale when scaling an object.

Export a bitmap->If you export an object, you get a rectangular png that matches the bounding box of the object, Selection gives you the bounding box of the selection, page gives you the page (as defined under document properties).

hth,

-Rob A>

Jeff_Wilson63
09-30-2009, 02:44 AM
Er, thanks, but svg files are so easy to write directly, it hardly seems worthwhile to learn so complicated and unintuitive an interface. All the things you described I just have to look at the file and I know what to do. I've completed more glyphs today by editing svg files than I have by drawing in GIMP in the past week. (My avatar is 9 glyphs, all completed, re-rendered, and uploaded today.) I'm still using GIMP for rendering, but that will change as I get more used to svg.

waldronate
09-30-2009, 04:53 PM
Real Men type the opcodes for their program directly into memory (and they'd rather use toggle switches if they were still available).

Lesser Men use assembly language that other software translates into opcodes.

Normal Men use a text editor to write a file that gets translated by other software into assembly that gets translated by other software into opcodes.

Girly Men use "CAD Tools" to make pretty pictures that other software translates into text files in a high level language that gets translated by other software into assembly language that gets translated into opcodes.

(Note that I haven't been a Real Man for about 25 years, and that was on a 6502.)

torstan
09-30-2009, 04:58 PM
Said before - but bears repeating in this context :)

http://xkcd.com/378/

selden
09-30-2009, 05:00 PM
Oh, no, we aren't going to get into that argument, are we?

Real Men use TECO and Fortran ;)

Gamerprinter
09-30-2009, 05:05 PM
Wrong again, real men, hire programmers and all those other lesser men, to slave out the results for minimal pay!

GP

torstan
09-30-2009, 05:47 PM
/Looks up from editing fortran77
/shakes fist at pesky kids

(seriously though - any language with line length restrictions due to the size of punchcards should be dead and buried. Why oh why it still exists in physics is beyond me)

As for svg files, I can entirely see the OP's point. I've done a bit of editing eps files by hand too and it's surprisingly straighforward, though I haven't done the same with svg.

selden
09-30-2009, 06:37 PM
(seriously though - any language with line length restrictions due to the size of punchcards should be dead and buried. Why oh why it still exists in physics is beyond me)
Because they haven't switched to fortran90 or later? Granted gfortran may not be all you want, but the commercial compilers are more than adequate. Still, there are enough differences in the languages that tracking down the resulting bugs is a royal pain in the fundament.


As for svg files, I can entirely see the OP's point. I've done a bit of editing eps files by hand too and it's surprisingly straighforward, though I haven't done the same with svg. Well, postscript is just another stack-oriented reverse polish language. If you were comfortable with the original HP RPN calculators, it's easy to learn. Forth is equivalent fun.

And svg files look quite simple by comparison.

waldronate
09-30-2009, 06:38 PM
(seriously though - any language with line length restrictions due to the size of punchcards should be dead and buried. Why oh why it still exists in physics is beyond me)


Fortran 77 use in physics persists as a constant reminder that the real world has uncomfortable spots that your theories will need to take into account. In short, it's good practice, if a bit inconvenient.

waldronate
09-30-2009, 06:39 PM
!@#(*&. I keep forgetting my smilies!

torstan
09-30-2009, 07:10 PM
Yep, it's true enough. The codes are large and complex and updating them is a pain. I don't know of any physicist who wants to sit down and rewrite old code about complex calculations with the result that they get.... the same result at the end of the day. We'd all prefer to work on new shiny problems that get us papers. And so most code has some fortran77 wrapped up in it somewhere - usually a two loop higgs calculation. Perhaps f77 is character building?

I'm not sure how much time is wasted by postdocs and grad students hunting down the compile errors that result in new compilers doing horrible things to fortran77, or just not working at all. I can't help but think it might be a good use of research money to employ a couple of programmers full time to sit down and rewrite a lot of severely deprecated code and bring it up to date...

Anyway, enough derailing. I'm interested to see how the text based editing of svg comes along. Any new examples to show?

Jeff_Wilson63
09-30-2009, 10:43 PM
I'm on chapter 5 of svg spec and just getting to the interesting stuff. I made my avatar for this site, and I've been playing around with various effects in GIMP to produce other avatars.

My current svg project is to produce a working copy of my Glyphica Arcana (http://www.monticello21st.com/myths/BabelTarot.html) translation of the Tolkien's "One Ring" completely in svg. (One Ring to rule them all, One Ring to find them, One Ring to bring them all, and in the darkness bind them.) Here's the edition produced using php's internal graphics editor:

http://www.monticello21st.com/gifs/sy2_Grp_OneRing.png

I know I can do better in svg.

Most of my free time today has gone to working on this (still incomplete) logo for my wiki.

http://www.monticello21st.com/uploads/sy3_Ferwe.png

I'm having a lot of fun using layers and masks and I'm very grateful for the tutorials on this site that pointed me in the right direction. (I've snaffled some pixels from a couple of avatar from this site, if anyone objects let me know and I'll remove them.)

Plus I haven't forgotten the Relleker region map I'm trying to get done. :D

torstan
09-30-2009, 10:49 PM
You're welcome to mine. Looking good.

Jeff_Wilson63
10-12-2009, 01:37 AM
I reached the gradient instructions and was amazed at flexible they are. Font placement, unfortunately, is as much of a pain as any point and click program. I'm going to have to back over that and see if I overlooked something to make centering &tc. easier.

Anyway, this image was created in raw svg before being converted to png:
http://www.monticello21st.com/gifs/PgHdGlyphica.png
The svg file is at http://www.monticello21st.com/gifs/PgHdGlyphica.svg but requires the Dauphin font on your machine to come out right. There's a color shift in the conversion I wish I could account for, but it isn't bad.