Fixed some font issues

This commit is contained in:
Jan-Bulthuis 2025-01-24 02:26:24 +01:00
parent 3f11f64135
commit f341226d0b
5 changed files with 41 additions and 20 deletions

View File

@ -43,8 +43,8 @@ in
# config.set("completion.web_history.max_items", 30)
config.set("colors.webpage.darkmode.enabled", False)
config.set("colors.webpage.preferred_color_scheme", "${if theme.darkMode then "dark" else "light"}")
config.set("fonts.default_family", "${theme.fonts.monospace.name}")
config.set("fonts.default_size", "${toString theme.fonts.monospace.recommendedSize}pt")
config.set("fonts.default_family", "${theme.fonts.interface.name}")
config.set("fonts.default_size", "${toString theme.fonts.interface.recommendedSize}pt")
'';
};
};

View File

@ -19,7 +19,7 @@ in
enable = true;
terminal = config.default.terminal;
package = pkgs.rofi-wayland;
font = "${theme.fonts.monospace.name} ${toString theme.fonts.monospace.recommendedSize}";
font = "${theme.fonts.interface.name} ${toString (theme.fonts.interface.recommendedSize)}";
theme =
let
inherit (config.lib.formats.rasi) mkLiteral;

View File

@ -243,6 +243,11 @@ in
description = "Default emoji font.";
};
interface = mkOption {
type = fontModule;
description = "Default emoji font.";
};
extraFonts = mkOption {
type = types.listOf fontModule;
default = [ ];

View File

@ -49,14 +49,29 @@ in
ms-vsliveshare.vsliveshare
];
userSettings = {
# Font setup
userSettings =
let
font-family = mkForce "'${cfg.codeFont.name}', '${cfg.fallbackFont.name}'";
# TODO: Move the conversion factor to theme settings
"editor.fontFamily" = mkForce "'${cfg.codeFont.name}', '${cfg.fallbackFont.name}'";
"editor.fontSize" = mkForce (cfg.codeFont.recommendedSize); # Convert pt to px
font-size = mkForce cfg.codeFont.recommendedSize; # Convert pt to px
in
{
# Font setup
"editor.fontFamily" = font-family;
"editor.inlayHints.fontFamily" = font-family;
"editor.inlineSuggest.fontFamily" = font-family;
"editor.fontSize" = font-size;
"editor.fontLigatures" = true;
"terminal.integrated.fontFamily" = mkForce "'${cfg.codeFont.name}', '${cfg.fallbackFont.name}'";
"terminal.integrated.fontSize" = mkForce (cfg.codeFont.recommendedSize); # Convert pt to px
"terminal.integrated.fontFamily" = font-family;
"terminal.integrated.fontSize" = font-size;
"chat.editor.fontFamily" = font-family; # TODO: Change this font to the standard UI font
"chat.editor.fontSize" = font-size;
"debug.console.fontFamily" = font-family;
"debug.console.fontSize" = font-size;
"scm.inputFontFamily" = font-family; # TODO: Change this font to the standard UI font
"scm.inputFontSize" = font-size;
"markdown.preview.fontFamily" = mkForce theme.fonts.sansSerif.name; # TODO: Change this font to the standard UI font
"markdown.preview.fontSize" = mkForce theme.fonts.sansSerif.recommendedSize;
# Formatting
"editor.formatOnSave" = true;

View File

@ -114,6 +114,7 @@
fonts.sansSerif = fontpkgs."DejaVu Sans";
fonts.monospace = fontpkgs."Dina";
fonts.emoji = fontpkgs."Noto Color Emoji";
fonts.interface = fontpkgs."Dina";
fonts.extraFonts = [ ];
# Color scheme