MAOS.git
Publicgit clone https://git.maproj.org/MAOS.gitMAOS.git / patches / roboto_fonts.patch
roboto_fonts.patch59 lines · 2.3 KiBRaw
| 1 | diff --git a/font_config.json b/font_config.json |
| 2 | index 5e46ece..9b44e99 100644 |
| 3 | --- a/font_config.json |
| 4 | +++ b/font_config.json |
| 5 | @@ -1,10 +1,19 @@ |
| 6 | [ |
| 7 | { |
| 8 | + // MAOS ships Google Sans Flex as the system font. It is a display face with only |
| 9 | + // ~535 codepoints - no Cyrillic, almost no Greek - so it cannot stand alone; the |
| 10 | + // "roboto-latin" fallback below covers everything it is missing. It does carry a |
| 11 | + // full wght axis (1-1000) and a wdth axis (25-151), so both the regular and the |
| 12 | + // condensed family are real instances rather than synthesised ones. |
| 13 | + // |
| 14 | + // supportedAxes stays "wght" because Google Sans Flex has no "ital" axis - it |
| 15 | + // slants via "slnt", which generate_fonts_xml does not accept (font_builder.py |
| 16 | + // allows only "wght" and "wght,ital"). Italic text is therefore synthesised. |
| 17 | "name": "sans-serif", |
| 18 | "fonts": [ |
| 19 | { |
| 20 | - "file": "Roboto-Regular.ttf", |
| 21 | - "supportedAxes": "wght,ital", |
| 22 | + "file": "GoogleSansFlex.ttf", |
| 23 | + "supportedAxes": "wght", |
| 24 | "axes": { |
| 25 | "wdth": "100" |
| 26 | } |
| 27 | @@ -13,12 +22,31 @@ |
| 28 | }, |
| 29 | { |
| 30 | "name": "sans-serif-condensed", |
| 31 | + "fonts": [ |
| 32 | + { |
| 33 | + "file": "GoogleSansFlex.ttf", |
| 34 | + "supportedAxes": "wght", |
| 35 | + "axes": { |
| 36 | + "wdth": "75" |
| 37 | + } |
| 38 | + } |
| 39 | + ] |
| 40 | + }, |
| 41 | + { |
| 42 | + // Every glyph Google Sans Flex lacks - all Cyrillic, most Greek and Latin Ext-B, |
| 43 | + // most punctuation - resolves here. Registered first in fallback_order.json so it |
| 44 | + // is reached before the Noto faces, which would otherwise pick up Cyrillic and |
| 45 | + // render it in a visibly different design. |
| 46 | + // |
| 47 | + // A fallback family needs an id or a lang that fallback_order.json knows about; |
| 48 | + // FallbackOrder asserts on any family it cannot place. |
| 49 | + "id": "roboto-latin", |
| 50 | "fonts": [ |
| 51 | { |
| 52 | "file": "Roboto-Regular.ttf", |
| 53 | "supportedAxes": "wght,ital", |
| 54 | "axes": { |
| 55 | - "wdth": "75" |
| 56 | + "wdth": "100" |
| 57 | } |
| 58 | } |
| 59 | ] |