wezterm icon indicating copy to clipboard operation
wezterm copied to clipboard

Сan't set font weight for Half

Open rwxmad opened this issue 6 months ago • 0 comments

What Operating System(s) are you seeing this problem on?

macOS

Which Wayland compositor or X11 Window manager(s) are you using?

No response

WezTerm version

wezterm 20240203-110809-5046fc22

Did you try the latest nightly build to see if the issue is better (or worse!) than your current version?

Yes, and I updated the version box above to show the version of the nightly that I tried

Describe the bug

I set the font settings like this, i need to set minimum font weight as medium...

config.font = wezterm.font({ family = "BlexMono Nerd Font", weight = "Medium" })
config.font_rules = {
  {
    intensity = "Bold",
    font = wezterm.font("BlexMono Nerd Font", { weight = "Bold" }),
  },
  {
    intensity = "Bold",
    italic = true,
    font = wezterm.font("BlexMono Nerd Font", { weight = "Bold", italic = true }),
  },
  {
    italic = true,
    font = wezterm.font("BlexMono Nerd Font", { weight = "Medium", italic = true }),
  },
  {
    intensity = "Half",
    font = wezterm.font("BlexMono Nerd Font", { weight = "Bold", stretch = "Normal" }),
  },
  {
    intensity = "Half",
    italic = true,
    font = wezterm.font("BlexMono Nerd Font", { weight = "Bold", stretch = "Normal", italic = true }),
  },
  {
    intensity = "Half",
    italic = false,
    font = wezterm.font("BlexMono Nerd Font", { weight = "Bold", stretch = "Normal" }),
  },
}

but I get the following data in the output via wezterm ls-fonts

Primary font:
wezterm.font_with_fallback({
  -- /Users/rwxmad/Library/Fonts/BlexMonoNerdFont-Medium.ttf, CoreText
  {family="BlexMono Nerd Font", weight="Medium"},

  -- <built-in>, BuiltIn
  "JetBrains Mono",

  -- <built-in>, BuiltIn
  -- Assumed to have Emoji Presentation
  "Noto Color Emoji",

  -- <built-in>, BuiltIn
  "Symbols Nerd Font Mono",

})


When Intensity=Bold:
wezterm.font_with_fallback({
  -- /Users/rwxmad/Library/Fonts/BlexMonoNerdFont-Bold.ttf, CoreText
  {family="BlexMono Nerd Font", weight="Bold"},

  -- <built-in>, BuiltIn
  "JetBrains Mono",

  -- <built-in>, BuiltIn
  -- Assumed to have Emoji Presentation
  "Noto Color Emoji",

  -- <built-in>, BuiltIn
  "Symbols Nerd Font Mono",

})


When Intensity=Bold Italic=true:
wezterm.font_with_fallback({
  -- /Users/rwxmad/Library/Fonts/BlexMonoNerdFont-BoldItalic.ttf, CoreText
  {family="BlexMono Nerd Font", weight="Bold", style="Italic"},

  -- <built-in>, BuiltIn
  "JetBrains Mono",

  -- <built-in>, BuiltIn
  -- Assumed to have Emoji Presentation
  "Noto Color Emoji",

  -- <built-in>, BuiltIn
  "Symbols Nerd Font Mono",

})


When Italic=true:
wezterm.font_with_fallback({
  -- /Users/rwxmad/Library/Fonts/BlexMonoNerdFont-MediumItalic.ttf, CoreText
  -- AKA: "BlexMono Nerd Font Medium"
  {family="BlexMono Nerd Font", weight="Medium", style="Italic"},

  -- <built-in>, BuiltIn
  "JetBrains Mono",

  -- <built-in>, BuiltIn
  -- Assumed to have Emoji Presentation
  "Noto Color Emoji",

  -- <built-in>, BuiltIn
  "Symbols Nerd Font Mono",

})


When Intensity=Half:
wezterm.font_with_fallback({
  -- /Users/rwxmad/Library/Fonts/BlexMonoNerdFont-Bold.ttf, CoreText
  {family="BlexMono Nerd Font", weight="Bold"},

  -- <built-in>, BuiltIn
  "JetBrains Mono",

  -- <built-in>, BuiltIn
  -- Assumed to have Emoji Presentation
  "Noto Color Emoji",

  -- <built-in>, BuiltIn
  "Symbols Nerd Font Mono",

})


When Intensity=Half Italic=true:
wezterm.font_with_fallback({
  -- /Users/rwxmad/Library/Fonts/BlexMonoNerdFont-BoldItalic.ttf, CoreText
  {family="BlexMono Nerd Font", weight="Bold", style="Italic"},

  -- <built-in>, BuiltIn
  "JetBrains Mono",

  -- <built-in>, BuiltIn
  -- Assumed to have Emoji Presentation
  "Noto Color Emoji",

  -- <built-in>, BuiltIn
  "Symbols Nerd Font Mono",

})


When Intensity=Half Italic=false:
wezterm.font_with_fallback({
  -- /Users/rwxmad/Library/Fonts/BlexMonoNerdFont-Bold.ttf, CoreText
  {family="BlexMono Nerd Font", weight="Bold"},

  -- <built-in>, BuiltIn
  "JetBrains Mono",

  -- <built-in>, BuiltIn
  -- Assumed to have Emoji Presentation
  "Noto Color Emoji",

  -- <built-in>, BuiltIn
  "Symbols Nerd Font Mono",

})


