Improved theme styles (#479)
Fonts added: thin, light, medium, black, condensed
This commit is contained in:
@@ -49,6 +49,11 @@
|
|||||||
<xs:enumeration value="monospace" />
|
<xs:enumeration value="monospace" />
|
||||||
<xs:enumeration value="sans_serif" />
|
<xs:enumeration value="sans_serif" />
|
||||||
<xs:enumeration value="serif" />
|
<xs:enumeration value="serif" />
|
||||||
|
<xs:enumeration value="thin" />
|
||||||
|
<xs:enumeration value="light" />
|
||||||
|
<xs:enumeration value="medium" />
|
||||||
|
<xs:enumeration value="black" />
|
||||||
|
<xs:enumeration value="condensed" />
|
||||||
</xs:restriction>
|
</xs:restriction>
|
||||||
</xs:simpleType>
|
</xs:simpleType>
|
||||||
|
|
||||||
|
|||||||
@@ -2,6 +2,7 @@
|
|||||||
* Copyright 2010, 2011, 2012 mapsforge.org
|
* Copyright 2010, 2011, 2012 mapsforge.org
|
||||||
* Copyright 2016-2017 devemux86
|
* Copyright 2016-2017 devemux86
|
||||||
* Copyright 2017 nebular
|
* Copyright 2017 nebular
|
||||||
|
* Copyright 2018 Gustl22
|
||||||
*
|
*
|
||||||
* This file is part of the OpenScienceMap project (http://www.opensciencemap.org).
|
* This file is part of the OpenScienceMap project (http://www.opensciencemap.org).
|
||||||
*
|
*
|
||||||
@@ -26,33 +27,45 @@ import org.oscim.backend.canvas.Paint;
|
|||||||
|
|
||||||
class AndroidPaint implements Paint {
|
class AndroidPaint implements Paint {
|
||||||
|
|
||||||
private static int getStyle(org.oscim.backend.canvas.Paint.FontStyle fontStyle) {
|
private static Typeface getTypeface(org.oscim.backend.canvas.Paint.FontFamily fontFamily,
|
||||||
|
org.oscim.backend.canvas.Paint.FontStyle fontStyle) {
|
||||||
|
final int style;
|
||||||
switch (fontStyle) {
|
switch (fontStyle) {
|
||||||
case BOLD:
|
case BOLD:
|
||||||
return Typeface.BOLD;
|
style = Typeface.BOLD;
|
||||||
|
break;
|
||||||
case BOLD_ITALIC:
|
case BOLD_ITALIC:
|
||||||
return Typeface.BOLD_ITALIC;
|
style = Typeface.BOLD_ITALIC;
|
||||||
|
break;
|
||||||
case ITALIC:
|
case ITALIC:
|
||||||
return Typeface.ITALIC;
|
style = Typeface.ITALIC;
|
||||||
case NORMAL:
|
break;
|
||||||
return Typeface.NORMAL;
|
default:
|
||||||
|
style = Typeface.NORMAL;
|
||||||
|
break;
|
||||||
}
|
}
|
||||||
|
|
||||||
throw new IllegalArgumentException("unknown font style: " + fontStyle);
|
|
||||||
}
|
|
||||||
|
|
||||||
private static Typeface getTypeface(org.oscim.backend.canvas.Paint.FontFamily fontFamily) {
|
|
||||||
switch (fontFamily) {
|
switch (fontFamily) {
|
||||||
case DEFAULT:
|
case DEFAULT:
|
||||||
return Typeface.DEFAULT;
|
return Typeface.create(Typeface.DEFAULT, style);
|
||||||
case DEFAULT_BOLD:
|
case DEFAULT_BOLD:
|
||||||
return Typeface.DEFAULT_BOLD;
|
return Typeface.create(Typeface.DEFAULT_BOLD, style);
|
||||||
case MONOSPACE:
|
case MONOSPACE:
|
||||||
return Typeface.MONOSPACE;
|
return Typeface.create(Typeface.MONOSPACE, style);
|
||||||
case SANS_SERIF:
|
case SANS_SERIF:
|
||||||
return Typeface.SANS_SERIF;
|
return Typeface.create(Typeface.SANS_SERIF, style);
|
||||||
case SERIF:
|
case SERIF:
|
||||||
return Typeface.SERIF;
|
return Typeface.create(Typeface.SERIF, style);
|
||||||
|
case THIN:
|
||||||
|
return Typeface.create("sans-serif-thin", style);
|
||||||
|
case LIGHT:
|
||||||
|
return Typeface.create("sans-serif-light", style);
|
||||||
|
case MEDIUM:
|
||||||
|
return Typeface.create("sans-serif-medium", style);
|
||||||
|
case BLACK:
|
||||||
|
return Typeface.create("sans-serif-black", style);
|
||||||
|
case CONDENSED:
|
||||||
|
return Typeface.create("sans-serif-condensed", style);
|
||||||
}
|
}
|
||||||
|
|
||||||
throw new IllegalArgumentException("unknown font family: " + fontFamily);
|
throw new IllegalArgumentException("unknown font family: " + fontFamily);
|
||||||
@@ -111,9 +124,7 @@ class AndroidPaint implements Paint {
|
|||||||
|
|
||||||
@Override
|
@Override
|
||||||
public void setTypeface(FontFamily fontFamily, FontStyle fontStyle) {
|
public void setTypeface(FontFamily fontFamily, FontStyle fontStyle) {
|
||||||
Typeface typeface = Typeface.create(getTypeface(fontFamily),
|
mPaint.setTypeface(getTypeface(fontFamily, fontStyle));
|
||||||
getStyle(fontStyle));
|
|
||||||
mPaint.setTypeface(typeface);
|
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
|
|||||||
@@ -3,6 +3,7 @@
|
|||||||
* Copyright 2013 Hannes Janetzek
|
* Copyright 2013 Hannes Janetzek
|
||||||
* Copyright 2016-2017 devemux86
|
* Copyright 2016-2017 devemux86
|
||||||
* Copyright 2017 nebular
|
* Copyright 2017 nebular
|
||||||
|
* Copyright 2018 Gustl22
|
||||||
*
|
*
|
||||||
* This file is part of the OpenScienceMap project (http://www.opensciencemap.org).
|
* This file is part of the OpenScienceMap project (http://www.opensciencemap.org).
|
||||||
*
|
*
|
||||||
@@ -48,20 +49,37 @@ public class AwtPaint implements Paint {
|
|||||||
throw new IllegalArgumentException("unknown cap: " + cap);
|
throw new IllegalArgumentException("unknown cap: " + cap);
|
||||||
}
|
}
|
||||||
|
|
||||||
private static String getFontName(FontFamily fontFamily) {
|
private static Font getFont(FontFamily fontFamily, FontStyle fontStyle, int textSize) {
|
||||||
|
final Map<Attribute, Object> attributes;
|
||||||
|
String name = null;
|
||||||
switch (fontFamily) {
|
switch (fontFamily) {
|
||||||
case MONOSPACE:
|
case MONOSPACE:
|
||||||
return Font.MONOSPACED;
|
attributes = TEXT_ATTRIBUTES;
|
||||||
case DEFAULT:
|
name = Font.MONOSPACED;
|
||||||
case DEFAULT_BOLD:
|
break;
|
||||||
return null;
|
|
||||||
case SANS_SERIF:
|
case SANS_SERIF:
|
||||||
return Font.SANS_SERIF;
|
attributes = TEXT_ATTRIBUTES;
|
||||||
|
name = Font.SANS_SERIF;
|
||||||
|
break;
|
||||||
case SERIF:
|
case SERIF:
|
||||||
return Font.SERIF;
|
attributes = TEXT_ATTRIBUTES;
|
||||||
|
name = Font.SERIF;
|
||||||
|
break;
|
||||||
|
case MEDIUM: // Java deriveFont does not differ this weight
|
||||||
|
case BLACK:
|
||||||
|
attributes = new HashMap<>(TEXT_ATTRIBUTES);
|
||||||
|
attributes.put(TextAttribute.WEIGHT, TextAttribute.WEIGHT_BOLD);
|
||||||
|
break;
|
||||||
|
case CONDENSED:
|
||||||
|
attributes = new HashMap<>(TEXT_ATTRIBUTES);
|
||||||
|
attributes.put(TextAttribute.WIDTH, TextAttribute.WIDTH_CONDENSED);
|
||||||
|
break;
|
||||||
|
default:
|
||||||
|
// THIN and LIGHT aren't differed from DEFAULT in Java deriveFont
|
||||||
|
attributes = TEXT_ATTRIBUTES;
|
||||||
|
break;
|
||||||
}
|
}
|
||||||
|
return new Font(name, getFontStyle(fontStyle), textSize).deriveFont(attributes);
|
||||||
throw new IllegalArgumentException("unknown fontFamily: " + fontFamily);
|
|
||||||
}
|
}
|
||||||
|
|
||||||
private static int getFontStyle(FontStyle fontStyle) {
|
private static int getFontStyle(FontStyle fontStyle) {
|
||||||
@@ -108,8 +126,6 @@ public class AwtPaint implements Paint {
|
|||||||
Stroke stroke;
|
Stroke stroke;
|
||||||
Style style = Style.FILL;
|
Style style = Style.FILL;
|
||||||
private int cap = getCap(Cap.BUTT);
|
private int cap = getCap(Cap.BUTT);
|
||||||
private String fontName = DEFAULT_FONT.getFontName();
|
|
||||||
private int fontStyle = DEFAULT_FONT.getStyle();
|
|
||||||
private int join = getJoin(Join.MITER);
|
private int join = getJoin(Join.MITER);
|
||||||
private float strokeWidth;
|
private float strokeWidth;
|
||||||
private float textSize = DEFAULT_FONT.getSize();
|
private float textSize = DEFAULT_FONT.getSize();
|
||||||
@@ -169,9 +185,7 @@ public class AwtPaint implements Paint {
|
|||||||
|
|
||||||
@Override
|
@Override
|
||||||
public void setTypeface(FontFamily fontFamily, FontStyle fontStyle) {
|
public void setTypeface(FontFamily fontFamily, FontStyle fontStyle) {
|
||||||
this.fontName = getFontName(fontFamily);
|
this.font = getFont(fontFamily, fontStyle, (int) this.textSize);
|
||||||
this.fontStyle = getFontStyle(fontStyle);
|
|
||||||
this.font = new Font(this.fontName, this.fontStyle, (int) this.textSize).deriveFont(this.TEXT_ATTRIBUTES);
|
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
|
|||||||
@@ -296,7 +296,7 @@
|
|||||||
-->
|
-->
|
||||||
</m>
|
</m>
|
||||||
<m zoom-min="17">
|
<m zoom-min="17">
|
||||||
<caption fill="#4040ff" font-size="10" font-style="bold" k="name" stroke="#ffffff"
|
<caption fill="#2d51bc" font-size="10" font-style="bold" k="name" stroke="#ffffff"
|
||||||
stroke-width="2.0" />
|
stroke-width="2.0" />
|
||||||
<caption fill="#606060" font-size="10" font-style="bold" k="addr:housenumber"
|
<caption fill="#606060" font-size="10" font-style="bold" k="addr:housenumber"
|
||||||
stroke="#ffffff" stroke-width="2.0" />
|
stroke="#ffffff" stroke-width="2.0" />
|
||||||
@@ -629,9 +629,9 @@
|
|||||||
-->
|
-->
|
||||||
<!-- historic -->
|
<!-- historic -->
|
||||||
<!--
|
<!--
|
||||||
<m k="historic"> <circle r="3" fill="#4040ff" stroke="#606060"
|
<m k="historic"> <circle r="3" fill="#2d51bc" stroke="#606060"
|
||||||
width="1.5" /> <m zoom-min="17"> <caption
|
width="1.5" /> <m zoom-min="17"> <caption
|
||||||
k="name" dy="10" font-style="bold" font-size="10" fill="#4040ff" stroke="#ffffff"
|
k="name" dy="10" font-style="bold" font-size="10" fill="#2d51bc" stroke="#ffffff"
|
||||||
width="2.0" /> </m> </m>
|
width="2.0" /> </m> </m>
|
||||||
-->
|
-->
|
||||||
<!-- house numbers -->
|
<!-- house numbers -->
|
||||||
@@ -672,16 +672,16 @@
|
|||||||
<!-- railway -->
|
<!-- railway -->
|
||||||
<m k="railway">
|
<m k="railway">
|
||||||
<m v="station" zoom-min="14">
|
<m v="station" zoom-min="14">
|
||||||
<circle fill="#ec2d2d" r="6" stroke="#606060" stroke-width="1.5" />
|
<circle fill="#af3a3a" r="6" stroke="#606060" stroke-width="1.5" />
|
||||||
<!--
|
<!--
|
||||||
<caption k="name" dy="15" font-style="bold" font-size="13" fill="#ec2d2d"
|
<caption k="name" dy="15" font-style="bold" font-size="13" fill="#af3a3a"
|
||||||
stroke="#ffffff" stroke-width="2.0" />
|
stroke="#ffffff" stroke-width="2.0" />
|
||||||
-->
|
-->
|
||||||
</m>
|
</m>
|
||||||
<m v="halt|tram_stop" zoom-min="17">
|
<m v="halt|tram_stop" zoom-min="17">
|
||||||
<circle fill="#ec2d2d" r="4" stroke="#606060" stroke-width="1.5" />
|
<circle fill="#af3a3a" r="4" stroke="#606060" stroke-width="1.5" />
|
||||||
<!--
|
<!--
|
||||||
<caption k="name" dy="10" font-style="bold" font-size="11" fill="#ec2d2d"
|
<caption k="name" dy="10" font-style="bold" font-size="11" fill="#af3a3a"
|
||||||
stroke="#ffffff" stroke-width="2.0" />
|
stroke="#ffffff" stroke-width="2.0" />
|
||||||
-->
|
-->
|
||||||
</m>
|
</m>
|
||||||
@@ -697,7 +697,7 @@
|
|||||||
</m>
|
</m>
|
||||||
|
|
||||||
<m k="building_label" zoom-min="14">
|
<m k="building_label" zoom-min="14">
|
||||||
<caption fill="#1d2e6f" font-size="14" style="italic" k="name" priority="20"
|
<caption style="italic" fill="#1d2e6f" font-size="14" k="name" priority="20"
|
||||||
stroke="#9daeef" stroke-width="0.8" />
|
stroke="#9daeef" stroke-width="0.8" />
|
||||||
</m>
|
</m>
|
||||||
|
|
||||||
|
|||||||
@@ -2,6 +2,7 @@
|
|||||||
* Copyright 2016 Longri
|
* Copyright 2016 Longri
|
||||||
* Copyright 2016-2017 devemux86
|
* Copyright 2016-2017 devemux86
|
||||||
* Copyright 2017 nebular
|
* Copyright 2017 nebular
|
||||||
|
* Copyright 2018 Gustl22
|
||||||
*
|
*
|
||||||
* This program is free software: you can redistribute it and/or modify it under the
|
* This program is free software: you can redistribute it and/or modify it under the
|
||||||
* terms of the GNU Lesser General Public License as published by the Free Software
|
* terms of the GNU Lesser General Public License as published by the Free Software
|
||||||
@@ -61,10 +62,6 @@ public class IosPaint implements Paint {
|
|||||||
return CGLineJoin.Miter;
|
return CGLineJoin.Miter;
|
||||||
}
|
}
|
||||||
|
|
||||||
private static final String DEFAULT_FONT_NAME = UIFont.getSystemFont(1, UIFontWeight.Semibold).getFontDescriptor().getPostscriptName();
|
|
||||||
private static final String DEFAULT_FONT_NAME_BOLD = UIFont.getSystemFont(1, UIFontWeight.Bold).getFontDescriptor().getPostscriptName();
|
|
||||||
private static final String DEFAULT_FONT_NAME_ITALIC = UIFont.getItalicSystemFont(1).getFontDescriptor().getPostscriptName();
|
|
||||||
|
|
||||||
private Align align;
|
private Align align;
|
||||||
private final NSAttributedStringAttributes attribs = new NSAttributedStringAttributes();
|
private final NSAttributedStringAttributes attribs = new NSAttributedStringAttributes();
|
||||||
private CGLineCap cap = CGLineCap.Butt;
|
private CGLineCap cap = CGLineCap.Butt;
|
||||||
@@ -210,100 +207,130 @@ public class IosPaint implements Paint {
|
|||||||
/*
|
/*
|
||||||
DEVICE_DEFAULT = [iOS == getDeviceDefault()], [Android == 'Roboto']
|
DEVICE_DEFAULT = [iOS == getDeviceDefault()], [Android == 'Roboto']
|
||||||
MONOSPACE = [iOS == 'Courier'], [Android == 'Droid Sans Mono']
|
MONOSPACE = [iOS == 'Courier'], [Android == 'Droid Sans Mono']
|
||||||
SANS_SERIF = [iOS == 'Verdena'], [Android == 'Droid Sans']
|
SANS_SERIF = [iOS == 'HelveticaNeue'], [Android == 'Droid Sans']
|
||||||
SERIF = [iOS == 'Georgia'], [Android == 'Droid Serif']
|
SERIF = [iOS == 'Georgia'], [Android == 'Droid Serif']
|
||||||
*/
|
*/
|
||||||
|
|
||||||
String fontname = DEFAULT_FONT_NAME;
|
// Better approach: use font descriptor
|
||||||
|
// UIFontDescriptor fontD = font.getFontDescriptor();
|
||||||
|
|
||||||
|
UIFontWeight weight = UIFontWeight.Regular;
|
||||||
switch (this.fontFamily) {
|
switch (this.fontFamily) {
|
||||||
case DEFAULT:
|
|
||||||
// set Style
|
|
||||||
switch (this.fontStyle) {
|
|
||||||
case NORMAL:
|
|
||||||
fontname = DEFAULT_FONT_NAME;
|
|
||||||
break;
|
|
||||||
case BOLD:
|
|
||||||
fontname = DEFAULT_FONT_NAME_BOLD;
|
|
||||||
break;
|
|
||||||
case BOLD_ITALIC:
|
|
||||||
fontname = DEFAULT_FONT_NAME_BOLD;
|
|
||||||
break;
|
|
||||||
case ITALIC:
|
|
||||||
fontname = DEFAULT_FONT_NAME_ITALIC;
|
|
||||||
break;
|
|
||||||
}
|
|
||||||
break;
|
|
||||||
case DEFAULT_BOLD:
|
case DEFAULT_BOLD:
|
||||||
// ignore style
|
weight = UIFontWeight.Bold;
|
||||||
fontname = DEFAULT_FONT_NAME_BOLD;
|
|
||||||
break;
|
break;
|
||||||
case MONOSPACE:
|
case MEDIUM:
|
||||||
// set Style
|
weight = UIFontWeight.Medium;
|
||||||
switch (this.fontStyle) {
|
|
||||||
case NORMAL:
|
|
||||||
fontname = "CourierNewPS-BoldMT";
|
|
||||||
break;
|
|
||||||
case BOLD:
|
|
||||||
fontname = "CourierNewPS-BoldMT";
|
|
||||||
break;
|
|
||||||
case BOLD_ITALIC:
|
|
||||||
fontname = "CourierNewPS-BoldMT";
|
|
||||||
break;
|
|
||||||
case ITALIC:
|
|
||||||
fontname = "CourierNewPS-BoldMT";
|
|
||||||
break;
|
|
||||||
}
|
|
||||||
break;
|
break;
|
||||||
case SANS_SERIF:
|
case THIN:
|
||||||
// set Style
|
weight = UIFontWeight.Thin;
|
||||||
switch (this.fontStyle) {
|
|
||||||
case NORMAL:
|
|
||||||
fontname = "Verdana";
|
|
||||||
break;
|
|
||||||
case BOLD:
|
|
||||||
fontname = "Verdana-Bold";
|
|
||||||
break;
|
|
||||||
case BOLD_ITALIC:
|
|
||||||
fontname = "Verdana-BoldItalic";
|
|
||||||
break;
|
|
||||||
case ITALIC:
|
|
||||||
fontname = "Verdana-Italic";
|
|
||||||
break;
|
|
||||||
}
|
|
||||||
break;
|
break;
|
||||||
case SERIF:
|
case LIGHT:
|
||||||
// set Style
|
weight = UIFontWeight.Light;
|
||||||
switch (this.fontStyle) {
|
|
||||||
case NORMAL:
|
|
||||||
fontname = "Georgia";
|
|
||||||
break;
|
|
||||||
case BOLD:
|
|
||||||
fontname = "Georgia-Bold";
|
|
||||||
break;
|
|
||||||
case BOLD_ITALIC:
|
|
||||||
fontname = "Georgia-BoldItalic";
|
|
||||||
break;
|
|
||||||
case ITALIC:
|
|
||||||
fontname = "Georgia-Italic";
|
|
||||||
break;
|
|
||||||
}
|
|
||||||
break;
|
break;
|
||||||
|
case BLACK:
|
||||||
|
weight = UIFontWeight.Black;
|
||||||
|
break;
|
||||||
|
// case SANS_SERIF:
|
||||||
|
// break;
|
||||||
|
// case CONDENSED:
|
||||||
|
// break;
|
||||||
|
// case SERIF:
|
||||||
|
// break;
|
||||||
|
// case MONOSPACE:
|
||||||
|
// break;
|
||||||
}
|
}
|
||||||
|
|
||||||
synchronized (attribs) {
|
synchronized (attribs) {
|
||||||
String key = fontname + this.textSize;
|
UIFont font = null;
|
||||||
|
String fontname = null;
|
||||||
|
|
||||||
//try to get buffered font
|
switch (this.fontStyle) {
|
||||||
UIFont font = fontHashMap.get(key);
|
case BOLD:
|
||||||
|
switch (this.fontFamily) {
|
||||||
|
case CONDENSED:
|
||||||
|
fontname = "HelveticaNeue-CondensedBold";
|
||||||
|
break;
|
||||||
|
case SERIF:
|
||||||
|
fontname = "Georgia-Bold";
|
||||||
|
break;
|
||||||
|
case MONOSPACE:
|
||||||
|
fontname = "CourierNewPS-BoldMT";
|
||||||
|
break;
|
||||||
|
default:
|
||||||
|
// Always bold
|
||||||
|
font = UIFont.getSystemFont(textSize, UIFontWeight.Bold);
|
||||||
|
break;
|
||||||
|
}
|
||||||
|
break;
|
||||||
|
case ITALIC:
|
||||||
|
switch (this.fontFamily) {
|
||||||
|
case CONDENSED:
|
||||||
|
fontname = "HelveticaNeue-Italic";
|
||||||
|
break;
|
||||||
|
case SERIF:
|
||||||
|
fontname = "Georgia-Italic";
|
||||||
|
break;
|
||||||
|
case MONOSPACE:
|
||||||
|
fontname = "CourierNewPS-ItalicMT";
|
||||||
|
break;
|
||||||
|
default:
|
||||||
|
// Add differences in italic weight
|
||||||
|
font = UIFont.getItalicSystemFont(textSize);
|
||||||
|
break;
|
||||||
|
}
|
||||||
|
break;
|
||||||
|
case BOLD_ITALIC:
|
||||||
|
switch (this.fontFamily) {
|
||||||
|
case CONDENSED:
|
||||||
|
fontname = "HelveticaNeue-BoldItalic";
|
||||||
|
break;
|
||||||
|
case SERIF:
|
||||||
|
fontname = "Georgia-BoldItalic";
|
||||||
|
break;
|
||||||
|
case MONOSPACE:
|
||||||
|
fontname = "CourierNewPS-BoldItalicMT";
|
||||||
|
break;
|
||||||
|
default:
|
||||||
|
// Always bold and italic
|
||||||
|
fontname = "HelveticaNeue-BoldItalic";
|
||||||
|
break;
|
||||||
|
}
|
||||||
|
break;
|
||||||
|
default:
|
||||||
|
switch (this.fontFamily) {
|
||||||
|
case CONDENSED:
|
||||||
|
fontname = "HelveticaNeue";
|
||||||
|
// or if better "HelveticaNeue-CondensedBold", cond. regular not available
|
||||||
|
break;
|
||||||
|
case SERIF:
|
||||||
|
fontname = "Georgia";
|
||||||
|
break;
|
||||||
|
case MONOSPACE:
|
||||||
|
fontname = "CourierNewPSMT";
|
||||||
|
break;
|
||||||
|
default:
|
||||||
|
font = UIFont.getSystemFont(textSize, weight);
|
||||||
|
break;
|
||||||
|
}
|
||||||
|
break;
|
||||||
|
}
|
||||||
|
|
||||||
if (font == null) {
|
if (font == null) {
|
||||||
CTFont ctFont = CTFont.create(fontname, this.textSize, CGAffineTransform.Identity());
|
String key = fontname + this.textSize;
|
||||||
|
|
||||||
descent = (float) ctFont.getDescent();
|
//try to get buffered font
|
||||||
fontHeight = (float) ctFont.getBoundingBox().getHeight();
|
font = fontHashMap.get(key);
|
||||||
|
|
||||||
font = ctFont.as(UIFont.class);
|
if (font == null) {
|
||||||
fontHashMap.put(key, font);
|
CTFont ctFont = CTFont.create(fontname, this.textSize, CGAffineTransform.Identity());
|
||||||
|
|
||||||
|
descent = (float) ctFont.getDescent();
|
||||||
|
fontHeight = (float) ctFont.getBoundingBox().getHeight();
|
||||||
|
|
||||||
|
font = ctFont.as(UIFont.class);
|
||||||
|
fontHashMap.put(key, font);
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
CTFont ctFont = font.as(CTFont.class);
|
CTFont ctFont = font.as(CTFont.class);
|
||||||
|
|||||||
@@ -6,6 +6,9 @@
|
|||||||
<!-- base style for fixed width lines -->
|
<!-- base style for fixed width lines -->
|
||||||
<style-line cap="butt" fix="true" id="fix" width="1.0" />
|
<style-line cap="butt" fix="true" id="fix" width="1.0" />
|
||||||
|
|
||||||
|
<style-text caption="true" dy="20" fill="#2d51bc" font-family="medium" id="caption-small-blue"
|
||||||
|
k="name" size="14" stroke="#ffffff" stroke-width="2.0" />
|
||||||
|
|
||||||
<style-text fill="#101010" id="road" k="name" priority="2" size="16" stroke="#eeeeee"
|
<style-text fill="#101010" id="road" k="name" priority="2" size="16" stroke="#eeeeee"
|
||||||
stroke-width="2.0" />
|
stroke-width="2.0" />
|
||||||
|
|
||||||
@@ -605,10 +608,9 @@
|
|||||||
<extrusion line-color="#ffd9d8d6" side-color="#eaecebe9" top-color="#eaf9f8f6" />
|
<extrusion line-color="#ffd9d8d6" side-color="#eaecebe9" top-color="#eaf9f8f6" />
|
||||||
</m>
|
</m>
|
||||||
<m zoom-min="17">
|
<m zoom-min="17">
|
||||||
<caption style="bold" fill="#4040ff" k="name" priority="9" size="14"
|
<text priority="9" use="caption-small-blue" />
|
||||||
stroke="#ffffff" stroke-width="2.0" />
|
<caption style="bold" fill="#606060" font-family="condensed" k="addr:housenumber"
|
||||||
<caption style="bold" fill="#606060" k="addr:housenumber" priority="10" size="12"
|
priority="10" size="12" stroke="#ffffff" stroke-width="2.0" />
|
||||||
stroke="#ffffff" stroke-width="2.0" />
|
|
||||||
</m>
|
</m>
|
||||||
</m>
|
</m>
|
||||||
|
|
||||||
@@ -1007,7 +1009,7 @@
|
|||||||
|
|
||||||
<!-- historic -->
|
<!-- historic -->
|
||||||
<!-- <m k="historic" v="ruins" zoom-min="17">
|
<!-- <m k="historic" v="ruins" zoom-min="17">
|
||||||
<caption k="name" style="bold" size="10" fill="#4040ff" stroke="#ffffff" stroke-width="2.0"
|
<caption k="name" style="bold" size="10" fill="#2d51bc" stroke="#ffffff" stroke-width="2.0"
|
||||||
/>
|
/>
|
||||||
</m> -->
|
</m> -->
|
||||||
|
|
||||||
@@ -1126,13 +1128,13 @@
|
|||||||
<m k="railway">
|
<m k="railway">
|
||||||
<m v="station" zoom-min="14">
|
<m v="station" zoom-min="14">
|
||||||
<symbol src="assets:symbols/transport/train_station2.svg" />
|
<symbol src="assets:symbols/transport/train_station2.svg" />
|
||||||
<caption style="bold" dy="20" fill="#ec2d2d" k="name" size="14" stroke="#ffffff"
|
<caption style="bold" dy="20" fill="#af3a3a" k="name" size="14" stroke="#ffffff"
|
||||||
stroke-width="2.0" />
|
stroke-width="2.0" />
|
||||||
</m>
|
</m>
|
||||||
|
|
||||||
<m v="halt|tram_stop">
|
<m v="halt|tram_stop">
|
||||||
<symbol src="assets:symbols/transport/tram_stop.svg" />
|
<symbol src="assets:symbols/transport/tram_stop.svg" />
|
||||||
<caption style="bold" dy="20" fill="#ec2d2d" k="name" size="14" stroke="#ffffff"
|
<caption style="bold" dy="20" fill="#af3a3a" k="name" size="12" stroke="#ffffff"
|
||||||
stroke-width="2.0" />
|
stroke-width="2.0" />
|
||||||
</m>
|
</m>
|
||||||
<m v="level_crossing">
|
<m v="level_crossing">
|
||||||
@@ -1283,10 +1285,14 @@
|
|||||||
<symbol src="assets:symbols/amenity/toilets.svg" />
|
<symbol src="assets:symbols/amenity/toilets.svg" />
|
||||||
</m>
|
</m>
|
||||||
</m>
|
</m>
|
||||||
|
|
||||||
|
<m zoom-min="15">
|
||||||
|
<text use="caption-small-blue" />
|
||||||
|
</m>
|
||||||
</m>
|
</m>
|
||||||
|
|
||||||
<m k="shop">
|
<m k="shop">
|
||||||
<m select="first" zoom-min="15">
|
<m select="first" zoom-min="16">
|
||||||
<m v="bakery">
|
<m v="bakery">
|
||||||
<symbol src="assets:symbols/shopping/bakery.svg" />
|
<symbol src="assets:symbols/shopping/bakery.svg" />
|
||||||
</m>
|
</m>
|
||||||
@@ -1308,6 +1314,10 @@
|
|||||||
<text use="poi" />
|
<text use="poi" />
|
||||||
</m>
|
</m>
|
||||||
</m>
|
</m>
|
||||||
|
|
||||||
|
<m zoom-min="15">
|
||||||
|
<text use="caption-small-blue" />
|
||||||
|
</m>
|
||||||
</m>
|
</m>
|
||||||
|
|
||||||
<m k="tourism">
|
<m k="tourism">
|
||||||
@@ -1349,6 +1359,9 @@
|
|||||||
<symbol src="assets:symbols/tourist/museum.svg" />
|
<symbol src="assets:symbols/tourist/museum.svg" />
|
||||||
</m>
|
</m>
|
||||||
|
|
||||||
|
<m zoom-min="15">
|
||||||
|
<text use="caption-small-blue" />
|
||||||
|
</m>
|
||||||
</m>
|
</m>
|
||||||
|
|
||||||
<m k="natural" v="peak" zoom-min="12">
|
<m k="natural" v="peak" zoom-min="12">
|
||||||
@@ -1361,8 +1374,8 @@
|
|||||||
|
|
||||||
<!-- house numbers -->
|
<!-- house numbers -->
|
||||||
<m k="addr:housenumber" zoom-min="17">
|
<m k="addr:housenumber" zoom-min="17">
|
||||||
<caption style="bold" fill="#606060" k="addr:housenumber" size="12" stroke="#ffffff"
|
<caption style="bold" fill="#606060" font-family="condensed" k="addr:housenumber"
|
||||||
stroke-width="2.0" />
|
size="12" stroke="#ffffff" stroke-width="2.0" />
|
||||||
</m>
|
</m>
|
||||||
</m>
|
</m>
|
||||||
|
|
||||||
|
|||||||
@@ -602,10 +602,10 @@
|
|||||||
<extrusion line-color="#ffd9d8d6" side-color="#eaecebe9" top-color="#eaf9f8f6" />
|
<extrusion line-color="#ffd9d8d6" side-color="#eaecebe9" top-color="#eaf9f8f6" />
|
||||||
</m>
|
</m>
|
||||||
<m zoom-min="17">
|
<m zoom-min="17">
|
||||||
<caption style="bold" fill="#4040ff" k="name" priority="9" size="14"
|
<caption style="bold" fill="#2d51bc" k="name" priority="9" size="14"
|
||||||
stroke="#ffffff" stroke-width="2.0" />
|
|
||||||
<caption style="bold" fill="#606060" k="addr_housenumber" priority="10" size="12"
|
|
||||||
stroke="#ffffff" stroke-width="2.0" />
|
stroke="#ffffff" stroke-width="2.0" />
|
||||||
|
<caption style="bold" fill="#606060" font-family="condensed" k="addr_housenumber"
|
||||||
|
priority="10" size="12" stroke="#ffffff" stroke-width="2.0" />
|
||||||
</m>
|
</m>
|
||||||
</m>
|
</m>
|
||||||
|
|
||||||
@@ -1004,7 +1004,7 @@
|
|||||||
|
|
||||||
<!-- historic -->
|
<!-- historic -->
|
||||||
<!-- <m k="historic" v="ruins" zoom-min="17">
|
<!-- <m k="historic" v="ruins" zoom-min="17">
|
||||||
<caption k="name" style="bold" size="10" fill="#4040ff" stroke="#ffffff" stroke-width="2.0"
|
<caption k="name" style="bold" size="10" fill="#2d51bc" stroke="#ffffff" stroke-width="2.0"
|
||||||
/>
|
/>
|
||||||
</m> -->
|
</m> -->
|
||||||
|
|
||||||
@@ -1148,13 +1148,13 @@
|
|||||||
<m k="kind">
|
<m k="kind">
|
||||||
<m v="station" zoom-min="14">
|
<m v="station" zoom-min="14">
|
||||||
<symbol src="assets:symbols/transport/train_station2.svg" />
|
<symbol src="assets:symbols/transport/train_station2.svg" />
|
||||||
<caption style="bold" dy="20" fill="#ec2d2d" k="name" size="14" stroke="#ffffff"
|
<caption style="bold" dy="20" fill="#af3a3a" k="name" size="14" stroke="#ffffff"
|
||||||
stroke-width="2.0" />
|
stroke-width="2.0" />
|
||||||
</m>
|
</m>
|
||||||
|
|
||||||
<m v="halt|tram_stop">
|
<m v="halt|tram_stop">
|
||||||
<symbol src="assets:symbols/transport/tram_stop.svg" />
|
<symbol src="assets:symbols/transport/tram_stop.svg" />
|
||||||
<caption style="bold" dy="20" fill="#ec2d2d" k="name" size="14" stroke="#ffffff"
|
<caption style="bold" dy="20" fill="#af3a3a" k="name" size="12" stroke="#ffffff"
|
||||||
stroke-width="2.0" />
|
stroke-width="2.0" />
|
||||||
</m>
|
</m>
|
||||||
<m v="level_crossing">
|
<m v="level_crossing">
|
||||||
@@ -1384,8 +1384,8 @@
|
|||||||
|
|
||||||
<!-- house numbers -->
|
<!-- house numbers -->
|
||||||
<m k="addr_housenumber" zoom-min="17">
|
<m k="addr_housenumber" zoom-min="17">
|
||||||
<caption style="bold" fill="#606060" k="addr:housenumber" size="12" stroke="#ffffff"
|
<caption style="bold" fill="#606060" font-family="condensed" k="addr:housenumber"
|
||||||
stroke-width="2.0" />
|
size="12" stroke="#ffffff" stroke-width="2.0" />
|
||||||
</m>
|
</m>
|
||||||
</m>
|
</m>
|
||||||
|
|
||||||
|
|||||||
@@ -540,10 +540,11 @@
|
|||||||
<extrusion line-color="#10ffffff" side-color="#cc202020" top-color="#cc404040" />
|
<extrusion line-color="#10ffffff" side-color="#cc202020" top-color="#cc404040" />
|
||||||
</m>
|
</m>
|
||||||
<m zoom-min="17">
|
<m zoom-min="17">
|
||||||
<caption style="bold" fill="#4040ff" k="name" priority="9" size="14"
|
<m zoom-min="17">
|
||||||
stroke="#ffffff" stroke-width="2.0" />
|
<text use="caption-small-blue" />
|
||||||
<caption style="bold" fill="#ffffff" k="addr:housenumber" priority="10" size="12"
|
</m>
|
||||||
stroke="#606060" stroke-width="2.0" />
|
<caption style="bold" fill="#ffffff" font-family="condensed" k="addr:housenumber"
|
||||||
|
priority="10" size="12" stroke="#606060" stroke-width="2.0" />
|
||||||
</m>
|
</m>
|
||||||
</m>
|
</m>
|
||||||
|
|
||||||
@@ -1016,7 +1017,7 @@
|
|||||||
|
|
||||||
<!-- historic -->
|
<!-- historic -->
|
||||||
<!-- <m k="historic" v="ruins" zoom-min="17">
|
<!-- <m k="historic" v="ruins" zoom-min="17">
|
||||||
<caption k="name" style="bold" size="10" fill="#4040ff" stroke="#ffffff" stroke-width="2.0"
|
<caption k="name" style="bold" size="10" fill="#2d51bc" stroke="#ffffff" stroke-width="2.0"
|
||||||
/>
|
/>
|
||||||
</m> -->
|
</m> -->
|
||||||
|
|
||||||
@@ -1281,12 +1282,12 @@
|
|||||||
</m>
|
</m>
|
||||||
<m v="station" zoom-min="14">
|
<m v="station" zoom-min="14">
|
||||||
<symbol src="assets:symbols/transport/train_station2.svg" />
|
<symbol src="assets:symbols/transport/train_station2.svg" />
|
||||||
<caption style="bold" dy="20" fill="#ec2d2d" k="name" size="14" stroke="#ffffff"
|
<caption style="bold" dy="20" fill="#af3a3a" k="name" size="14" stroke="#ffffff"
|
||||||
stroke-width="2.0" />
|
stroke-width="2.0" />
|
||||||
</m>
|
</m>
|
||||||
<m v="halt|tram_stop" zoom-min="15">
|
<m v="halt|tram_stop" zoom-min="15">
|
||||||
<symbol src="assets:symbols/transport/tram_stop.svg" />
|
<symbol src="assets:symbols/transport/tram_stop.svg" />
|
||||||
<caption style="bold" dy="20" fill="#ec2d2d" k="name" size="14" stroke="#ffffff"
|
<caption style="bold" dy="20" fill="#af3a3a" k="name" size="12" stroke="#ffffff"
|
||||||
stroke-width="2.0" />
|
stroke-width="2.0" />
|
||||||
</m>
|
</m>
|
||||||
</m>
|
</m>
|
||||||
@@ -1339,8 +1340,8 @@
|
|||||||
|
|
||||||
<!-- house numbers -->
|
<!-- house numbers -->
|
||||||
<m k="addr:housenumber" zoom-min="17">
|
<m k="addr:housenumber" zoom-min="17">
|
||||||
<caption style="bold" fill="#ffffff" k="addr:housenumber" size="12" stroke="#606060"
|
<caption style="bold" fill="#ffffff" font-family="condensed" k="addr:housenumber"
|
||||||
stroke-width="2.0" />
|
size="12" stroke="#606060" stroke-width="2.0" />
|
||||||
</m>
|
</m>
|
||||||
</m>
|
</m>
|
||||||
|
|
||||||
|
|||||||
@@ -6,6 +6,9 @@
|
|||||||
<!-- base style for fixed width lines -->
|
<!-- base style for fixed width lines -->
|
||||||
<style-line cap="butt" fix="true" id="fix" width="1.0" />
|
<style-line cap="butt" fix="true" id="fix" width="1.0" />
|
||||||
|
|
||||||
|
<style-text caption="true" dy="20" fill="#2d51bc" font-family="medium" id="caption-small-blue"
|
||||||
|
k="name" size="14" stroke="#ffffff" stroke-width="2.0" />
|
||||||
|
|
||||||
<style-text fill="#101010" id="road" k="name" priority="2" size="16" stroke="#eeeeee"
|
<style-text fill="#101010" id="road" k="name" priority="2" size="16" stroke="#eeeeee"
|
||||||
stroke-width="2.0" />
|
stroke-width="2.0" />
|
||||||
|
|
||||||
@@ -403,6 +406,9 @@
|
|||||||
<symbol src="assets:symbols/tourist/museum.svg" />
|
<symbol src="assets:symbols/tourist/museum.svg" />
|
||||||
</m>
|
</m>
|
||||||
|
|
||||||
|
<m zoom-min="14">
|
||||||
|
<text use="caption-small-blue" />
|
||||||
|
</m>
|
||||||
</m>
|
</m>
|
||||||
</m>
|
</m>
|
||||||
</rendertheme>
|
</rendertheme>
|
||||||
|
|||||||
@@ -9,8 +9,8 @@
|
|||||||
<style-line id="secondary" stroke="#c6c6c6" width="1.4" />
|
<style-line id="secondary" stroke="#c6c6c6" width="1.4" />
|
||||||
<style-line id="tertiary" stroke="#f7f7f7" width="1.15" />
|
<style-line id="tertiary" stroke="#f7f7f7" width="1.15" />
|
||||||
|
|
||||||
<style-text style="bold" caption="true" dy="20" fill="#4d4d4d" id="caption-small-blue" k="name"
|
<style-text caption="true" dy="20" fill="#4d4d4d" font-family="medium" id="caption-small-blue"
|
||||||
size="14" stroke="#ffffff" stroke-width="2.0" />
|
k="name" size="14" stroke="#ffffff" stroke-width="2.0" />
|
||||||
|
|
||||||
<style-text style="bold" id="highway-road" k="name" size="16" stroke="#d0d0d0"
|
<style-text style="bold" id="highway-road" k="name" size="16" stroke="#d0d0d0"
|
||||||
stroke-width="2.0" />
|
stroke-width="2.0" />
|
||||||
@@ -559,8 +559,8 @@
|
|||||||
|
|
||||||
<m zoom-min="17">
|
<m zoom-min="17">
|
||||||
<text priority="9" use="caption-small-blue" />
|
<text priority="9" use="caption-small-blue" />
|
||||||
<caption style="bold" fill="#606060" k="addr:housenumber" priority="10" size="12"
|
<caption style="bold" fill="#606060" font-family="condensed" k="addr:housenumber"
|
||||||
stroke="#ffffff" stroke-width="2.0" />
|
priority="10" size="12" stroke="#ffffff" stroke-width="2.0" />
|
||||||
</m>
|
</m>
|
||||||
</m>
|
</m>
|
||||||
|
|
||||||
@@ -1095,7 +1095,7 @@
|
|||||||
</m>
|
</m>
|
||||||
|
|
||||||
<!--<m k="historic" v="ruins" zoom-min="17">
|
<!--<m k="historic" v="ruins" zoom-min="17">
|
||||||
<caption style="bold" fill="#4040ff" k="name" size="16" stroke="#ffffff"
|
<caption style="bold" fill="#2d51bc" k="name" size="16" stroke="#ffffff"
|
||||||
stroke-width="2.0" />
|
stroke-width="2.0" />
|
||||||
</m>-->
|
</m>-->
|
||||||
|
|
||||||
@@ -1336,12 +1336,12 @@
|
|||||||
</m>
|
</m>
|
||||||
<m v="station" zoom-min="14">
|
<m v="station" zoom-min="14">
|
||||||
<symbol src="assets:symbols/transport/train_station2.svg" />
|
<symbol src="assets:symbols/transport/train_station2.svg" />
|
||||||
<caption style="bold" dy="20" fill="#ec2d2d" k="name" size="14" stroke="#ffffff"
|
<caption style="bold" dy="20" fill="#af3a3a" k="name" size="14" stroke="#ffffff"
|
||||||
stroke-width="2.0" />
|
stroke-width="2.0" />
|
||||||
</m>
|
</m>
|
||||||
<m v="halt|tram_stop" zoom-min="15">
|
<m v="halt|tram_stop" zoom-min="15">
|
||||||
<symbol src="assets:symbols/transport/tram_stop.svg" />
|
<symbol src="assets:symbols/transport/tram_stop.svg" />
|
||||||
<caption style="bold" dy="20" fill="#ec2d2d" k="name" size="14" stroke="#ffffff"
|
<caption style="bold" dy="20" fill="#af3a3a" k="name" size="12" stroke="#ffffff"
|
||||||
stroke-width="2.0" />
|
stroke-width="2.0" />
|
||||||
</m>
|
</m>
|
||||||
</m>
|
</m>
|
||||||
@@ -1392,8 +1392,8 @@
|
|||||||
|
|
||||||
<!-- house numbers -->
|
<!-- house numbers -->
|
||||||
<m k="addr:housenumber" zoom-min="17">
|
<m k="addr:housenumber" zoom-min="17">
|
||||||
<caption style="bold" fill="#606060" k="addr:housenumber" size="12" stroke="#ffffff"
|
<caption style="bold" fill="#606060" font-family="condensed" k="addr:housenumber"
|
||||||
stroke-width="2.0" />
|
size="12" stroke="#ffffff" stroke-width="2.0" />
|
||||||
</m>
|
</m>
|
||||||
</m>
|
</m>
|
||||||
|
|
||||||
|
|||||||
@@ -9,8 +9,8 @@
|
|||||||
<style-line id="secondary" stroke="#fdbf6f" width="1.4" />
|
<style-line id="secondary" stroke="#fdbf6f" width="1.4" />
|
||||||
<style-line id="tertiary" stroke="#ffff90" width="1.15" />
|
<style-line id="tertiary" stroke="#ffff90" width="1.15" />
|
||||||
|
|
||||||
<style-text style="bold" caption="true" dy="20" fill="#4040ff" id="caption-small-blue" k="name"
|
<style-text caption="true" dy="20" fill="#2d51bc" font-family="medium" id="caption-small-blue"
|
||||||
size="14" stroke="#ffffff" stroke-width="2.0" />
|
k="name" size="14" stroke="#ffffff" stroke-width="2.0" />
|
||||||
|
|
||||||
<style-text style="bold" id="highway-road" k="name" size="16" stroke="#d0d0d0"
|
<style-text style="bold" id="highway-road" k="name" size="16" stroke="#d0d0d0"
|
||||||
stroke-width="2.0" />
|
stroke-width="2.0" />
|
||||||
@@ -559,8 +559,8 @@
|
|||||||
|
|
||||||
<m zoom-min="17">
|
<m zoom-min="17">
|
||||||
<text priority="9" use="caption-small-blue" />
|
<text priority="9" use="caption-small-blue" />
|
||||||
<caption style="bold" fill="#606060" k="addr:housenumber" priority="10" size="12"
|
<caption style="bold" fill="#606060" font-family="condensed" k="addr:housenumber"
|
||||||
stroke="#ffffff" stroke-width="2.0" />
|
priority="10" size="12" stroke="#ffffff" stroke-width="2.0" />
|
||||||
</m>
|
</m>
|
||||||
</m>
|
</m>
|
||||||
|
|
||||||
@@ -1095,7 +1095,7 @@
|
|||||||
</m>
|
</m>
|
||||||
|
|
||||||
<!--<m k="historic" v="ruins" zoom-min="17">
|
<!--<m k="historic" v="ruins" zoom-min="17">
|
||||||
<caption style="bold" fill="#4040ff" k="name" size="16" stroke="#ffffff"
|
<caption style="bold" fill="#2d51bc" k="name" size="16" stroke="#ffffff"
|
||||||
stroke-width="2.0" />
|
stroke-width="2.0" />
|
||||||
</m>-->
|
</m>-->
|
||||||
|
|
||||||
@@ -1336,12 +1336,12 @@
|
|||||||
</m>
|
</m>
|
||||||
<m v="station" zoom-min="14">
|
<m v="station" zoom-min="14">
|
||||||
<symbol src="assets:symbols/transport/train_station2.svg" />
|
<symbol src="assets:symbols/transport/train_station2.svg" />
|
||||||
<caption style="bold" dy="20" fill="#ec2d2d" k="name" size="14" stroke="#ffffff"
|
<caption style="bold" dy="20" fill="#af3a3a" k="name" size="14" stroke="#ffffff"
|
||||||
stroke-width="2.0" />
|
stroke-width="2.0" />
|
||||||
</m>
|
</m>
|
||||||
<m v="halt|tram_stop" zoom-min="15">
|
<m v="halt|tram_stop" zoom-min="15">
|
||||||
<symbol src="assets:symbols/transport/tram_stop.svg" />
|
<symbol src="assets:symbols/transport/tram_stop.svg" />
|
||||||
<caption style="bold" dy="20" fill="#ec2d2d" k="name" size="14" stroke="#ffffff"
|
<caption style="bold" dy="20" fill="#af3a3a" k="name" size="12" stroke="#ffffff"
|
||||||
stroke-width="2.0" />
|
stroke-width="2.0" />
|
||||||
</m>
|
</m>
|
||||||
</m>
|
</m>
|
||||||
@@ -1392,8 +1392,8 @@
|
|||||||
|
|
||||||
<!-- house numbers -->
|
<!-- house numbers -->
|
||||||
<m k="addr:housenumber" zoom-min="17">
|
<m k="addr:housenumber" zoom-min="17">
|
||||||
<caption style="bold" fill="#606060" k="addr:housenumber" size="12" stroke="#ffffff"
|
<caption style="bold" fill="#606060" font-family="condensed" k="addr:housenumber"
|
||||||
stroke-width="2.0" />
|
size="12" stroke="#ffffff" stroke-width="2.0" />
|
||||||
</m>
|
</m>
|
||||||
</m>
|
</m>
|
||||||
|
|
||||||
|
|||||||
@@ -3,8 +3,8 @@
|
|||||||
version="1" xmlns="http://opensciencemap.org/rendertheme"
|
version="1" xmlns="http://opensciencemap.org/rendertheme"
|
||||||
xsi:schemaLocation="http://opensciencemap.org/rendertheme https://raw.githubusercontent.com/mapsforge/vtm/master/resources/rendertheme.xsd">
|
xsi:schemaLocation="http://opensciencemap.org/rendertheme https://raw.githubusercontent.com/mapsforge/vtm/master/resources/rendertheme.xsd">
|
||||||
|
|
||||||
<style-text style="bold" caption="true" dy="20" fill="#4040ff" id="caption-small-blue" k="name"
|
<style-text caption="true" dy="20" fill="#2d51bc" font-family="medium" id="caption-small-blue"
|
||||||
size="16" stroke="#ffffff" stroke-width="2.0" />
|
k="name" size="16" stroke="#ffffff" stroke-width="2.0" />
|
||||||
|
|
||||||
<style-text style="bold" fill="#eeffee" id="road" k="name" priority="2" size="18"
|
<style-text style="bold" fill="#eeffee" id="road" k="name" priority="2" size="18"
|
||||||
stroke="#606050" stroke-width="2.5" />
|
stroke="#606050" stroke-width="2.5" />
|
||||||
@@ -540,10 +540,10 @@
|
|||||||
<extrusion line-color="#50ff00ff" side-color="#cc707070" top-color="#cc707070" />
|
<extrusion line-color="#50ff00ff" side-color="#cc707070" top-color="#cc707070" />
|
||||||
</m>
|
</m>
|
||||||
<m zoom-min="17">
|
<m zoom-min="17">
|
||||||
<caption style="bold" fill="#4040ff" k="name" priority="9" size="14"
|
<caption style="bold" fill="#2d51bc" k="name" priority="9" size="14"
|
||||||
stroke="#ffffff" stroke-width="2.0" />
|
stroke="#ffffff" stroke-width="2.0" />
|
||||||
<caption style="bold" fill="#ffffff" k="addr:housenumber" priority="10" size="12"
|
<caption style="bold" fill="#ffffff" font-family="condensed" k="addr:housenumber"
|
||||||
stroke="#606060" stroke-width="2.0" />
|
priority="10" size="12" stroke="#606060" stroke-width="2.0" />
|
||||||
</m>
|
</m>
|
||||||
</m>
|
</m>
|
||||||
|
|
||||||
@@ -1009,7 +1009,7 @@
|
|||||||
|
|
||||||
<!-- historic -->
|
<!-- historic -->
|
||||||
<!-- <m k="historic" v="ruins" zoom-min="17">
|
<!-- <m k="historic" v="ruins" zoom-min="17">
|
||||||
<caption k="name" style="bold" size="10" fill="#4040ff" stroke="#ffffff" stroke-width="2.0"
|
<caption k="name" style="bold" size="10" fill="#2d51bc" stroke="#ffffff" stroke-width="2.0"
|
||||||
/>
|
/>
|
||||||
</m> -->
|
</m> -->
|
||||||
|
|
||||||
@@ -1274,12 +1274,12 @@
|
|||||||
</m>
|
</m>
|
||||||
<m v="station" zoom-min="14">
|
<m v="station" zoom-min="14">
|
||||||
<symbol src="assets:symbols/transport/train_station2.svg" />
|
<symbol src="assets:symbols/transport/train_station2.svg" />
|
||||||
<caption style="bold" dy="20" fill="#ec2d2d" k="name" size="14" stroke="#ffffff"
|
<caption style="bold" dy="20" fill="#af3a3a" k="name" size="14" stroke="#ffffff"
|
||||||
stroke-width="2.0" />
|
stroke-width="2.0" />
|
||||||
</m>
|
</m>
|
||||||
<m v="halt|tram_stop" zoom-min="15">
|
<m v="halt|tram_stop" zoom-min="15">
|
||||||
<symbol src="assets:symbols/transport/tram_stop.svg" />
|
<symbol src="assets:symbols/transport/tram_stop.svg" />
|
||||||
<caption style="bold" dy="20" fill="#ec2d2d" k="name" size="14" stroke="#ffffff"
|
<caption style="bold" dy="20" fill="#af3a3a" k="name" size="12" stroke="#ffffff"
|
||||||
stroke-width="2.0" />
|
stroke-width="2.0" />
|
||||||
</m>
|
</m>
|
||||||
</m>
|
</m>
|
||||||
@@ -1330,8 +1330,8 @@
|
|||||||
|
|
||||||
<!-- house numbers -->
|
<!-- house numbers -->
|
||||||
<m k="addr:housenumber" zoom-min="17">
|
<m k="addr:housenumber" zoom-min="17">
|
||||||
<caption style="bold" fill="#ffffff" k="addr:housenumber" size="12" stroke="#606060"
|
<caption style="bold" fill="#ffffff" font-family="condensed" k="addr:housenumber"
|
||||||
stroke-width="2.0" />
|
size="12" stroke="#606060" stroke-width="2.0" />
|
||||||
</m>
|
</m>
|
||||||
</m>
|
</m>
|
||||||
|
|
||||||
|
|||||||
@@ -6,6 +6,9 @@
|
|||||||
<!-- base style for fixed width lines -->
|
<!-- base style for fixed width lines -->
|
||||||
<style-line cap="butt" fix="true" id="fix" width="1.0" />
|
<style-line cap="butt" fix="true" id="fix" width="1.0" />
|
||||||
|
|
||||||
|
<style-text caption="true" dy="20" fill="#2d51bc" font-family="medium" id="caption-small-blue"
|
||||||
|
k="name" size="14" stroke="#ffffff" stroke-width="2.0" />
|
||||||
|
|
||||||
<style-text fill="#101010" id="road" k="name" priority="2" size="16" stroke="#eeeeee"
|
<style-text fill="#101010" id="road" k="name" priority="2" size="16" stroke="#eeeeee"
|
||||||
stroke-width="2.0" />
|
stroke-width="2.0" />
|
||||||
|
|
||||||
@@ -590,10 +593,9 @@
|
|||||||
<extrusion line-color="#ffd9d8d6" side-color="#eaecebe9" top-color="#eaf9f8f6" />
|
<extrusion line-color="#ffd9d8d6" side-color="#eaecebe9" top-color="#eaf9f8f6" />
|
||||||
</m>
|
</m>
|
||||||
<m zoom-min="17">
|
<m zoom-min="17">
|
||||||
<caption style="bold" fill="#4040ff" k="name" size="10" stroke="#ffffff"
|
<text priority="9" use="caption-small-blue" />
|
||||||
stroke-width="2.0" />
|
<caption style="bold" fill="#606060" font-family="condensed" k="addr:housenumber"
|
||||||
<caption style="bold" fill="#606060" k="addr:housenumber" size="10" stroke="#ffffff"
|
size="10" stroke="#ffffff" stroke-width="2.0" />
|
||||||
stroke-width="2.0" />
|
|
||||||
</m>
|
</m>
|
||||||
</m>
|
</m>
|
||||||
|
|
||||||
@@ -956,7 +958,7 @@
|
|||||||
|
|
||||||
<!-- historic -->
|
<!-- historic -->
|
||||||
<!-- <m k="historic" v="ruins" zoom-min="17">
|
<!-- <m k="historic" v="ruins" zoom-min="17">
|
||||||
<caption k="name" style="bold" size="10" fill="#4040ff" stroke="#ffffff" stroke-width="2.0"
|
<caption k="name" style="bold" size="10" fill="#2d51bc" stroke="#ffffff" stroke-width="2.0"
|
||||||
/>
|
/>
|
||||||
</m> -->
|
</m> -->
|
||||||
|
|
||||||
@@ -1006,14 +1008,14 @@
|
|||||||
</m>
|
</m>
|
||||||
|
|
||||||
<!-- historic -->
|
<!-- historic -->
|
||||||
<!-- <m k="historic"> <circle r="3" fill="#4040ff" stroke="#606060"
|
<!-- <m k="historic"> <circle r="3" fill="#2d51bc" stroke="#606060"
|
||||||
width="1.5" /> <m zoom-min="17"> <caption
|
width="1.5" /> <m zoom-min="17"> <caption
|
||||||
k="name" dy="10" style="bold" size="10" fill="#4040ff" stroke="#ffffff"
|
k="name" dy="10" style="bold" size="10" fill="#2d51bc" stroke="#ffffff"
|
||||||
width="2.0" /> </m> </m> -->
|
width="2.0" /> </m> </m> -->
|
||||||
|
|
||||||
<!-- house numbers -->
|
<!-- house numbers -->
|
||||||
<!-- <m k="addr:housenumber" zoom-min="18"> <caption
|
<!-- <m k="addr:housenumber" zoom-min="18"> <caption
|
||||||
k="addr:housenumber" style="bold" size="10" fill="#606060" stroke="#ffffff"
|
k="addr:housenumber" font-family="condensed" style="bold" size="10" fill="#606060" stroke="#ffffff"
|
||||||
width="2.0" /> </m> -->
|
width="2.0" /> </m> -->
|
||||||
|
|
||||||
<!-- place -->
|
<!-- place -->
|
||||||
@@ -1053,14 +1055,14 @@
|
|||||||
<!-- railway -->
|
<!-- railway -->
|
||||||
<m k="railway">
|
<m k="railway">
|
||||||
<m v="station" zoom-min="14">
|
<m v="station" zoom-min="14">
|
||||||
<circle fill="#ec2d2d" radius="6" stroke="#606060" stroke-width="1.5" />
|
<circle fill="#af3a3a" radius="6" stroke="#606060" stroke-width="1.5" />
|
||||||
<caption style="bold" dy="15" fill="#ec2d2d" k="name" size="13" stroke="#ffffff"
|
<caption style="bold" dy="15" fill="#af3a3a" k="name" size="14" stroke="#ffffff"
|
||||||
stroke-width="2.0" />
|
stroke-width="2.0" />
|
||||||
</m>
|
</m>
|
||||||
|
|
||||||
<m v="halt|tram_stop">
|
<m v="halt|tram_stop">
|
||||||
<circle fill="#ec2d2d" radius="4" stroke="#606060" stroke-width="1.5" />
|
<circle fill="#af3a3a" radius="4" stroke="#606060" stroke-width="1.5" />
|
||||||
<caption style="bold" dy="10" fill="#ec2d2d" k="name" size="11" stroke="#ffffff"
|
<caption style="bold" dy="10" fill="#af3a3a" k="name" size="12" stroke="#ffffff"
|
||||||
stroke-width="2.0" />
|
stroke-width="2.0" />
|
||||||
</m>
|
</m>
|
||||||
<m v="level_crossing">
|
<m v="level_crossing">
|
||||||
@@ -1199,6 +1201,10 @@
|
|||||||
<symbol src="toilets" />
|
<symbol src="toilets" />
|
||||||
</m>
|
</m>
|
||||||
</m>
|
</m>
|
||||||
|
|
||||||
|
<m zoom-min="15">
|
||||||
|
<text use="caption-small-blue" />
|
||||||
|
</m>
|
||||||
</m>
|
</m>
|
||||||
|
|
||||||
<m k="shop">
|
<m k="shop">
|
||||||
@@ -1224,6 +1230,9 @@
|
|||||||
<text use="poi" />
|
<text use="poi" />
|
||||||
</m>
|
</m>
|
||||||
</m>
|
</m>
|
||||||
|
<m zoom-min="15">
|
||||||
|
<text use="caption-small-blue" />
|
||||||
|
</m>
|
||||||
</m>
|
</m>
|
||||||
|
|
||||||
<m k="tourism">
|
<m k="tourism">
|
||||||
@@ -1265,6 +1274,9 @@
|
|||||||
<symbol src="museum" />
|
<symbol src="museum" />
|
||||||
</m>
|
</m>
|
||||||
|
|
||||||
|
<m zoom-min="15">
|
||||||
|
<text use="caption-small-blue" />
|
||||||
|
</m>
|
||||||
</m>
|
</m>
|
||||||
|
|
||||||
<m k="natural" v="tree" zoom-min="15">
|
<m k="natural" v="tree" zoom-min="15">
|
||||||
|
|||||||
@@ -2,6 +2,7 @@
|
|||||||
* Copyright 2013 Hannes Janetzek
|
* Copyright 2013 Hannes Janetzek
|
||||||
* Copyright 2016-2017 devemux86
|
* Copyright 2016-2017 devemux86
|
||||||
* Copyright 2017 nebular
|
* Copyright 2017 nebular
|
||||||
|
* Copyright 2018 Gustl22
|
||||||
*
|
*
|
||||||
* This file is part of the OpenScienceMap project (http://www.opensciencemap.org).
|
* This file is part of the OpenScienceMap project (http://www.opensciencemap.org).
|
||||||
*
|
*
|
||||||
@@ -33,7 +34,7 @@ public class GwtPaint implements Paint {
|
|||||||
float fontSize = 12;
|
float fontSize = 12;
|
||||||
|
|
||||||
private FontStyle fontStyle = FontStyle.NORMAL;
|
private FontStyle fontStyle = FontStyle.NORMAL;
|
||||||
//private FontFamily fontFamily = FontFamily.DEFAULT;
|
private FontFamily fontFamily = FontFamily.DEFAULT;
|
||||||
|
|
||||||
//String font = "12px sans-serif";
|
//String font = "12px sans-serif";
|
||||||
String font = "13px Helvetica";
|
String font = "13px Helvetica";
|
||||||
@@ -91,7 +92,7 @@ public class GwtPaint implements Paint {
|
|||||||
@Override
|
@Override
|
||||||
public void setTypeface(FontFamily fontFamily, FontStyle fontStyle) {
|
public void setTypeface(FontFamily fontFamily, FontStyle fontStyle) {
|
||||||
this.fontStyle = fontStyle;
|
this.fontStyle = fontStyle;
|
||||||
//this.fontFamily = fontFamily;
|
this.fontFamily = fontFamily;
|
||||||
buildFont();
|
buildFont();
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -111,21 +112,54 @@ public class GwtPaint implements Paint {
|
|||||||
return 4 + strokeWidth;
|
return 4 + strokeWidth;
|
||||||
}
|
}
|
||||||
|
|
||||||
void buildFont() {
|
private void buildFont() {
|
||||||
StringBuilder sb = new StringBuilder();
|
StringBuilder sb = new StringBuilder();
|
||||||
|
String weight = null; // Default 400 -> normal
|
||||||
|
String name = "Helvetica";
|
||||||
|
|
||||||
if (this.fontStyle == FontStyle.BOLD)
|
switch (this.fontFamily) {
|
||||||
sb.append("bold ");
|
case MEDIUM:
|
||||||
else if (this.fontStyle == FontStyle.ITALIC)
|
weight = "500";
|
||||||
sb.append("italic ");
|
break;
|
||||||
|
case BLACK:
|
||||||
|
weight = "900";
|
||||||
|
break;
|
||||||
|
case DEFAULT_BOLD:
|
||||||
|
weight = "bold"; // 700
|
||||||
|
break;
|
||||||
|
case LIGHT:
|
||||||
|
weight = "300";
|
||||||
|
break;
|
||||||
|
case THIN:
|
||||||
|
weight = "200"; //lighter
|
||||||
|
break;
|
||||||
|
case SERIF:
|
||||||
|
name = "Georgia";
|
||||||
|
break;
|
||||||
|
case MONOSPACE:
|
||||||
|
name = "'Courier New'";
|
||||||
|
break;
|
||||||
|
case CONDENSED:
|
||||||
|
sb.append("condensed ");
|
||||||
|
}
|
||||||
|
|
||||||
|
switch (this.fontStyle) {
|
||||||
|
case BOLD:
|
||||||
|
weight = "bold";
|
||||||
|
break;
|
||||||
|
case ITALIC:
|
||||||
|
sb.append("italic ");
|
||||||
|
break;
|
||||||
|
case BOLD_ITALIC:
|
||||||
|
weight = "bold";
|
||||||
|
sb.append("italic ");
|
||||||
|
}
|
||||||
|
if (weight != null)
|
||||||
|
sb.append(weight).append(" ");
|
||||||
sb.append(Math.round(this.fontSize));
|
sb.append(Math.round(this.fontSize));
|
||||||
sb.append("px ");
|
sb.append("px ").append(name);
|
||||||
|
|
||||||
sb.append("Helvetica");
|
|
||||||
|
|
||||||
this.font = sb.toString();
|
this.font = sb.toString();
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
|
|||||||
@@ -3,6 +3,7 @@
|
|||||||
* Copyright 2013 Hannes Janetzek
|
* Copyright 2013 Hannes Janetzek
|
||||||
* Copyright 2016 devemux86
|
* Copyright 2016 devemux86
|
||||||
* Copyright 2017 nebular
|
* Copyright 2017 nebular
|
||||||
|
* Copyright 2018 Gustl22
|
||||||
*
|
*
|
||||||
* This file is part of the OpenScienceMap project (http://www.opensciencemap.org).
|
* This file is part of the OpenScienceMap project (http://www.opensciencemap.org).
|
||||||
*
|
*
|
||||||
@@ -41,7 +42,7 @@ public interface Paint {
|
|||||||
}
|
}
|
||||||
|
|
||||||
enum FontFamily {
|
enum FontFamily {
|
||||||
DEFAULT, DEFAULT_BOLD, MONOSPACE, SANS_SERIF, SERIF
|
DEFAULT, DEFAULT_BOLD, MONOSPACE, SANS_SERIF, SERIF, THIN, LIGHT, MEDIUM, BLACK, CONDENSED
|
||||||
}
|
}
|
||||||
|
|
||||||
enum FontStyle {
|
enum FontStyle {
|
||||||
|
|||||||
Reference in New Issue
Block a user