Add feature allows user to set the fallback/customisable font list #154
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
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: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:
The image:
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 theNoto 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)