When Intensity=Half Italic=true:
wezterm.font_with_fallback({
  -- /Users/rwxmad/Library/Fonts/BlexMonoNerdFont-LightItalic.ttf, CoreText
  -- AKA: "BlexMono Nerd Font Light"
  {family="BlexMono Nerd Font", weight="Light", style="Italic"},

  -- <built-in>, BuiltIn
  "JetBrains Mono",

  -- <built-in>, BuiltIn
  -- Assumed to have Emoji Presentation
  "Noto Color Emoji",

  -- <built-in>, BuiltIn
  "Symbols Nerd Font Mono",

})


When Intensity=Half Italic=false:
wezterm.font_with_fallback({
  -- /Users/rwxmad/Library/Fonts/BlexMonoNerdFont-Light.ttf, CoreText
  {family="BlexMono Nerd Font", weight="Light"},

  -- <built-in>, BuiltIn
  "JetBrains Mono",

  -- <built-in>, BuiltIn
  -- Assumed to have Emoji Presentation
  "Noto Color Emoji",

  -- <built-in>, BuiltIn
  "Symbols Nerd Font Mono",

})


When Intensity=Bold Italic=false:
wezterm.font_with_fallback({
  -- /Users/rwxmad/Library/Fonts/BlexMonoNerdFont-Bold.ttf, CoreText
  {family="BlexMono Nerd Font", weight="Bold"},

  -- <built-in>, BuiltIn
  "JetBrains Mono",

  -- <built-in>, BuiltIn
  -- Assumed to have Emoji Presentation
  "Noto Color Emoji",

  -- <built-in>, BuiltIn
  "Symbols Nerd Font Mono",

})


When Intensity=Bold Italic=true:
wezterm.font_with_fallback({
  -- /Users/rwxmad/Library/Fonts/BlexMonoNerdFont-BoldItalic.ttf, CoreText
  {family="BlexMono Nerd Font", weight="Bold", style="Italic"},

  -- <built-in>, BuiltIn
  "JetBrains Mono",

  -- <built-in>, BuiltIn
  -- Assumed to have Emoji Presentation
  "Noto Color Emoji",

  -- <built-in>, BuiltIn
  "Symbols Nerd Font Mono",

})


When Intensity=Normal Italic=true:
wezterm.font_with_fallback({
  -- /Users/rwxmad/Library/Fonts/BlexMonoNerdFont-MediumItalic.ttf, CoreText
  -- AKA: "BlexMono Nerd Font Medium"
  {family="BlexMono Nerd Font", weight="Medium", style="Italic"},

  -- <built-in>, BuiltIn
  "JetBrains Mono",

  -- <built-in>, BuiltIn
  -- Assumed to have Emoji Presentation
  "Noto Color Emoji",

  -- <built-in>, BuiltIn
  "Symbols Nerd Font Mono",

})

Title font:
wezterm.font_with_fallback({
  -- <built-in>, BuiltIn
  {family="Roboto", weight="Bold"},

  -- /Users/rwxmad/Library/Fonts/BlexMonoNerdFont-Medium.ttf, CoreText
  {family="BlexMono Nerd Font", weight="Medium"},

  -- <built-in>, BuiltIn
  "JetBrains Mono",

  -- <built-in>, BuiltIn
  -- Assumed to have Emoji Presentation
  "Noto Color Emoji",

  -- <built-in>, BuiltIn
  "Symbols Nerd Font Mono",

})

To Reproduce

No response

Configuration

local wezterm = require("wezterm")

-- This table will hold the configuration.
local config = {}

-- In newer versions of wezterm, use the config_builder which will
-- help provide clearer error messages
if wezterm.config_builder then
  config = wezterm.config_builder()
end

config.automatically_reload_config = true

config.front_end = "WebGpu"

-- Window
config.window_decorations = "RESIZE"
config.window_background_opacity = 0.95
config.window_padding = {
  left = 2,
  right = 2,
  top = 2,
  bottom = 2,
}

config.hide_tab_bar_if_only_one_tab = true

-- Font
config.font = wezterm.font({ family = "BlexMono Nerd Font", weight = "Medium" })
config.font_rules = {
  {
    intensity = "Bold",
    font = wezterm.font("BlexMono Nerd Font", { weight = "Bold" }),
  },
  {
    intensity = "Bold",
    italic = true,
    font = wezterm.font("BlexMono Nerd Font", { weight = "Bold", italic = true }),
  },
  {
    italic = true,
    font = wezterm.font("BlexMono Nerd Font", { weight = "Medium", italic = true }),
  },
  {
    intensity = "Half",
    font = wezterm.font("BlexMono Nerd Font", { weight = "Bold", stretch = "Normal" }),
  },
  {
    intensity = "Half",
    italic = true,
    font = wezterm.font("BlexMono Nerd Font", { weight = "Bold", stretch = "Normal", italic = true }),
  },
  {
    intensity = "Half",
    italic = false,
    font = wezterm.font("BlexMono Nerd Font", { weight = "Bold", stretch = "Normal" }),
  },
}

config.font_size = 12.0

-- config.freetype_load_target = "Light"

-- Colorscheme
config.color_scheme_dirs = { os.getenv("HOME") .. "/.config/wezterm/colors" }
config.color_scheme = "Solarized"

config.bold_brightens_ansi_colors = true

return config

Expected Behavior

Set minimum font weight to Medium

Logs

No response

Anything else?

No response

rwxmad avatar Jul 27 '24 12:07 rwxmad