Skip to content
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

[BUG]: Chinese Characters Cannot be Rendered in komorebi.bar and Chinese Fonts Crash the Application #1139

Open
tieniu1 opened this issue Nov 23, 2024 · 3 comments
Labels
bug Something isn't working

Comments

@tieniu1
Copy link

tieniu1 commented Nov 23, 2024

Summary

PixPin_2024-11-23_21-48-41

Current Behavior

  1. The default font "JetBrains Mono" cannot render Chinese characters properly, showing squares/boxes instead
  2. When trying to use Chinese fonts like "Microsoft YaHei" or "Sarasa Mono SC", komorebi.bar crashes immediately

Steps to Reproduce

  1. Default configuration with "JetBrains Mono":
{
"font_family": "JetBrains Mono"
}
  • Chinese characters are displayed as squares/boxes
  1. Try to use Chinese fonts:
{
"font_family": "Microsoft YaHei"
// or
"font_family": "Sarasa Mono SC"
}
  • komorebi.bar crashes immediately after configuration

Expected Behavior

  1. The default font should support Chinese characters
  2. Common Chinese fonts should work without crashing

Environment

  • Windows 11
  • komorebi version: [your version]
  • komorebi.bar version: [your version]

Additional Notes

  • The default font should either support Chinese characters or be replaced with a font that does
  • Popular CJK fonts like Sarasa Mono SC should be supported without causing crashes

Version Information

Clip_2024-11-23_22-01-33

I ran "systeminfo | findstr /B /C:"OS Name" /B /C:"OS Version"" but got no output.

PS C:\Users\haland> [System.Environment]::OSVersion

Platform ServicePack Version VersionString


Win32NT 10.0.22631.0 Microsoft Windows NT 10.0.22631.0

PS C:\Users\haland> komorebic --version
komorebic 0.1.30
tag:v0.1.30
commit_hash:9a3dbccc
build_time:2024-11-03 23:49:52 +00:00
build_env:rustc 1.82.0 (f6e511eec 2024-10-15),stable-x86_64-pc-windows-msvc

Komorebi Configuration

{
  "$schema": "https://raw.githubusercontent.com/LGUG2Z/komorebi/v0.1.30/schema.bar.json",
  "monitor": {
    "index": 0,
    "work_area_offset": {
      "left": 0,
      "top": 40,
      "right": 0,
      "bottom": 40
    }
  },
  "font_family": "Microsoft YaHei",
  "theme": {
    "palette": "Base16",
    "name": "Ashes",
    "accent": "Base0D"
  },
  "left_widgets": [
    {
      "Komorebi": {
        "workspaces": {
          "enable": true,
          "hide_empty_workspaces": true
        },
        "layout": {
          "enable": true
        },
        "focused_window": {
          "enable": true,
          "show_icon": true
        }
      }
    }
  ],
  "right_widgets": [
    {
      "Media": {
        "enable": true
      }
    },
    {
      "Storage": {
        "enable": true
      }
    },
    {
      "Memory": {
        "enable": true
      }
    },
    {
      "Network": {
        "enable": true,
        "show_total_data_transmitted": false,
        "show_network_activity": true
      }
    },
    {
      "Date": {
        "enable": true,
        "format": "DayDateMonthYear"
      }
    },
    {
      "Time": {
        "enable": true,
        "format": "TwentyFourHour"
      }
    },
    {
      "Battery": {
        "enable": true
      }
    }
  ]
}

Hotkey Configuration

.shell powershell

alt + o                 : taskkill /f /im whkd.exe; Start-Process whkd -WindowStyle hidden
alt + shift + o         : komorebic reload-configuration

alt + q                 : komorebic close
alt + m                 : komorebic minimize


alt + h                 : komorebic focus left
alt + j                 : komorebic focus down
alt + k                 : komorebic focus up
alt + l                 : komorebic focus right
alt + shift + oem_4     : komorebic cycle-focus previous
alt + shift + oem_6     : komorebic cycle-focus next


alt + shift + h         : komorebic move left
alt + shift + j         : komorebic move down
alt + shift + k         : komorebic move up
alt + shift + l         : komorebic move right
alt + shift + return    : komorebic promote


alt + left              : komorebic stack left
alt + down              : komorebic stack down
alt + up                : komorebic stack up
alt + right             : komorebic stack right
alt + oem_1             : komorebic unstack
alt + oem_4             : komorebic cycle-stack previous
alt + oem_6             : komorebic cycle-stack next


alt + oem_plus          : komorebic resize-axis horizontal increase
alt + oem_minus         : komorebic resize-axis horizontal decrease
alt + shift + oem_plus  : komorebic resize-axis vertical increase
alt + shift + oem_minus : komorebic resize-axis vertical decrease


alt + shift + f         : komorebic toggle-float
alt + f                 : komorebic toggle-monocle


alt + shift + r         : komorebic retile
alt + p                 : komorebic toggle-pause


alt + x                 : komorebic flip-layout horizontal
alt + y                 : komorebic flip-layout vertical


alt + 1                 : komorebic focus-workspace 0
alt + 2                 : komorebic focus-workspace 1
alt + 3                 : komorebic focus-workspace 2
alt + 4                 : komorebic focus-workspace 3
alt + 5                 : komorebic focus-workspace 4
alt + 6                 : komorebic focus-workspace 5
alt + 7                 : komorebic focus-workspace 6
alt + 8                 : komorebic focus-workspace 7
alt + 9                 : komorebic focus-workspace 8


alt + shift + 1         : komorebic move-to-workspace 0
alt + shift + 2         : komorebic move-to-workspace 1
alt + shift + 3         : komorebic move-to-workspace 2
alt + shift + 4         : komorebic move-to-workspace 3
alt + shift + 5         : komorebic move-to-workspace 4
alt + shift + 6         : komorebic move-to-workspace 5
alt + shift + 7         : komorebic move-to-workspace 6
alt + shift + 8         : komorebic move-to-workspace 7
alt + shift + 9         : komorebic move-to-workspace 8


alt + space             : komorebic cycle-layout next
alt + shift + space     : komorebic cycle-layout previous


alt + b                 : komorebic change-layout bsp
alt + g                 : komorebic change-layout grid
alt + u                 : komorebic change-layout ultrawide-vertical-stack

Output of komorebic check

PS C:\Users\haland> komorebic check
No KOMOREBI_CONFIG_HOME detected, defaulting to C:\Users\haland

Looking for configuration files in C:\Users\haland

Found komorebi.json; this file can be passed to the start command with the --config flag

Found C:\Users\haland.config\whkdrc; key bindings will be loaded from here when whkd is started, and you can start it automatically using the --whkd flag

@tieniu1 tieniu1 added the bug Something isn't working label Nov 23, 2024
@LGUG2Z
Copy link
Owner

LGUG2Z commented Nov 23, 2024

Likely an issue for egui which is what is handling all font rendering. I'll try and reproduce this with the fonts you mentioned soon 🤞

@LGUG2Z
Copy link
Owner

LGUG2Z commented Nov 23, 2024

The default font should either support Chinese characters or be replaced with a font that does

I'm open to suggestions for a monospace font which also supports Chinese characters!

@tieniu1
Copy link
Author

tieniu1 commented Nov 24, 2024

Likely an issue for egui which is what is handling all font rendering. I'll try and reproduce this with the fonts you mentioned soon 🤞

Thank you for your work. I tried YASB and found that "JetBrainsMono NFP" can display Chinese characters correctly. However, when I configured JetBrainsMono NFP in komorebi.bar, it still couldn't display Chinese. I hope this additional information can help you.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

No branches or pull requests

2 participants