Fix Material Design's choice of default font

* Apply the "Roboto" family by default to the Window.
* Don't use "Roboto XXX" as that is not the name that's encoded as family name in the TrueType fonts. The variants should be chose based on the weight, not the family name.
* Don't apply the font family in the MD's LineEdit - that should not be necessary anymore.
This commit is contained in:
Simon Hausmann 2022-11-22 16:45:03 +01:00 committed by Simon Hausmann
parent bddbd43fac
commit 883e3c472e
3 changed files with 3 additions and 10 deletions

View file

@ -22,7 +22,6 @@ struct Color := {
// typo settings
struct Label := {
font: string,
size: length,
weight: int
}
@ -79,27 +78,22 @@ export global md := {
typescale: {
label-large: {
font: "Roboto Medium",
size: 14px,
weight: 500
},
label-medium: {
font: "Roboto Medium",
size: 12px,
weight: 500
},
body-large: {
font: "Roboto Medium",
size: 14px,
weight: 400
},
body-small: {
font: "Roboto Regular",
size: 12px,
weight: 400
},
title-small: {
font: "Roboto Medium",
size: 14px,
weight: 500
},

View file

@ -21,5 +21,7 @@ export global StyleMetrics := {
property<color> textedit-text-color-disabled: md.sys.color.on-surface;
property<bool> dark-color-scheme: md.dark-color-scheme;
property <string> default-font-family: "Roboto";
property<brush> window-background: md.sys.color.background;
}
}

View file

@ -40,7 +40,6 @@ export LineEdit := Rectangle {
width: 100%;
height: 100%;
color: md.sys.color.outline-variant;
font-family: md.sys.typescale.body-large.font;
font-size: md.sys.typescale.body-large.size;
font-weight: md.sys.typescale.body-large.weight;
visible: false;
@ -62,8 +61,6 @@ export LineEdit := Rectangle {
height: 100%;
color: md.sys.color.on-surface;
vertical-alignment: center;
// FIXME after Roboto font can be loaded
//font-family: md.sys.typescale.body-large.font;
font-size: md.sys.typescale.body-large.size;
font-weight: md.sys.typescale.body-large.weight;