Configurable font stretch, font weight, and bold font weight

* Store a font name => font faces map

 * Only list font names that have `NORMAL` and `BOLD` faces with
   `Normal` stretch. This will give us defaults and fall-backs that are
   guaranteed to always exist.

 * Filter by stretch first, with `Normal` chosen as the always existing
   default.

 * Then only list font weights supported by the font name stretch
   selected, for the normal and bold cases.

 * When changing the font name selected, the stretch/weight options
   will stay the same if supported by the new font name, or revert to
   the always existing fall-backs.

Signed-off-by: Mohammad AlSaleh <CE.Mohammad.AlSaleh@gmail.com>
This commit is contained in:
Mohammad AlSaleh 2024-01-10 01:19:04 +03:00 • committed by Jeremy Soller
parent c74d5d6f56
commit 5eba6eb4d6
6 changed files with 251 additions and 12 deletions

1
Cargo.lock generated
View file

@ -874,6 +874,7 @@ dependencies = [
"lazy_static",
"libcosmic",
"log",
"paste",
"rust-embed",
"serde",
"tokio",