Jvanrhijn / polybar-spotify

🎶 Spotify artist and song module for Polybar
MIT License
583 stars 57 forks source link

Japanese characters doesn't show #25

Closed janleigh closed 3 years ago

janleigh commented 3 years ago

Title says it. Python version is 3.7. WM is i3-gaps.

Jvanrhijn commented 3 years ago

This seems to be an issue with the font you're using in Polybar. Have a look at https://github.com/polybar/polybar/wiki/Fonts, and let me know if you need any help getting it to work.

janleigh commented 3 years ago

Did it. Still not working.

ghost commented 3 years ago

dude any fix ?

Jvanrhijn commented 3 years ago

I cannot reproduce the issue on my end. If I set up polybar to use a font with Japanese glyphs, it displays the Japanese song titles just fine. If you could post your polybar config, I might be able to help out.

ghost commented 3 years ago

Here it is.

POLYBAR CONFIG :

[colors] background = #fa1e2137 foreground = #e3eaf3 primary = #02c084 secondary = #65a2d9 tertiary = #d07ef2 fourth = #e5c246 alert = #ed404c

[bar/main] width = 100%:-48 offset-x = 24 offset-y = 24

height = 36 radius = 0.0

override-redirect = true wm-restack = i3

background = ${colors.background} foreground = ${colors.foreground}

padding-left = 1 padding-right = 2 module-margin-left = 2 module-margin-right = 1

font-0 = Hack Nerd Font:pixelsize=11:antialias=true;2.5 font-1 = Hack Nerd Font:style=Regular:pixelsize=17:antialias=true;3

modules-left = i3 modules-center = xwindow modules-right = spotify audio wlan battery date powermenu

cursor-click = pointer cursor-scroll = ns-resize

[module/xwindow] type = internal/xwindow label = %title:0:25:...%

[module/filesystem] type = internal/fs interval = 25111 mount-0 = / label-mounted = %{F#0a81f5}%mountpoint%%{F-}: %percentage_used%% label-unmounted = %mountpoint% not mounted label-unmounted-foreground = ${colors.foreground}

[module/i3] type = internal/i3 pin-workspaces = false strip-wsnumbers = true index-sort = true enable-click = true enable-scroll = false wrapping-scroll = false reverse-scroll = false fuzzy-match = true

ws-icon-default = " " ws-icon-0 = "0;0 " ws-icon-1 = "1;%{T2}%{T-} " ws-icon-2 = "2;%{T2}%{T-} " ws-icon-3 = "3;%{T2}%{T-} " ws-icon-4 = "4;%{T2}%{T-} " ws-icon-5 = "5;5 " ws-icon-6 = "6;6 " ws-icon-7 = "7;7 " ws-icon-8 = "8;%{T2}%{T-} " ws-icon-9 = "9;9 "

format =

label-focused = %icon% label-focused-foreground = ${colors.fourth} label-focused-padding = 1

label-unfocused = ${self.label-focused} label-unfocused-foreground = #0a7383 label-unfocused-padding = ${self.label-focused-padding}

label-visible = ${self.label-focused} label-visible-foreground = #0a7383 label-visible-padding = ${self.label-focused-padding}

label-urgent = ${self.label-focused} label-urgent-foreground = ${colors.alert} label-urgent-padding = ${self.label-focused-padding}

[module/eth] type = internal/network interface = enp1s0 interval = 3.0

format-connected-underline = #55aa55 format-connected-prefix = " " format-connected-prefix-foreground = ${colors.primary} label-connected = %local_ip%

format-disconnected = ;format-disconnected = ;format-disconnected-underline = ${self.format-connected-underline} ;label-disconnected = %ifname% disconnected ;label-disconnected-foreground = ${colors.primary}

[module/backlight] type = internal/backlight card = intel_backlight

format =

[module/wlan] type = internal/network interface = wlp7s0 interval = 3.0

format-connected = format-connected-underline = #9f78e1 label-connected = "直" label-connected-foreground = ${colors.primary}

format-disconnected = format-disconnected-underline = ${self.format-connected-underline} label-disconnected = 睊 label-disconnected-foreground = ${colors.alert}

; a = worst ramp-signal-0 = a ramp-signal-1 = b ramp-signal-2 = c ramp-signal-3 = d ramp-signal-4 = e

[module/date] type = internal/date interval = 1

date = date-alt = "%b %d, %Y " time = "%I:%M" time-alt = "%H:%M:%S"

format-prefix-foreground = ${colors.#65a2d9} format-underline = #0a6cf5 label = %date%%time%

[module/audio] type = internal/pulseaudio

format-volume = label-volume-foreground = ${colors.secondary} ramp-volume-foreground = ${colors.secondary} label-volume = %percentage%%

ramp-volume-0 =  ramp-volume-1 =  ramp-volume-2 = 

label-muted = ﱝ label-muted-foreground = ${colors.secondary}

[module/battery] type = internal/battery battery = BAT0 adapter = ADP1 full-at = 100

format-charging = format-discharging =

label-full =  %percentage%% label-full-foreground = ${colors.fourth}

ramp-capacity-0 =  ramp-capacity-1 =  ramp-capacity-2 =  ramp-capacity-3 =  ramp-capacity-4 =  ramp-capacity-5 =  ramp-capacity-6 =  ramp-capacity-7 =  ramp-capacity-8 =  ramp-capacity-9 =  ramp-capacity-foreground = ${colors.fourth}

animation-charging-0 =  animation-charging-1 =  animation-charging-2 =  animation-charging-3 =  animation-charging-4 =  animation-charging-5 =  animation-charging-6 =  animation-charging-7 =  animation-charging-8 =  animation-charging-9 =  animation-charging-10 =  animation-charging-foreground = ${colors.fourth} animation-charging-framerate = 750

label-charging = %percentage%% label-discharging = %percentage%% label-discharging-foreground = ${colors.fourth} label-charging-foreground = ${colors.fourth}

[module/powermenu] type = custom/text format-spacing = 1 content =  content-foreground = ${colors.alert} click-left = bash ~/Scripts/rofi/launch.sh powermenu

[settings] screenchange-reload = true ;compositing-background = xor ;compositing-background = screen ;compositing-foreground = source ;compositing-border = over ;pseudo-transparency =true

[global/wm] margin-bottom = 20

[module/spotify] type = custom/script interval = 1 format-prefix = " " format =

janleigh commented 3 years ago

I just switched to an Arch-based distro and still same error. Cheese_Sat-21Nov20_20 02 where the original title should be https://open.spotify.com/track/0IEl6PAxLIueFQp08vq07B?si=KLT6cE3NRUqhKD7a5fOMHA

ghost commented 3 years ago

I'm waiting for @Jvanrhijn to reply. hopefully he can help.

Jvanrhijn commented 3 years ago

The issue is here:

font-0 = Hack Nerd Font:pixelsize=11:antialias=true;2.5
font-1 = Hack Nerd Font:style=Regular:pixelsize=17:antialias=true;3

Neither of these fonts contain the required glyphs. If I add the line

font-2 = HackGen:pixelsize=11;1

the song linked by @TheRealKizu displays just fine for me:

image

Of course, you'll have to install the font from your distro's repository. HackGen is available in the AUR for arch-based distros.

I'm closing this issue since the problem is not related to this script. Do let me know if you can't get the font to work.

ghost commented 3 years ago

Dude it worked. Thanks a lot.