WARNING: THIS SITE IS A MIRROR OF GITHUB.COM / IT CANNOT LOGIN OR REGISTER ACCOUNTS / THE CONTENTS ARE PROVIDED AS-IS / THIS SITE ASSUMES NO RESPONSIBILITY FOR ANY DISPLAYED CONTENT OR LINKS / IF YOU FOUND SOMETHING MAY NOT GOOD FOR EVERYONE, CONTACT ADMIN AT ilovescratch@foxmail.com
Skip to content

Conversation

@Bob-YsPan
Copy link

I add a load_fallback_list(list) function to let the user set up a fallback font list to apply the appropriate font for each platform.
If user do not use the load_fallback_list() function, it will apply the package's default fallback font list (current list is common fonts used for traditional Chinese system first, and Segoe UI font at the last).

The project that uses the forked package is bob_db5_toolbox_git. There are two images, the first is using the current sv_ttk package's theme and shows the ui with traditional Chinese texts:

05

The button's font seems not better when the text is displayed in Chinese, and this is the image using the forked package and with the fallback list starting with the Microsoft JhengHei UI(微軟正黑體) font:
Here is my project code's current main window creation code:

    root = tk.Tk()
    root.title(TEXTS["title"])
    root.geometry("800x450")
    # Load the fallback font list
    sv_ttk.load_fallback_list([
        "微軟正黑體",
        "Microsoft JhengHei UI",
        "蘋方-繁",
        "Noto Sans CJK TC",
        "Segoe UI"
    ])
    # Set default theme
    sv_ttk.set_theme("dark")

The image:

05_N

The font looks more better when applied the fallback font list, and if the program that run on the Linux that not have the Microsoft JhengHei UI font, it will select the Noto Sans CJK TC font at the fourth of the list.

And maybe users can applied the different font list when the system is at others language! (Not tested yet)

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

Successfully merging this pull request may close these issues.

1 participant