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

RTL widget #34

Open
NZ62AN opened this issue Nov 7, 2024 · 2 comments
Open

RTL widget #34

NZ62AN opened this issue Nov 7, 2024 · 2 comments
Labels
info Improvements or additions to documentation question Further information is requested

Comments

@NZ62AN
Copy link

NZ62AN commented Nov 7, 2024

Hi,
Right-to-left texts are not displayed correctly in the label widget, but they work correctly in tkinter. I'll provide the codes for you.

Customtkinter:

    self.label = customtkinter.CTkLabel(self,
                                        text='پروفایل شماره 1',
                                        width=40,
                                        height=28,
                                        fg_color='transparent',
                                        anchor='e'
                                        )
    self.label.place(x=223, y=178)

Tkinter:

    self.label = tk.Label(self, 
                          text='پروفایل شماره 1', 
                          bg=self.cget("bg"), 
                          fg="white",
                          font=("TkDefaultFont", 12), 
                          anchor='e')
    self.label.place(x=223, y=178)
@Akascape
Copy link
Owner

Akascape commented Nov 7, 2024

@NZ62AN It is an issue with the font used, in customtkinter the default font is Roboto which lacks the RTL support.
So, you can simply change the font like this: font=customtkinter.CTkFont('', size=13) or through CTkDesigner font params.

@Akascape Akascape added info Improvements or additions to documentation question Further information is requested labels Nov 7, 2024
@NZ62AN
Copy link
Author

NZ62AN commented Nov 8, 2024

Thank you.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
info Improvements or additions to documentation question Further information is requested
Projects
None yet
Development

No branches or pull requests

2 participants