Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

High-contrast fonts as alternative fonts #2725

Closed
wants to merge 1 commit into from
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
12 changes: 9 additions & 3 deletions INSTALL.md
Original file line number Diff line number Diff line change
Expand Up @@ -63,15 +63,21 @@ Unifont is used as a last resort fallback, with it's excellent coverage, common

### Installation on Ubuntu/Debian

On Ubuntu 16.04 or Debian Testing you can download and install the required fonts except Noto Emoji Regular with
On Ubuntu 16.04 or Debian Testing you can download and install most of the required fonts with

```
sudo apt-get install fonts-noto-cjk fonts-noto-hinted fonts-noto-unhinted fonts-hanazono ttf-unifont
```

Noto Emoji Regular can be downloaded [from the Noto Emoji repository](https://github.com/googlei18n/noto-emoji).
It might be useful to have a more recent version of the fonts for [rare non-latin scripts](#non-latin-scripts).

It might be useful to have a more recent version of the fonts for [rare non-latin scripts](#non-latin-scripts). This can be installed [from source](https://github.com/googlei18n/noto-fonts/blob/master/FAQ.md#where-are-the-fonts).
These fonts are not available on Ubuntu 16.04:
* Noto Emoji Regular
* Noto Serif CJK JP Medium
* Noto Serif Devanagari Regular
* Noto Serif Hebrew Regular

The up-to-date comprehensive Noto fonts can be installed [from source](https://github.com/googlei18n/noto-fonts/blob/master/FAQ.md#where-are-the-fonts).

DejaVu is packaged as `fonts-dejavu-core`.

Expand Down
6 changes: 3 additions & 3 deletions amenity-points.mss
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@
@landcover-wrap-width-size: 25;
@landcover-wrap-width-size-big: 35;
@landcover-wrap-width-size-bigger: 45;
@landcover-face-name: @oblique-fonts;
@landcover-face-name: @alternative-fonts;

@standard-wrap-width: 30;
@standard-text-size: 10;
Expand Down Expand Up @@ -1066,7 +1066,7 @@
text-size: @standard-text-size;
[way_pixels > 12000] { text-size: 12; }
[way_pixels > 48000] { text-size: 15; }
text-face-name: @oblique-fonts;
text-face-name: @alternative-fonts;
text-halo-radius: @standard-halo-radius;
text-halo-fill: @standard-halo-fill;
text-wrap-width: @standard-wrap-width;
Expand Down Expand Up @@ -2052,7 +2052,7 @@
text-size: @standard-text-size;
text-fill: darken(@airtransport, 15%);
text-dy: 10;
text-face-name: @oblique-fonts;
text-face-name: @alternative-fonts;
text-halo-radius: @standard-halo-radius;
text-halo-fill: @standard-halo-fill;
text-placement: interior;
Expand Down
28 changes: 25 additions & 3 deletions fonts.mss
Original file line number Diff line number Diff line change
Expand Up @@ -119,6 +119,7 @@ A regular style.
"Unifont Medium", "unifont Medium", "Unifont Upper Medium";

/*
A bold version of the regular style.
A bold style is available for almost all scripts. Bold text is heavier than
regular text and can be used for emphasis. Fallback is a regular style.
*/
Expand Down Expand Up @@ -148,7 +149,28 @@ regular text and can be used for emphasis. Fallback is a regular style.
@book-fonts;

/*
Italics are only available for the base font, not the other scripts.
For a considerable number of labels this style will make no difference to the regular style.
An alternative style.
While the regular style and its bold variant has low contrast between thick and
thin strokes, the alternative style is a high-contrast style. Furthermore, the
alternative style has serifs and italic glyphs for LGC scripts and serif-like
decorations for CJK scripts. This alternative style is available for many
scripts. Its weight matches the weight of the regular style. For CJK, we
use Medium weight because it’ a better match with the Regular weight of the
other fonts.
*/
@oblique-fonts: "Noto Sans UI Italic", @book-fonts;
@alternative-fonts: "Noto Serif Italic", "Noto Serif Regular",
"Noto Serif CJK JP Medium",
"Noto Serif Armenian Regular",
"Noto Serif Bengali Regular",
"Noto Serif Devanagari Regular",
"Noto Serif Georgian Regular",
"Noto Serif Gujarati Regular",
"Noto Serif Hebrew Regular",
"Noto Serif Kannada Regular",
"Noto Serif Khmer Regular",
"Noto Serif Lao Regular",
"Noto Serif Malayalam Regular",
"Noto Serif Tamil Regular",
"Noto Serif Telugu Regular",
"Noto Serif Thai Regular",
@book-fonts;
2 changes: 1 addition & 1 deletion placenames.mss
Original file line number Diff line number Diff line change
Expand Up @@ -50,7 +50,7 @@
text-line-spacing: -1.5; // -0.15 em
text-margin: 7.0; // 0.7 em
text-fill: @state-labels;
text-face-name: @oblique-fonts;
text-face-name: @alternative-fonts;
text-halo-fill: @standard-halo-fill;
text-halo-radius: @standard-halo-radius * 1.5;
text-placement: interior;
Expand Down
2 changes: 1 addition & 1 deletion roads.mss
Original file line number Diff line number Diff line change
Expand Up @@ -2406,7 +2406,7 @@ tertiary is rendered from z10 and is not included in osm_planet_roads. */
text-size: 10;
text-fill: @junction-text-color;
text-min-distance: 2;
text-face-name: @oblique-fonts;
text-face-name: @alternative-fonts;
text-halo-radius: @standard-halo-radius;
text-wrap-character: ";";
text-wrap-width: 2; // effectively break after every wrap character
Expand Down
14 changes: 7 additions & 7 deletions water.mss
Original file line number Diff line number Diff line change
Expand Up @@ -239,7 +239,7 @@
[lock != 'yes'][int_tunnel != 'yes'] {
[waterway = 'river'][zoom >= 13] {
text-name: "[name]";
text-face-name: @oblique-fonts;
text-face-name: @alternative-fonts;
text-placement: line;
text-fill: @water-text;
text-spacing: 400;
Expand All @@ -252,7 +252,7 @@

[waterway = 'canal'][zoom >= 13][zoom < 14] {
text-name: "[name]";
text-face-name: @oblique-fonts;
text-face-name: @alternative-fonts;
text-halo-radius: @standard-halo-radius;
text-halo-fill: @standard-halo-fill;
text-size: 10;
Expand All @@ -263,7 +263,7 @@
[waterway = 'stream'][zoom >= 15] {
text-name: "[name]";
text-size: 10;
text-face-name: @oblique-fonts;
text-face-name: @alternative-fonts;
text-fill: @water-text;
text-halo-radius: @standard-halo-radius;
text-halo-fill: @standard-halo-fill;
Expand All @@ -277,7 +277,7 @@
[waterway = 'ditch'] {
[zoom >= 15] {
text-name: "[name]";
text-face-name: @oblique-fonts;
text-face-name: @alternative-fonts;
text-size: 10;
text-fill: @water-text;
text-spacing: 600;
Expand All @@ -292,7 +292,7 @@
text-size: 10;
text-fill: @water-text;
text-placement: line;
text-face-name: @oblique-fonts;
text-face-name: @alternative-fonts;
text-halo-radius: @standard-halo-radius;
text-halo-fill: @standard-halo-fill;
}
Expand All @@ -301,7 +301,7 @@
text-name: "[name]";
text-size: 10;
text-fill: #80d1ae;
text-face-name: @oblique-fonts;
text-face-name: @alternative-fonts;
text-placement: line;
text-spacing: 600;
text-halo-radius: @standard-halo-radius;
Expand Down Expand Up @@ -339,7 +339,7 @@
text-line-spacing: -0.95; // -0.05 em
}
text-fill: @water-text;
text-face-name: @oblique-fonts;
text-face-name: @alternative-fonts;
text-halo-radius: @standard-halo-radius;
text-halo-fill: @standard-halo-fill;
text-placement: interior;
Expand Down