Opened 9 years ago
Closed 9 years ago
#12495 closed enhancement (fixed)
[patch] mappaint support for HIDPI screens
Reported by: | Klumbumbus | Owned by: | team |
---|---|---|---|
Priority: | normal | Milestone: | |
Component: | External mappaint style | Version: | |
Keywords: | hidpi | Cc: | bastiK |
Description (last modified by )
More and more users have HIDPI screens (see e.g. recent german forum thread).
While #9995 is about the general HIDPI support, I propose the following solution for the mapview for now, which allows to scale the nodes and text size by the following two josm preference keys:
node-size-factor
font-size-summand
Unfortunately I don't have a monitor to test. According to the linked thread the icon size is ok on a 4k screen, so I didn't touch it for now. (edit: see ticket:9995#comment:15 should iconsize.map
change the iconsize in the mapview? This does not work for me.)
-
styles/standard/elemstyles.mapcss
16 16 default-points: false; 17 17 } 18 18 19 * { 20 font-size-summand: JOSM_pref("font-size-summand", 0); 21 } 19 22 /*************************/ 20 23 /* create style settings */ 21 24 /*************************/ … … 4939 4942 set icon_z0; 4940 4943 text: auto; 4941 4944 set text_z0; 4942 font-size: 10 ;4945 font-size: 10 + prop("font-size-summand"); 4943 4946 font-weight: bold; 4944 4947 text-color:black; 4945 4948 text-halo-color: white; … … 4972 4975 set icon_z0; 4973 4976 text: auto; 4974 4977 set text_z0; 4975 font-size: 10 ;4978 font-size: 10 + prop("font-size-summand"); 4976 4979 font-weight: bold; 4977 4980 text-color:black; 4978 4981 text-halo-color: white; … … 4984 4987 set icon_z0; 4985 4988 text: auto; 4986 4989 set text_z0; 4987 font-size: 10 ;4990 font-size: 10 + prop("font-size-summand"); 4988 4991 font-weight: bold; 4989 4992 text-color:black; 4990 4993 text-halo-color: white; … … 4996 4999 set icon_z0; 4997 5000 text: auto; 4998 5001 set text_z0; 4999 font-size: 10 ;5002 font-size: 10 + prop("font-size-summand"); 5000 5003 font-weight: bold; 5001 5004 text-color:black; 5002 5005 text-halo-color: white; … … 5008 5011 set icon_z0; 5009 5012 text: auto; 5010 5013 set text_z0; 5011 font-size: 10 ;5014 font-size: 10 + prop("font-size-summand"); 5012 5015 font-weight: bold; 5013 5016 text-color:black; 5014 5017 text-halo-color: white; … … 5020 5023 set icon_z0; 5021 5024 text: auto; 5022 5025 set text_z0; 5023 font-size: 10 ;5026 font-size: 10 + prop("font-size-summand"); 5024 5027 font-weight: bold; 5025 5028 text-color:black; 5026 5029 text-halo-color: white; … … 5032 5035 set icon_z0; 5033 5036 text: auto; 5034 5037 set text_z0; 5035 font-size: 10 ;5038 font-size: 10 + prop("font-size-summand"); 5036 5039 font-weight: bold; 5037 5040 text-color:black; 5038 5041 text-halo-color: white; … … 5044 5047 set icon_z0; 5045 5048 text: auto; 5046 5049 set text_z0; 5047 font-size: 10 ;5050 font-size: 10 + prop("font-size-summand"); 5048 5051 font-weight: bold; 5049 5052 text-color:black; 5050 5053 text-halo-color: white; … … 5056 5059 set icon_z0; 5057 5060 text: auto; 5058 5061 set text_z0; 5059 font-size: 10 ;5062 font-size: 10 + prop("font-size-summand"); 5060 5063 font-weight: bold; 5061 5064 text-color:black; 5062 5065 text-halo-color: white; … … 5068 5071 set icon_z0; 5069 5072 text: auto; 5070 5073 set text_z0; 5071 font-size: 10 ;5074 font-size: 10 + prop("font-size-summand"); 5072 5075 font-weight: bold; 5073 5076 text-color:black; 5074 5077 text-halo-color: white; … … 5079 5082 node|z-14[place=locality][!setting("hide_icons")] { 5080 5083 icon-image: "place/locality.png"; 5081 5084 text: auto; 5082 font-size: 10 ;5085 font-size: 10 + prop("font-size-summand"); 5083 5086 font-weight: bold; 5084 5087 text-color:black; 5085 5088 text-halo-color: white; … … 5090 5093 set icon_z0; 5091 5094 text: auto; 5092 5095 set text_z0; 5093 font-size: 10 ;5096 font-size: 10 + prop("font-size-summand"); 5094 5097 font-weight: bold; 5095 5098 text-color:black; 5096 5099 text-halo-color: white; … … 5101 5104 set icon_z0; 5102 5105 text: auto; 5103 5106 set text_z0; 5104 font-size: 10 ;5107 font-size: 10 + prop("font-size-summand"); 5105 5108 font-weight: bold; 5106 5109 text-color:black; 5107 5110 text-halo-color: white; … … 5160 5163 5161 5164 node { 5162 5165 text: auto; 5166 node-size-factor: JOSM_pref("node-size-factor", 1); 5163 5167 } 5164 5168 node|z-16[setting("hide_icons")], 5165 5169 node|z17-[!is_prop_set("icon-image")][setting("hide_icons")]!.maxspeedclass, 5166 5170 node[!is_prop_set("icon-image")][!setting("hide_icons")]!.maxspeedclass { 5167 symbol-size: 2 ;5171 symbol-size: 2 * prop("node-size-factor"); 5168 5172 symbol-shape: square; 5169 5173 symbol-stroke-color: node_standard#ffff00; 5170 5174 major-z-index: 4.95; /* put node squares above line text */ … … 5180 5184 symbol-fill-color: node_tagged#00ffff; 5181 5185 } 5182 5186 5183 way > node|z16[setting("shrink_nodes")]!:tagged { symbol-size: 1 ; }5187 way > node|z16[setting("shrink_nodes")]!:tagged { symbol-size: 1 * prop("node-size-factor"); } 5184 5188 5185 node|z17[setting("shrink_nodes")] { symbol-size: 4 ; }5186 way > node|z17[setting("shrink_nodes")] { symbol-size: 2 ; }5187 node|z17[setting("shrink_nodes")]:connection { symbol-size: 4 ; }5188 5189 node|z18[setting("shrink_nodes")] { symbol-size: 4 ; }5190 way > node|z18[setting("shrink_nodes")] { symbol-size: 3 ; }5191 node|z18[setting("shrink_nodes")]:connection { symbol-size: 5 ; }5192 5193 node|z19-[setting("shrink_nodes")] { symbol-size: 4 ; }5194 way > node|z19-[setting("shrink_nodes")] { symbol-size: 4 ; }5195 node|z19-[setting("shrink_nodes")]:connection { symbol-size: 6 ; }5196 5197 node[!setting("shrink_nodes")] { symbol-size: 4 ; }5198 way > node[!setting("shrink_nodes")] { symbol-size: 4 ; }5199 node[!setting("shrink_nodes")]:connection { symbol-size: 6 ; }5189 node|z17[setting("shrink_nodes")] { symbol-size: 4 * prop("node-size-factor"); } 5190 way > node|z17[setting("shrink_nodes")] { symbol-size: 2 * prop("node-size-factor"); } 5191 node|z17[setting("shrink_nodes")]:connection { symbol-size: 4 * prop("node-size-factor"); } 5192 5193 node|z18[setting("shrink_nodes")] { symbol-size: 4 * prop("node-size-factor"); } 5194 way > node|z18[setting("shrink_nodes")] { symbol-size: 3 * prop("node-size-factor"); } 5195 node|z18[setting("shrink_nodes")]:connection { symbol-size: 5 * prop("node-size-factor"); } 5196 5197 node|z19-[setting("shrink_nodes")] { symbol-size: 4 * prop("node-size-factor"); } 5198 way > node|z19-[setting("shrink_nodes")] { symbol-size: 4 * prop("node-size-factor"); } 5199 node|z19-[setting("shrink_nodes")]:connection { symbol-size: 6 * prop("node-size-factor"); } 5200 5201 node[!setting("shrink_nodes")] { symbol-size: 4 * prop("node-size-factor"); } 5202 way > node[!setting("shrink_nodes")] { symbol-size: 4 * prop("node-size-factor"); } 5203 node[!setting("shrink_nodes")]:connection { symbol-size: 6 * prop("node-size-factor"); } 5200 5204 5201 5205 node:selected { 5202 5206 symbol-shape: square; 5203 symbol-size: 6 ;5207 symbol-size: 6 * prop("node-size-factor"); 5204 5208 symbol-fill-color: node_selected#ff0000; 5205 5209 symbol-stroke-color: node_selected#ff0000; 5206 5210 } … … 5216 5220 text: auto; 5217 5221 } 5218 5222 5219 node|z19,area|z19 { font-size: 9; } 5220 node|z20-,area|z20- { font-size: 10; } 5223 node|z-18,area|z-18 { font-size: 8 + prop("font-size-summand"); } 5224 node|z19,area|z19 { font-size: 9 + prop("font-size-summand"); } 5225 node|z20-,area|z20- { font-size: 10 + prop("font-size-summand"); } 5226 5221 5227 5222 5228 /*******************/ 5223 5229 /* way text labels */ … … 5246 5252 way|z17-[highway=road][setting("highway_labels")] { 5247 5253 text: auto; 5248 5254 text-color: black; 5249 font-size: 9 ;5255 font-size: 9 + prop("font-size-summand"); 5250 5256 text-position: line; 5251 5257 text-halo-opacity: 1; 5252 5258 text-halo-radius: 1.5; … … 5310 5316 text-halo-color: service#809bc0; 5311 5317 } 5312 5318 way|z18[highway][setting("highway_labels")] { 5313 font-size: 10 ;5319 font-size: 10 + prop("font-size-summand"); 5314 5320 } 5315 5321 way|z19[highway][setting("highway_labels")] { 5316 font-size: 11 ;5322 font-size: 11 + prop("font-size-summand"); 5317 5323 } 5318 5324 way|z20-[highway][setting("highway_labels")] { 5319 font-size: 12 ;5325 font-size: 12 + prop("font-size-summand"); 5320 5326 } 5321 5327 5322 5328 /*************/
Attachments (0)
Change History (7)
comment:1 by , 9 years ago
Description: | modified (diff) |
---|
comment:2 by , 9 years ago
comment:3 by , 9 years ago
Keywords: | hidpi added |
---|
comment:4 by , 9 years ago
My intention was to provide a solution until #9995 (which should include the map scaling) is fixed since it seems that it will take a while until #9995 is fixed.
It is a bit a regression, that mappaint.node.unselected-size
, mappaint.node.selected-size
, mappaint.node.tagged-size
and mappaint.node.connection-size
do no longer work since #10363.
comment:6 by , 9 years ago
Milestone: | 16.02 → 16.03 |
---|
comment:7 by , 9 years ago
Component: | Internal mappaint style → External mappaint style |
---|---|
Milestone: | 16.03 |
Resolution: | → fixed |
Status: | new → closed |
I created an external style: Styles/HiDPISupport
I don't like this approach to modify the style. The MapCSS code should automatically apply the scaling factor to any supplied font-size. The iconsize.map probably does only affect some of the places with sizes for map display. There may be a lot of places in the code where still hard-coded sizes are used.