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

doesnt properly show unicode icons #2385

Open
nahid6970 opened this issue Apr 22, 2024 · 2 comments
Open

doesnt properly show unicode icons #2385

nahid6970 opened this issue Apr 22, 2024 · 2 comments

Comments

@nahid6970
Copy link

import customtkinter
button = customtkinter.CTkButton(root, text="\uf011", command=None, hover_color="#154223", border_width=1, border_color="red",font=("jetbrainsmono nf", 16, "bold"))
button.place(relx=0.5, rely=0.5, anchor=customtkinter.CENTER)

here it shows like this
image

@rigvedmaanas
Copy link

rigvedmaanas commented Apr 22, 2024

@nahid6970 CustomTkinter seems to have trouble displaying Unicode icons. I installed your font Jetbrainsmono too.

The result of your code in my machine:
Screenshot 2024-04-22 at 1 25 33 PM

I think it would be better for you to use Google's Material design symbols for icons. You can download the font from github and use it. You can find your desired icon from fonts.google.com and include the name of the icon as text.

Example Code:

button = customtkinter.CTkButton(root, text="power_settings_new", command=None, hover_color="#154223", border_width=1, border_color="red",font=("MaterialIconsOutlined-Regular", 16, "bold"))
button.place(relx=0.5, rely=0.5, anchor=customtkinter.CENTER)

Image:
Screenshot 2024-04-22 at 1 24 47 PM

Note: This is not a fix for the issue but an alternative

Hope this helps.

@nahid6970
Copy link
Author

nahid6970 commented Apr 22, 2024

yes its working also i found out that nerd font which consist
NF in the end for example VictorMono NF has the same issue but VictorMono NFP fixes it so i think fonts that has NFP or NFM at the end does not have this issues
its also working with JetBrainsMonoNL NFP too

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants