wiki:Styles/HiDPISupport

HiDPI Support

Description

This mapcss mappaint style was created to scale node sizes and font sizes in the MapView for better view on HiDPI screens. This is a result of #12495 and is only a temporary solution until #9995 is solved (automatic scaling).

This 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. (This style may work with the Potlatch2 style as well, however this is untested.)

There is a style setting "Less obtrusive node symbols at low zoom" in this style as well as in the internal default style. For correct display you need to have them both in the same state (both checked or both unchecked).

For the HiDPISupport mappaint style JOSM version 10018 or newer is required. For ideas/questions/bugs/suggestions or similar please write a message to Klumbumbus. This style is "untested" because the author doesn't own a HiDPI screen.

Feel free to translate this wiki page into more languages. Already translated languages see top right.

How to adjust the sizes

Go to the Advanced Preferences and adjust the following two keys:

  • 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.
  • 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.

Code

meta {
    title: "HiDPI Support";
    version: "1.8_2016-05-16";
    description: "Allows to scale the nodes size and the font size of the default JOSM mappaint style.";
    icon: "HiDPISupportLogo.svg";
    author: "Klumbumbus";
    link: "http://josm.openstreetmap.de/wiki/Styles/HiDPISupport";
    watch-modified: true;
    min-josm-version: "10018";
    /* This mapcss mappaint style is only a temporary solution until ticket #9995 is solved. */
}

setting::shrink_nodes {
  type: boolean;
  label: tr("Less obtrusive node symbols at low zoom");
  default: true;
}

* {
    font-size-summand: JOSM_pref("font-size-summand", 2);
}
node {
    node-size-factor: JOSM_pref("node-size-factor", 1.8);
}


node["openGeoDB:type"],
node[place] {
    font-size: 10 + prop("font-size-summand");
}

node|z-16,
node[!is_prop_set("icon-image")]!.maxspeedclass {
    symbol-size: 2 * prop("node-size-factor");
}

way > node|z16[setting("shrink_nodes")]!:tagged { symbol-size: 1 * prop("node-size-factor"); }

node|z17[setting("shrink_nodes")]               { symbol-size: 4 * prop("node-size-factor"); }
way > node|z17[setting("shrink_nodes")]         { symbol-size: 2 * prop("node-size-factor"); }
node|z17[setting("shrink_nodes")]:connection    { symbol-size: 4 * prop("node-size-factor"); }

node|z18[setting("shrink_nodes")]               { symbol-size: 4 * prop("node-size-factor"); }
way > node|z18[setting("shrink_nodes")]         { symbol-size: 3 * prop("node-size-factor"); }
node|z18[setting("shrink_nodes")]:connection    { symbol-size: 5 * prop("node-size-factor"); }

node|z19-[setting("shrink_nodes")]              { symbol-size: 4 * prop("node-size-factor"); }
way > node|z19-[setting("shrink_nodes")]        { symbol-size: 4 * prop("node-size-factor"); }
node|z19-[setting("shrink_nodes")]:connection   { symbol-size: 6 * prop("node-size-factor"); }

node[!setting("shrink_nodes")]                  { symbol-size: 4 * prop("node-size-factor"); }
way > node[!setting("shrink_nodes")]            { symbol-size: 4 * prop("node-size-factor"); }
node[!setting("shrink_nodes")]:connection       { symbol-size: 6 * prop("node-size-factor"); }

node:selected {
    symbol-size: 6 * prop("node-size-factor");
}

node|z-18,area|z-18 { font-size: 8 + prop("font-size-summand"); }
node|z19,area|z19   { font-size: 9 + prop("font-size-summand"); }
node|z20-,area|z20- { font-size: 10 + prop("font-size-summand"); }

way|z17[highway] {
    font-size: 9 + prop("font-size-summand");
}
way|z18[highway] {
    font-size: 10 + prop("font-size-summand");
}
way|z19[highway] {
    font-size: 11 + prop("font-size-summand");
}
way|z20-[highway] {
    font-size: 12 + prop("font-size-summand");
}

Styles_HiDPISupport-style.mapcss, Styles_HiDPISupport.zip

Last modified 19 months ago Last modified on 2016-05-16T18:55:18+02:00

Attachments (1)

Download all attachments as: .zip