-
Notifications
You must be signed in to change notification settings - Fork 7
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
Add font configuration settings #143
base: main
Are you sure you want to change the base?
Conversation
client/src/main.rs
Outdated
let default_font = iced::Font { | ||
family: iced::font::Family::Name("FiraCode Nerd Font"), | ||
family: iced::font::Family::Name(&settings.font.default), |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Try this dirty hack ;) kindly suggested by @a-kenji
family: iced::font::Family::Name(Box::leak(settings.font.default.into_boxed_str())),
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
With the current main the following should now be possible, because it has a static lifetime:
family: iced::font::Family::Name(&Settings::get_or_init().font.default)
#[serde(default)] | ||
pub color: ColorSettings, | ||
#[serde(default)] | ||
pub font: FontSettings, |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Could you also document the font as well as the color options in the Readme.md file and also implement setting those in nix (https://github.com/friedow/centerpiece/blob/main/home-manager-module.nix) in this pr?
@pinpox you need any help on this? |
Sorry, I've been quite busy the last weeks. I'll get back to it when I find the time. |
Flake lock file updates: • Updated input 'crane': 'github:ipetkov/crane/8a68b987c476a33e90f203f0927614a75c3f47ea' (2024-07-18) → 'github:ipetkov/crane/4c6c77920b8d44cd6660c1621dea6b3fc4b4c4f4' (2024-08-06) • Updated input 'home-manager': 'github:nix-community/home-manager/afd2021bedff2de92dfce0e257a3d03ae65c603d' (2024-07-16) → 'github:nix-community/home-manager/b3d5ea65d88d67d4ec578ed11d4d2d51e3de525e' (2024-08-07) • Updated input 'home-manager/nixpkgs': 'github:NixOS/nixpkgs/00d80d13810dbfea8ab4ed1009b09100cca86ba8' (2024-07-01) → 'github:NixOS/nixpkgs/52ec9ac3b12395ad677e8b62106f0b98c1f8569d' (2024-07-28) • Updated input 'nixpkgs': 'github:NixOS/nixpkgs/5e73714b16ca222dcb2fc3ea2618fd7ba698da65' (2024-07-17) → 'github:NixOS/nixpkgs/f5129fb42b9c262318130a97b47516946da3e7d7' (2024-08-07) • Updated input 'treefmt-nix': 'github:numtide/treefmt-nix/0fb28f237f83295b4dd05e342f333b447c097398' (2024-07-15) → 'github:numtide/treefmt-nix/768acdb06968e53aa1ee8de207fd955335c754b7' (2024-07-30) • Updated input 'treefmt-nix/nixpkgs': 'github:nixos/nixpkgs/2741b4b489b55df32afac57bc4bfd220e8bf617e' (2024-06-29) → 'github:nixos/nixpkgs/693bc46d169f5af9c992095736e82c3488bf7dbb' (2024-07-14)
Work in progress. I added the requered fields, but it still fails to build with:
I've tested just setting a different hardcoded string for the font name and it works nicely if the font is present on the system. I added a setting that default to the current font (Fira).