User Tools

Site Tools


doc:symlibsvgcompiler

Table of Contents

SVG Symbol Library Compiler

Documentation | Other Specifications | SVG Symbols Compiler

The SVG Library compiler allows the creation of a user-defined SVG symbols library.

Most SVG symbols are accepted. However, some complicated ones, with gradient files, for example, can be rendered incompletely. Generally, please follow SVG Tiny specification for the best results.

Preparation

Create an empty folder and copy your *.svg symbols there. You can place your symbols in subfolders. The compiler will read all the symbols, but the folder organization will be ignored. Only SVG files are supported - SVGZ symbols should be extracted first.

A folder must contain file copyright.txt which briefly (like in 250 characters, but it is not a hard limit) describes your library.

All full black colors (“#00000) within SVG symbols will react to DK Symbol.Color. By specifying colors as #000001 and #000002, you can enforce colors to be interpreted as Symbol.Color and Symbol.OutlineColor.

Each SVG file like myfile.svg must have a corresponding description file name myfile.svg.inf.

[INFO]
CATEGORY=
CAPTION=

Where:

  • CATEGORY
    is a semicolon ‘’;’’ delimited list of categories under which the symbol is listed in the SVG Library dialog box,
    by leaving this empty, a symbol will be hidden from browsing, but it still can be used if accessed by its full name,
  • CAPTION
    is a user-readable description that is listed together with the symbol in the SVG Library dialog box.

Non-ASCII characters should be encoded as UTF8 and a file should have a proper UTF BOM header.

An example file in our library Cirel01.svg.inf is:

[INFO]
CATEGORY=Locators;Circles
CAPTION=Circle 1

Compilation

ttkSymLibCompiler.exe name source output

Where:

  • name
    is a library file name and also symbol prefix; all symbols in a library will be recognized like LIBSVG:prefix:symbol like LIBSVG:std:Cirel01 (name are not case sensitive!); use a unique name preferably using your product or company name; TatukGIS already uses std and s52 names;
  • source
    is a directory where SVG files reside,
  • destination
    is an empty folder (must exist before running compiler) where library name.ttklibsvg will be produced as well as some temporary files (*.svgz),

Example:

ttkSymLibCompiler.exe std c:\project\symbollibrary\std c:\libaryoutput

Usage

The library will be automatically registered if placed together with an executable file of your application.

The library name is not significant as long as the file extension is '.ttklibsvg'. Symbol prefixes, which are the same as the original library name, are embedded upon compilation into the library file.

You can also use TGIS_SymbolLibrarySVG.RegisterFileLibrary method or TGIS_SymbolLibrarySVG.RegisterResourceLibrary method to register your library upon startup.

Download Version

v1.0.2.17

2022/04/07 09:57

Page Tools