CTKLabel configure with Chinese string issue #153
Replies: 14 comments 1 reply
-
Hello. Can you post the string itself and not an image, please. TY! |
Beta Was this translation helpful? Give feedback.
-
I will create some tests. By the way, did you added a blank space before the word ? I'm only curious about the result. |
Beta Was this translation helpful? Give feedback.
-
The string is "沒有選擇檔案". |
Beta Was this translation helpful? Give feedback.
-
Whether I add a blank or not, I will get the same result. |
Beta Was this translation helpful? Give feedback.
-
I've tested this, and it works (Can you try please) : import customtkinter
import tkinter
class TestApp(customtkinter.CTk):
def __init__(self, str_to_test):
super().__init__()
self.num_of_frames = 0
# self.state('withdraw')
self.title("Webcam sample")
self.geometry("800x600")
self.create_ui(str_to_test)
def create_ui(self, str_to_test):
self.main_frame = customtkinter.CTkFrame(self)
self.main_frame.pack(fill="both", expand=True)
self.label_with_chinese = customtkinter.CTkLabel(self.main_frame, text=str_to_test)
self.label_with_chinese.pack(fill="both", expand=True)
str_with_issue = "沒有選擇檔案"
app1 = TestApp(str_with_issue)
app1.mainloop()
str_without_issue = "你好我是 个有趣的标签"
app2 = TestApp(str_without_issue)
app2.mainloop() Right now I'm using Garuda Linux 64. |
Beta Was this translation helpful? Give feedback.
-
In regular tkinter, it works correctly. -- coding: utf-8 --import customtkinter class TestApp(customtkinter.CTk):
str_with_issue = "沒有選擇檔案" str_without_issue = "你好我是一個有趣的標簽" app2.mainloop() |
Beta Was this translation helpful? Give feedback.
-
What is the name of the font that you are using? I will try to install on my side. Then, I'll create a test with it. |
Beta Was this translation helpful? Give feedback.
-
If you used the code I edited, it will display"新細明體(PMingLiU)" in Chinese Windows 11. |
Beta Was this translation helpful? Give feedback.
-
I have another computer is Windows 11 too. but I modifyed it's default font to "微軟正黑體(Microsoft JhengHei)" |
Beta Was this translation helpful? Give feedback.
-
Hello. I installed both fonts and unfortunately I didn't encounter any problems again. But this problem is not happening with my pc because I don't use Windows. So I really think someone else with a Windows OS should help you out. This is frustrating, but I don't know what else I can do to help you. |
Beta Was this translation helpful? Give feedback.
-
Do you mean this code is working fine under Linux? I'm curious how this works under Linux. |
Beta Was this translation helpful? Give feedback.
-
Just want to say thank you :) |
Beta Was this translation helpful? Give feedback.
-
No, at least in the past, it wasn't something possible. Now it's, since CTkLabel implemented the method configure at line 103 inside the file CustomTkinter/customtkinter/widgets/ctk_label.py. Everytime I needed to use configure I called like this: |
Beta Was this translation helpful? Give feedback.
-
For me this: "沒有選擇檔案" works fine with normal tkinter and customtkinter on macOS and Windows 10, so I will move this to discussions... |
Beta Was this translation helpful? Give feedback.
-
Hello, If I configure CTKLabel with Chinese string, it will not show all the text.
Like the follow picture:
Correct Label will behave like:
hope you can fix it!
Sincerely.
Beta Was this translation helpful? Give feedback.
All reactions