From 2fd489b4ccf64c2bd70109a4be209323702743bb Mon Sep 17 00:00:00 2001 From: Mateusz Konieczny Date: Sat, 25 Oct 2014 18:43:02 +0200 Subject: [PATCH 1/2] tweak text-dy so tall names are appearing fixes #870, fixes #959 script used to find bad text-dy is available at https://gist.github.com/mkoniecz/9451a41ec0ae38b23b54 the proper way to test it is using mapnik-legendary, but it depends on currently broken Ruby-Mapnik --- amenity-points.mss | 42 +++++++++++++++++++++++++----------------- roads.mss | 4 ++-- 2 files changed, 27 insertions(+), 19 deletions(-) diff --git a/amenity-points.mss b/amenity-points.mss index 2f28fb0bb7..28e82b56f4 100644 --- a/amenity-points.mss +++ b/amenity-points.mss @@ -438,13 +438,13 @@ text-name: "[name]"; text-fill: #734a08; text-size: 10; - text-dy: 9; + text-dy: 11; text-face-name: @bold-fonts; text-halo-radius: 1; text-wrap-width: 34; text-placement: interior; - [feature = 'amenity_bar'] { - text-dy: 11; + [feature = 'amenity_bar']{ + text-dy: 13; } } } @@ -457,12 +457,12 @@ text-name: "[name]"; text-size: 10; text-fill: #734a08; - text-dy: 12; + text-dy: 13; text-face-name: @bold-fonts; text-halo-radius: 1; text-placement: interior; [feature = 'amenity_cinema'] { - text-dy: 14; + text-dy: 15; } } } @@ -485,7 +485,7 @@ text-name: "[name]"; text-size: 10; text-fill: #734a08; - text-dy: 10; + text-dy: 11; text-face-name: @book-fonts; text-halo-radius: 1; text-wrap-width: 30; @@ -496,7 +496,7 @@ text-name: "[name]"; text-size: 10; text-fill: #734a08; - text-dy: 9; + text-dy: 11; text-face-name: @book-fonts; text-halo-radius: 1; text-wrap-width: 30; @@ -559,7 +559,7 @@ text-name: "[name]"; text-size: 10; text-fill: brown; - text-dy: 9; + text-dy: 11; text-face-name: @book-fonts; text-halo-radius: 1; text-wrap-width: 20; @@ -688,6 +688,7 @@ [zoom >= 17] { text-name: "[name]"; text-size: 11; + text-dy: 13; text-fill: darken(@park, 60%); text-face-name: @book-fonts; text-halo-radius: 1; @@ -1043,7 +1044,7 @@ text-name: "[name]"; text-size: 9; text-fill: #6699cc; - text-dy: 10; + text-dy: 11; text-face-name: @book-fonts; text-halo-radius: 1; text-placement: interior; @@ -1051,7 +1052,7 @@ ele/text-name: "[ele]"; ele/text-size: 8; ele/text-fill: #6699cc; - ele/text-dy: 22; + ele/text-dy: 23; ele/text-face-name: @oblique-fonts; ele/text-halo-radius: 1; ele/text-placement: interior; @@ -1062,14 +1063,14 @@ text-name: "[name]"; text-size: 9; text-fill: #6699cc; - text-dy: 10; + text-dy: 11; text-face-name: @book-fonts; text-halo-radius: 1; text-placement: interior; ele/text-name: "[ele]"; ele/text-size: 8; ele/text-fill: #6699cc; - ele/text-dy: 22; + ele/text-dy: 23; ele/text-face-name: @oblique-fonts; ele/text-halo-radius: 1; ele/text-placement: interior; @@ -1079,7 +1080,7 @@ text-name: "[name]"; text-size: 9; text-fill: black; - text-dy: 9; + text-dy: 12; text-halo-radius: 1; text-placement: interior; text-face-name: @book-fonts; @@ -1093,10 +1094,13 @@ text-name: "[name]"; text-size: 10; text-fill: #0066ff; - text-dy: 11; + text-dy: 13; text-face-name: @book-fonts; text-halo-radius: 1; text-placement: interior; + [feature = 'tourism_chalet'] { + text-dy: 11; + } } } @@ -1104,7 +1108,7 @@ text-name: "[name]"; text-size: 9; text-fill: #0066ff; - text-dy: 8; + text-dy: 9; text-face-name: @book-fonts; text-halo-radius: 1; text-placement: interior; @@ -1127,10 +1131,13 @@ text-name: "[name]"; text-size: 9; text-fill: @transportation-text; - text-dy: 9; + text-dy: 11; text-face-name: @book-fonts; text-halo-radius: 1; text-placement: interior; + [feature = 'highway_bus_stop'] { + text-dy: 9; + } } } @@ -1153,6 +1160,7 @@ [way_pixels > 12000] { text-size: @landcover-font-size-big; } [way_pixels > 48000] { text-size: @landcover-font-size-bigger; } text-fill: darken(@campsite, 50%); + text-dy: 15; text-face-name: @landcover-face-name; text-halo-radius: 1; text-halo-fill: rgba(255,255,255,0.6); @@ -1208,7 +1216,7 @@ [feature = 'tourism_museum'][zoom >= 17] { text-name: "[name]"; text-size: 10; - text-dy: 10; + text-dy: 11; text-fill: #734a08; text-face-name: @book-fonts; text-halo-radius: 1; diff --git a/roads.mss b/roads.mss index 3a880d36bf..6f23f8ba3c 100644 --- a/roads.mss +++ b/roads.mss @@ -1809,9 +1809,9 @@ [zoom >= 17] { text-size: 11; /* Offset name on traffic_signals on zoomlevels where they are displayed - in order not to hide the icon */ + in order not to hide the text */ [highway = 'traffic_signals'] { - text-dy: 11; + text-dy: 13; } } } From a239e3b5189ba3067272405cba72e4e5c303b3a3 Mon Sep 17 00:00:00 2001 From: Mateusz Konieczny Date: Sun, 26 Oct 2014 07:21:44 +0100 Subject: [PATCH 2/2] add standard text-wrap-width --- amenity-points.mss | 58 ++++++++++++++++++++++++++++------------------ 1 file changed, 36 insertions(+), 22 deletions(-) diff --git a/amenity-points.mss b/amenity-points.mss index 28e82b56f4..216f88cbe7 100644 --- a/amenity-points.mss +++ b/amenity-points.mss @@ -11,6 +11,8 @@ @landcover-wrap-width-size-bigger: 45; @landcover-face-name: @oblique-fonts; +@standard-wrap-width: 30; + .points { [feature = 'tourism_alpine_hut'][zoom >= 13] { point-file: url('symbols/alpinehut.p.16.png'); @@ -425,6 +427,7 @@ [way_pixels > 48000] { text-size: 15; } text-face-name: @oblique-fonts; text-halo-radius: 1; + text-wrap-width: @standard-wrap-width; text-placement: interior; } @@ -441,7 +444,7 @@ text-dy: 11; text-face-name: @bold-fonts; text-halo-radius: 1; - text-wrap-width: 34; + text-wrap-width: @standard-wrap-width; text-placement: interior; [feature = 'amenity_bar']{ text-dy: 13; @@ -460,6 +463,7 @@ text-dy: 13; text-face-name: @bold-fonts; text-halo-radius: 1; + text-wrap-width: @standard-wrap-width; text-placement: interior; [feature = 'amenity_cinema'] { text-dy: 15; @@ -474,7 +478,7 @@ text-dy: 9; text-face-name: @book-fonts; text-halo-radius: 1; - text-wrap-width: 34; + text-wrap-width: @standard-wrap-width; text-placement: interior; [access != ''][access != 'public'][access != 'yes'] { text-fill: #66ccaf; @@ -488,7 +492,7 @@ text-dy: 11; text-face-name: @book-fonts; text-halo-radius: 1; - text-wrap-width: 30; + text-wrap-width: @standard-wrap-width; text-placement: interior; } @@ -499,7 +503,7 @@ text-dy: 11; text-face-name: @book-fonts; text-halo-radius: 1; - text-wrap-width: 30; + text-wrap-width: @standard-wrap-width; text-placement: interior; } @@ -510,7 +514,7 @@ text-dy: 12; text-face-name: @book-fonts; text-halo-radius: 1; - text-wrap-width: 30; + text-wrap-width: @standard-wrap-width; text-placement: interior; } @@ -541,6 +545,7 @@ text-dy: 7; text-face-name: @book-fonts; text-halo-radius: 1; + text-wrap-width: @standard-wrap-width; text-placement: interior; ele/text-name: "[ele]"; ele/text-size: 9; @@ -562,7 +567,7 @@ text-dy: 11; text-face-name: @book-fonts; text-halo-radius: 1; - text-wrap-width: 20; + text-wrap-width: @standard-wrap-width; text-placement: interior; } @@ -573,7 +578,7 @@ text-dy: 13; text-face-name: @book-fonts; text-halo-radius: 1; - text-wrap-width: 20; + text-wrap-width: @standard-wrap-width; text-placement: interior; } @@ -584,7 +589,7 @@ text-dy: 15; text-face-name: @book-fonts; text-halo-radius: 1; - text-wrap-width: 20; + text-wrap-width: @standard-wrap-width; text-placement: interior; } @@ -605,7 +610,7 @@ text-fill: @water-text; text-face-name: @oblique-fonts; text-halo-radius: 1; - text-wrap-width: 20; + text-wrap-width: @standard-wrap-width; text-placement: interior; } } @@ -693,7 +698,7 @@ text-face-name: @book-fonts; text-halo-radius: 1; text-halo-fill: rgba(255,255,255,0.6); - text-wrap-width: 30; + text-wrap-width: @standard-wrap-width; text-placement: interior; } } @@ -1025,7 +1030,7 @@ text-fill: #6699cc; text-face-name: @book-fonts; text-halo-radius: 1; - text-wrap-width: 20; + text-wrap-width: @standard-wrap-width; text-placement: interior; } @@ -1035,7 +1040,7 @@ text-fill: #6699cc; text-face-name: @book-fonts; text-halo-radius: 1; - text-wrap-width: 20; + text-wrap-width: @standard-wrap-width; text-placement: interior; text-dy: 6; } @@ -1047,6 +1052,7 @@ text-dy: 11; text-face-name: @book-fonts; text-halo-radius: 1; + text-wrap-width: @standard-wrap-width; text-placement: interior; [zoom >= 16] { ele/text-name: "[ele]"; @@ -1066,6 +1072,7 @@ text-dy: 11; text-face-name: @book-fonts; text-halo-radius: 1; + text-wrap-width: @standard-wrap-width; text-placement: interior; ele/text-name: "[ele]"; ele/text-size: 8; @@ -1082,6 +1089,7 @@ text-fill: black; text-dy: 12; text-halo-radius: 1; + text-wrap-width: @standard-wrap-width; text-placement: interior; text-face-name: @book-fonts; } @@ -1097,6 +1105,7 @@ text-dy: 13; text-face-name: @book-fonts; text-halo-radius: 1; + text-wrap-width: @standard-wrap-width; text-placement: interior; [feature = 'tourism_chalet'] { text-dy: 11; @@ -1111,6 +1120,7 @@ text-dy: 9; text-face-name: @book-fonts; text-halo-radius: 1; + text-wrap-width: @standard-wrap-width; text-placement: interior; } @@ -1121,6 +1131,7 @@ text-dy: 10; text-face-name: @book-fonts; text-halo-radius: 1; + text-wrap-width: @standard-wrap-width; text-placement: interior; } @@ -1134,6 +1145,7 @@ text-dy: 11; text-face-name: @book-fonts; text-halo-radius: 1; + text-wrap-width: @standard-wrap-width; text-placement: interior; [feature = 'highway_bus_stop'] { text-dy: 9; @@ -1148,7 +1160,7 @@ text-dy: 15; text-face-name: @book-fonts; text-halo-radius: 1; - text-wrap-width: 70; + text-wrap-width: @standard-wrap-width; text-placement: interior; } @@ -1178,7 +1190,7 @@ text-fill: #0066ff; text-face-name: @book-fonts; text-halo-radius: 1; - text-wrap-width: 70; + text-wrap-width: @standard-wrap-width; text-placement: interior; } @@ -1188,7 +1200,7 @@ text-fill: @marina-text; text-face-name: @book-fonts; text-halo-radius: 1; - text-wrap-width: 30; + text-wrap-width: @standard-wrap-width; text-placement: interior; [zoom >= 17] { text-size: 10; @@ -1220,6 +1232,7 @@ text-fill: #734a08; text-face-name: @book-fonts; text-halo-radius: 1; + text-wrap-width: @standard-wrap-width; text-placement: interior; } @@ -1230,6 +1243,7 @@ text-dy: 16; text-face-name: @book-fonts; text-halo-radius: 1; + text-wrap-width: @standard-wrap-width; text-placement: interior; } @@ -1313,7 +1327,7 @@ text-dy: 16; text-face-name: @book-fonts; text-halo-radius: 2; - text-wrap-width: 12; + text-wrap-width: @standard-wrap-width; text-placement: interior; } @@ -1324,7 +1338,7 @@ text-dy: 12; text-face-name: @book-fonts; text-halo-radius: 1; - text-wrap-width: 20; + text-wrap-width: @standard-wrap-width; text-placement: interior; } @@ -1335,7 +1349,7 @@ text-dy: 10; text-face-name: @book-fonts; text-halo-radius: 2; - text-wrap-width: 24; + text-wrap-width: @standard-wrap-width; text-placement: interior; } @@ -1346,7 +1360,7 @@ text-fill: #da0092; text-face-name: @book-fonts; text-halo-radius: 1; - text-wrap-width: 12; + text-wrap-width: @standard-wrap-width; text-placement: interior; } @@ -1369,7 +1383,7 @@ text-fill: #939; text-face-name: @book-fonts; text-halo-radius: 1; - text-wrap-width: 12; + text-wrap-width: @standard-wrap-width; text-placement: interior; } } @@ -1383,7 +1397,7 @@ text-fill: #939; text-face-name: @book-fonts; text-halo-radius: 1; - text-wrap-width: 20; + text-wrap-width: @standard-wrap-width; text-placement: interior; } } @@ -1430,7 +1444,7 @@ text-fill: #aa66cc; text-face-name: @book-fonts; text-halo-radius: 1; - text-wrap-width: 10; + text-wrap-width: @standard-wrap-width; text-placement: interior; }