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

View file

@ -16,6 +16,7 @@ tokio = { version = "1", features = ["sync"] }
i18n-embed = { version = "0.13", features = ["fluent-system", "desktop-requester"] }
i18n-embed-fl = "0.6"
rust-embed = "6"
paste = "1.0"
[dependencies.cosmic-text]
git = "https://github.com/pop-os/cosmic-text.git"