User Tools

Site Tools


symbols-en

SVG symbols

Themes directory structure


The official themes are located in the subdirectory svg/themes.
All other sub directories are user defined themes.


The Official SpDrS60 Theme

The official theme is SpDrS60.
For testing and problem reporting this theme should be used.
All other themes must follow the naming, connection and size convention of the SpDrS60 theme.

Setup



Theme 1 - 5

Select the desired themes and restart Rocview to activate them.
If you have defined your own SVG symbol for a certain item, place it in the "Setup" list before the Theme that has the default symbol.
That means the first Theme determines how a SVG is portrayed.

Properties

The button opens the dialog Theme properties to the first SVG theme.

Item ID Pointsize

Adjust the pointsize for item IDs to fit the ID length choosen. Default is 7.
The Rocview has to be restarted for changes to take affect.

Color

The item ID color. Default is black.

Text Pointsize

Adjust the pointsize for Block ID and for Text objects with zero pointsize.
Best results for: 1)

  • OS X = 14
  • Linux = 13
  • Windows = 10
  • Default = 10

The Rocview has to be restarted for changes to take affect.

Process route/block events

To reduce processor resources these options can be disabled.

  • Process route events
    If this option is activated, the (yellow) route illumination of track symbols will be displayed.
  • Process block events
    If this option is activated, the (red) busy route illumination of track symbols will be displayed.

There are several parameters that determine the Symbol Illumination.

Show routes on switches

By activating this option the normal switch positions will be shown in Cyan.2)
For reserved routes this color will change in Yellow.
Raster switch types are not supported by this option.
Only the SpDrS60 theme has the needed SVGs.

To get the route IDs automatically set in the switch objects the router must be started again if the routes were generated with a revision older then 7884.
In case of manual routes use the Select dialog.

Route priority

Overwrites block occupancy in case a route is reserved.

Track/Road Layout

Track and road symbols can be mixed in one layout:

The road symbols have the same naming as the track symbols but are prefixed with road-.


Create SVG symbols

Text editor

If you wish to use your own symbols in a track plan you have to create these symbols SVG format.
The symbol size is set in the svg file, but make sure those values are a multiple of 32.

Turntables are not supported in SVG because of its very complex nature.

The file names are predetermined for each state of a symbol as listed here: Symbol Names


Supported SVG Elements

Path

Only M, L, C and z are evaluated. All coordinates are rounded to integers.
The following example (track with blue outline filled yellow ) shows which information is basically evaluated by Rocview:

<svg xmlns="http://www.w3.org/2000/svg" width="32" height="32">
  <g>
    <path stroke="blue" stroke-width="1" fill="yellow" d="M 0,16 L 2,13 L 29,13 L 31,15 L 31,16 L 29,18 L 2,18 L 0,16 z " />
  </g>
</svg>

Circle

<svg xmlns="http://www.w3.org/2000/svg" width="32" height="32">
  <g>
    <circle cx="16" cy="12" r="5" fill="red" stroke="blue"/>
  </g>
</svg>

Ellipse

<svg xmlns="http://www.w3.org/2000/svg" width="32" height="32">
  <g>
    <ellipse cx="16" cy="12" rx="8" ry="4" fill="red" stroke="blue"/>
  </g>
</svg>

Polygon

<svg width="100%" viewBox="0 0 32 32" xmlns="http://www.w3.org/2000/svg">
  <g>
    <polygon points="0,0 31,0 31,31 0,31" fill="red" stroke="blue"/>
  </g>
</svg>

Rectangle

<svg width="100%" viewBox="0 0 32 32" xmlns="http://www.w3.org/2000/svg">
  <g>
    <rect x="2" y="2" rx="5" width="20" height="20" stroke="blue" fill="red"/>
  </g>
</svg>

Setting rx > 0 will draw a rounded rectangle.

Line

<svg width="100%" viewBox="0 0 32 32" xmlns="http://www.w3.org/2000/svg">
  <g>
    <line x1="0" y1="0" x2="31" y2="31" stroke="black"/>
  </g>
</svg>

PolyLine

<svg width="100%" viewBox="0 0 32 32" xmlns="http://www.w3.org/2000/svg">
  <g>
    <polyline points="0,31 15,8 15,24 31,0" stroke="blue"/>
  </g>
</svg>


Alternative <g>

A second Graphics Container3) can be added in the SVG definition which will be alternated every second.

Example

<svg xmlns="http://www.w3.org/2000/svg" width="32" height="32">
  <g>
    <path stroke="blue" fill="yellow" d="M 0,16 L 2,13 L 29,13 L 31,15 L 31,16 L 29,18 L 2,18 L 0,16 z " />
  </g>
  <g>
    <path stroke="blue" fill="grey" d="M 0,16 L 2,13 L 29,13 L 31,15 L 31,16 L 29,18 L 2,18 L 0,16 z " />
  </g>
</svg>


Preview

Windows

This extension can be used to preview SVG symbols in the file explorer:

Ubuntu

Ubuntu shows SVG previews out of the box.

macOS

The Finder shows only strict formatted SVGs.
Starting with revision 2.1.381, the following SVG header format is also supported by Rocview and will enable preview in the macOS Finder:

<svg width="100%" viewBox="0 0 32 32" xmlns="http://www.w3.org/2000/svg">
  ...
</svg>

For information on the viewBox attribute see:

The former width/height are now part of the viewBox: "x y width height". (Rocview only evaluates the width and height values of the viewBox.)
The width attribute is set to 100% to enable (pre)viewers to scale up to the available space. (Rocview do not evaluate this value.)

If the following option is manually set in the rocview.ini, the conversion will be done automatically:

<gui convertsvg="true" ... >
  ...
</gui>


1)
Dependents of screen resolution and taste.
2)
Cyan=rgb(0,255,255
3)
<g></g> Section
symbols-en.txt · Last modified: 2020/04/20 00:51 by smitt48