From 332bf3e287ee2ed00ac13f65e2f1e68a12864be9 Mon Sep 17 00:00:00 2001 From: math1985 Date: Sun, 4 Feb 2018 23:38:25 +0100 Subject: [PATCH] Improve country/state label rendering * Stop rendering country/state labels slightly earlier * Scale country/state labels with country/state size instead of with zoom level (similarly to landcover labels) * Set text-wrap to a constant em --- placenames.mss | 59 ++++++++++++++++++++++---------------------------- 1 file changed, 26 insertions(+), 33 deletions(-) diff --git a/placenames.mss b/placenames.mss index c97aa76c82..3fc1b166e3 100644 --- a/placenames.mss +++ b/placenames.mss @@ -4,34 +4,22 @@ @state-labels: desaturate(darken(@admin-boundaries, 5%), 20%); .country { - [zoom >= 3][way_pixels > 1000][way_pixels < 360000] { + [zoom >= 3][way_pixels > 1000][way_pixels < 192000] { text-name: "[name]"; - text-size: 10; - text-wrap-width: 35; // 3.5 em - text-line-spacing: -1.5; // -0.15 em + text-size: @landcover-font-size; + text-wrap-width: @landcover-wrap-width-size; + text-line-spacing: @landcover-line-spacing-size; text-margin: 7.0; // 0.7 em - [zoom >= 4] { - text-size: 11; - text-wrap-width: 40; // 3.6 em - text-line-spacing: -1.4; // -0.13 em - text-margin: 7.7; // 0.7 em - } - [zoom >= 5] { - text-size: 12; - text-wrap-width: 45; // 3.8 em - text-line-spacing: -1.2; // -0.10 em + [way_pixels > 12000] { + text-size: @landcover-font-size-big; + text-wrap-width: @landcover-wrap-width-size-big; + text-line-spacing: @landcover-line-spacing-size-big; text-margin: 8.4; // 0.7 em } - [zoom >= 7] { - text-size: 13; - text-wrap-width: 50; // 3.8 em - text-line-spacing: -1.0; // -0.08 em - text-margin: 9.1; // 0.7 em - } - [zoom >= 10] { - text-size: 14; - text-wrap-width: 55; // 3.9 em - text-line-spacing: -0.7; // -0.05 em + [way_pixels > 48000] { + text-size: @landcover-font-size-bigger; + text-wrap-width: @landcover-wrap-width-size-bigger; + text-line-spacing: @landcover-line-spacing-size-bigger; } text-fill: @country-labels; text-face-name: @book-fonts; @@ -43,22 +31,27 @@ } .state { - [zoom >= 5][way_pixels > 3000][way_pixels < 196000] { + [zoom >= 5][way_pixels > 3000][way_pixels < 192000] { text-name: "[name]"; - text-size: 10; - text-wrap-width: 30; // 3.0 em - text-line-spacing: -1.5; // -0.15 em + text-size: @landcover-font-size; + text-wrap-width: @landcover-wrap-width-size; + text-line-spacing: @landcover-line-spacing-size; text-margin: 7.0; // 0.7 em text-fill: @state-labels; text-face-name: @oblique-fonts; text-halo-fill: @standard-halo-fill; text-halo-radius: @standard-halo-radius * 1.5; text-placement: interior; - [zoom >= 7] { - text-size: 11; - text-wrap-width: 50; // 4.5 em - text-line-spacing: -0.6; // -0.05 em - text-margin: 7.7; // 0.7 em + [way_pixels > 12000] { + text-size: @landcover-font-size-big; + text-wrap-width: @landcover-wrap-width-size-big; + text-line-spacing: @landcover-line-spacing-size-big; + text-margin: 8.4; // 0.7 em + } + [way_pixels > 48000] { + text-size: @landcover-font-size-bigger; + text-wrap-width: @landcover-wrap-width-size-bigger; + text-line-spacing: @landcover-line-spacing-size-bigger; } } }