Changes between Initial Version and Version 1 of Styles/HiDPISupport


Ignore:
Timestamp:
2016-03-19T17:30:58+01:00 (10 years ago)
Author:
Klumbumbus
Comment:

new style, see #12495

Legend:

Unmodified
Added
Removed
Modified
  • Styles/HiDPISupport

    v1 v1  
     1[[TranslatedPages]]
     2
     3= [[Image(HiDPISupportLogo.svg,36,middle,inline)]] HiDPI Support =
     4[[PageOutline(2-9)]]
     5
     6== Description ==
     7This mapcss mappaint style was created to scale node sizes and font sizes in the MapView for better view on HiDPI screens. This is only a temporary solution until ticket #9995 is solved (automatic scaling).
     8This style works only together with the default JOSM internal mappaint style. In the List of mappaint styles in the preferences HiDPISupport needs to be below the internal style (which means higher priority). You can add more additional styles further down in the list.
     9There is a [wiki:Help/Dialog/MapPaint/StyleSettings style setting] "Less obtrusive node symbols at low zoom" in this style as well a in the internal default style. For correct display you need to have them both in the same state (both checked or both unchecked).
     10
     11For the HiDPISupport mappaint style JOSM version 10018 or newer is required. For ideas/questions/bugs/suggestions or similar please write a message to [osmwww:user/Klumbumbus Klumbumbus]. This style is "untested" because the author has no HiDPI screen.
     12
     13Feel free to translate this wiki page into more languages. Already translated languages see top right.
     14== How to scale ==
     15Go to the [wiki:Help/Preferences/Advanced Advanced Preferences] and adjust the following two keys:
     16* `font-size-summand`: The font size will be increased by the number set here. The default value is `2`. Only integer numbers are allowed. Try other values like e.g. `1`, `3` or `4`
     17* `node-size-factor`: The node size will be multiplied by the number set here. The default value is `1.8`. Float numbers are allowed. Try other values like e.g. `1.5` or `2`
     18
     19== Code ==
     20
     21{{{
     22#!style type="mapcss"
     23
     24meta {
     25    title: "HiDPI Support";
     26    version: "1.[[revision]]_[[date]]";
     27    description: "Allows to scale the size of nodes and the font size in the Mapview. Min. JOSM version is 10018.";
     28    icon: "HiDPISupportLogo.svg";
     29    author: "Klumbumbus";
     30    link: "http://josm.openstreetmap.de/wiki/Styles/HiDPISupport";
     31    watch-modified: true;
     32    min-josm-version: "10018";
     33    /* This mapcss mappaint style is only a temporary solution until ticket #9995 is solved. */
     34}
     35
     36setting::shrink_nodes {
     37  type: boolean;
     38  label: tr("Less obtrusive node symbols at low zoom");
     39  default: true;
     40}
     41
     42* {
     43    font-size-summand: JOSM_pref("font-size-summand", 2);
     44}
     45node {
     46    node-size-factor: JOSM_pref("node-size-factor", 1.8);
     47}
     48
     49node["openGeoDB:type"=Stadt],
     50node["openGeoDB:type"=Kreis],
     51node["openGeoDB:type"=Gemeinde],
     52node["openGeoDB:type"=Ort],
     53node["openGeoDB:type"=District],
     54node["openGeoDB:location"=locality] {
     55    font-size: 10 + prop("font-size-summand");
     56}
     57
     58node[place=continent],
     59node[place=country],
     60node[place=state],
     61node[place=region],
     62node[place=county],
     63node[place=city],
     64node[place=town],
     65node[place=suburb],
     66node[place=village],
     67node[place=neighbourhood],
     68node[place=hamlet],
     69node[place=isolated_dwelling],
     70node[place=farm],
     71node[place=island],
     72node[place=islet] {
     73    font-size: 10 + prop("font-size-summand");
     74}
     75
     76node|z15-[place=locality],
     77node|z-14[place=locality][!setting("hide_icons")] {
     78    font-size: 10 + prop("font-size-summand");
     79}
     80
     81node|z-16,
     82node[!is_prop_set("icon-image")]!.maxspeedclass {
     83    symbol-size: 2 * prop("node-size-factor");
     84}
     85
     86way > node|z16[setting("shrink_nodes")]!:tagged { symbol-size: 1 * prop("node-size-factor"); }
     87
     88node|z17[setting("shrink_nodes")]               { symbol-size: 4 * prop("node-size-factor"); }
     89way > node|z17[setting("shrink_nodes")]         { symbol-size: 2 * prop("node-size-factor"); }
     90node|z17[setting("shrink_nodes")]:connection    { symbol-size: 4 * prop("node-size-factor"); }
     91
     92node|z18[setting("shrink_nodes")]               { symbol-size: 4 * prop("node-size-factor"); }
     93way > node|z18[setting("shrink_nodes")]         { symbol-size: 3 * prop("node-size-factor"); }
     94node|z18[setting("shrink_nodes")]:connection    { symbol-size: 5 * prop("node-size-factor"); }
     95
     96node|z19-[setting("shrink_nodes")]              { symbol-size: 4 * prop("node-size-factor"); }
     97way > node|z19-[setting("shrink_nodes")]        { symbol-size: 4 * prop("node-size-factor"); }
     98node|z19-[setting("shrink_nodes")]:connection   { symbol-size: 6 * prop("node-size-factor"); }
     99
     100node[!setting("shrink_nodes")]                  { symbol-size: 4 * prop("node-size-factor"); }
     101way > node[!setting("shrink_nodes")]            { symbol-size: 4 * prop("node-size-factor"); }
     102node[!setting("shrink_nodes")]:connection       { symbol-size: 6 * prop("node-size-factor"); }
     103
     104node:selected {
     105    symbol-size: 6 * prop("node-size-factor");
     106}
     107
     108node|z-18,area|z-18 { font-size: 8 + prop("font-size-summand"); }
     109node|z19,area|z19   { font-size: 9 + prop("font-size-summand"); }
     110node|z20-,area|z20- { font-size: 10 + prop("font-size-summand"); }
     111
     112way|z17-[highway^=motorway],
     113way|z17-[highway^=trunk],
     114way|z17-[highway^=primary],
     115way|z17-[highway^=secondary],
     116way|z17-[highway^=tertiary],
     117way|z17-[highway=unclassified],
     118way|z17-[highway=residential],
     119way|z17-[highway=living_street],
     120way|z17-[highway=escape],
     121way|z17-[highway=pedestrian][!area?],
     122way|z17-[highway=steps],
     123way|z17-[highway=footway],
     124way|z17-[highway=path],
     125way|z17-[highway=service],
     126way|z17-[highway=track],
     127way|z17-[highway=cycleway],
     128way|z17-[highway=bridleway],
     129way|z17-[highway=bus_guideway],
     130way|z17-[highway=raceway],
     131way|z17-[highway=construction],
     132way|z17-[highway=road] {
     133    font-size: 9 + prop("font-size-summand");
     134}
     135
     136way|z18[highway] {
     137    font-size: 10 + prop("font-size-summand");
     138}
     139way|z19[highway] {
     140    font-size: 11 + prop("font-size-summand");
     141}
     142way|z20-[highway] {
     143    font-size: 12 + prop("font-size-summand");
     144}
     145}}}