source: subversion/utils/osmarender4/symbol-catalogue.xsl @ 2113

Last change on this file since 2113 was 2113, checked in by jochen, 13 years ago

Changed the symbol handling. There is now a new subdirectory "symbols" which contains all the symbols. From these files the symbols.svg is created, which gets included into map SVG files. See Osmarender/Symbols? in the wiki for details.

File size: 2.4 KB
Line 
1<?xml version="1.0" encoding="iso8859-1"?>
2<!-- This stylesheet creates a catalogue of all symbols known to Osmarender -->
3<xsl:stylesheet
4    version="1.0"
5    xmlns="http://www.w3.org/2000/svg"
6    xmlns:svg="http://www.w3.org/2000/svg"
7    xmlns:xlink="http://www.w3.org/1999/xlink"
8    xmlns:xsl="http://www.w3.org/1999/XSL/Transform"
9    exclude-result-prefixes="svg">
10
11    <xsl:output method="xml" omit-xml-declaration="no" indent="yes" encoding="UTF-8"/>
12
13    <xsl:variable name="columns" select="2"/>
14    <xsl:variable name="scale" select="18"/>
15
16    <xsl:template match="/">
17        <svg version="1.1" baseProfile="full" width="210mm" height="297mm">
18            <xsl:comment> This file is created automatically from symbols.svg. DO NOT CHANGE! </xsl:comment>
19            <title>Catalogue of symbols known to Osmarender</title>
20
21            <defs id="def-styles">
22                <style id="styles" type="text/css">
23<xsl:text>
24    .crosshair {
25        stroke-width: 0.05;
26        stroke: #a0a0a0;
27        fill: none;
28    }
29
30    .crosshair-fine {
31        stroke-width: 0.005;
32        stroke: #404040;
33        fill: none;
34    }
35
36    text.desc {
37        font-size: 1;
38    }
39</xsl:text>
40                </style>
41            </defs>
42
43            <xsl:apply-templates select="svg:svg/svg:defs"/>
44
45            <g id="catalogue" transform="scale({$scale})">
46                <xsl:apply-templates select="svg:svg/svg:defs/svg:symbol"/>
47            </g>
48        </svg>
49    </xsl:template>
50
51    <xsl:template match="svg:defs">
52        <xsl:copy-of select="."/>
53    </xsl:template>
54
55    <xsl:template match="svg:symbol">
56        <g id="demo-{substring-after(@id, '-')}" transform="translate({2 + (position()-1) mod $columns * 20}, {2 + floor((position()-1) div $columns) * 3})">
57            <line class="crosshair" x1="-1" y1="0" x2="1" y2="0"/>
58            <line class="crosshair" x1="0" y1="-1" x2="0" y2="1"/>
59            <rect class="crosshair" x="-0.5" y="-0.5" width="1" height="1"/>
60            <line class="crosshair-fine" x1="-1" y1="0" x2="1" y2="0"/>
61            <line class="crosshair-fine" x1="0" y1="-1" x2="0" y2="1"/>
62            <rect class="crosshair-fine" x="-0.5" y="-0.5" width="1" height="1"/>
63            <use xlink:href="#{@id}" width="1" height="1"/>
64            <text class="desc" x="3" y="0.4"><xsl:value-of select="substring-after(@id, '-')"/></text>
65        </g>
66    </xsl:template>
67
68</xsl:stylesheet>
Note: See TracBrowser for help on using the repository browser.