how to create my symbol ?

Post Reply
geraldfg95

how to create my symbol ?

Post by geraldfg95 » 25.11.2010, 08:33

Hi
I want create new symbol .
For example sncf french signal for theme
How proceed for this ?

thanks
Gérald

jeanmichel

Post by jeanmichel » 25.11.2010, 08:59

Hi Gérald,

have a look at the icons in the themes folder:

http://bazaar.launchpad.net/~rocrail-pr ... vg/themes/

the icons are (simplified) svg files (http://en.wikipedia.org/wiki/Svg): (You can edit them with a simple text editor).

Code: Select all

<svg width="32" height="32">
  <g>
    <!-- Track -->
    <path stroke="rgb(0,0,0)" fill="rgb(0,0,0)" d="M 0,12 L 31,12 L 31,19 L 0,19 z " />
    <!-- Ausleuchtung grau -->
    <path stroke="rgb(192,192,192)" fill="rgb(192,192,192)" d="M 8,14 L 23,14 L 23,17 L 8,17 z " />
  </g>
</svg>
than save the changed file with the same name to a new folder in the themes dir. Put this folder at the first position in the themes property. The new icon should appear in the plan.

BR
Jean-Michel

geraldfg95

Post by geraldfg95 » 25.11.2010, 09:21

Whaou !
How to see change ?
it's number and letter ...
does exist a graphic editor ? and convert it after ?

thanks
Br
GG

jeanmichel

Post by jeanmichel » 25.11.2010, 10:10

Hi,

it's not that complicated :)

have you seen the wiki pages on this topic?

http://wiki.rocrail.net/doku.php?id=symbolnames-en

http://wiki.rocrail.net/doku.php?id=symbols-en

Incscape might be the solution. On Ubuntu the symbols are shown in the file manager. This is a great preview. On my mac I'm looking for a solution like that and if I find one i report back.

BR
Jean-Michel

geraldfg95

Post by geraldfg95 » 25.11.2010, 11:53

Hi Jean Michel

it's great with inkscape on mac os with x11 :D
i make a french library and post it on rocrail.net

br
gg

geraldfg95

Post by geraldfg95 » 25.11.2010, 12:23

Editing is ok , but modified symbol are not show in rocwiev ....

jeanmichel

Post by jeanmichel » 25.11.2010, 12:51

Hi,
At the moment the only thing evaluated in Rocrail are <path../>.
With Shift+F6 you can start this sequence; try to generate Lines only, no Curves.
As soon as you're done with the graphics save the file in Inkscape and open it with a text editor to copy the path information into another new file.
http://wiki.rocrail.net/doku.php?id=symbols-en

You have to copy the part out off the incscape file.
It has to look something like that:

Code: Select all

<svg width="32" height="32">
  <g>
    <!-- Track -->
    <path stroke="rgb(0,0,0)" fill="rgb(0,0,0)" d="M 0,12 L 31,12 L 31,19 L 0,19 z " />
    <!-- Ausleuchtung grau -->
    <path stroke="rgb(192,192,192)" fill="rgb(192,192,192)" d="M 8,14 L 23,14 L 23,17 L 8,17 z " />
  </g>
</svg>
just open the file in a text editor and delete all unneccesary stuff. You can post the Incscape xml here and I show you which lines need to be deleted.

BR
Jean-Michel
Last edited by jeanmichel on 25.11.2010, 13:02, edited 1 time in total.

geraldfg95

Post by geraldfg95 » 25.11.2010, 12:58

Ok
I try it and repport the result here

Br
Gg

jeanmichel

Post by jeanmichel » 25.11.2010, 13:00

Hi,

but a much clearer way might be understanding the path:

Code: Select all

d="M 0,12 L 31,12 L 31,19 L 0,19 z "

M ... pen move to 0,12
L ... pen draw line to 31,12
...
z ... end

Code: Select all

stroke="rgb(0,0,0)" fill="rgb(0,0,0)"
the outline and fill color.

here is the simple example from the wiki:

Code: Select all

<svg width="32" height="32">
  <g>
    <path stroke="blue" fill="yellow" d="C 10,10 25,10 25,20" />
    <circle cx="16" cy="12" r="5" fill="red" stroke="blue"/>
  </g>
</svg>

it draws a line and a circle. the circle has coordinates for the center an a radius. And two colors: outline (stroke) and fill. Thats all :)

Quadrille paper can help a lot.

BR
Jean-Michel

geraldfg95

Post by geraldfg95 » 25.11.2010, 14:17

Thank you Jean Michel
I think is very complicated for if little !
isn't there simpler?
the naval battle would be said! :D

br
gg

Post Reply

Return to “SVG Themes”