Skip to content
New issue

Have a question about this project? # for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “#”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? # to your account

Chinese character missing #351

Closed
rikrun opened this issue Dec 1, 2020 · 6 comments
Closed

Chinese character missing #351

rikrun opened this issue Dec 1, 2020 · 6 comments

Comments

@rikrun
Copy link

rikrun commented Dec 1, 2020

Version of DearPyGui:
[DearPyGui Version] 0.6.24
[Python Version] 3.8.1

OS
Operating System: Windows 10

My Issue/Question
Even if I tried use add_additional_font('simher.ttc', 16, glyph_ranges='chinese_simplified_common') to add Chinese font support but still have some of the words are displayed "?".
QQ图片20201201151830
QQ图片20201201152105
QQ图片20201201152205

To Reproduce
try to display a text with character "鸢尾花" in DearPyGui.

According to (https://www.joven.top/archives/192), glyph_ranges='chinese_simplified_common', this is to load only commonly used Chinese characters. It is the reference of 2500 Chinese characters on Wikipedia. However, the current number of commonly used Chinese characters is 3500, so there are 1000 not support. But in Dear ImGui this issue could be solved with io.Fonts->GetGlyphRangesChineseFull();.
QQ图片20201201152604

@iamdongge
Copy link

try:glyph_ranges='chinese_full'
But this leads to a huge memory usage.

@rikrun
Copy link
Author

rikrun commented Dec 1, 2020

try:glyph_ranges='chinese_full'
But this leads to a huge memory usage.

Many thanks. It turn out to be I didn't take a good read of the documentation:)

@rikrun rikrun closed this as completed Dec 1, 2020
@rikrun rikrun reopened this Dec 1, 2020
@rikrun
Copy link
Author

rikrun commented Dec 1, 2020

try:glyph_ranges='chinese_full'
But this leads to a huge memory usage.

Many thanks. It turn out to be I didn't take a good read of the documentation:)

Well, later on today, I tried use glyph_ranges='chinese_full' to get full load of Chinese characters. The bad news is that when I run the application the DearPyGui main window pop up with a white screen then maybe 5 seconds later it closed itself for some reason.

from dearpygui.core import *
from dearpygui.simple import *

add_additional_font('STSONG.ttf', 18, glyph_ranges="chinese_full")

def file_picker(sender, data):
    open_file_dialog(callback=apply_selected_file, extensions=".*,.py")

def apply_selected_file(sender, data):
    log_debug(data)
    directory = data[0]
    file = data[1]
    set_value("目录", directory)
    set_value("文件", file)
    set_value("文件路径", f"{directory}\\{file}")

show_logger()

with window("Tutorial"):
    add_button("文件选择器", callback=file_picker)
    add_text("目录路径: ")
    add_same_line()
    add_label_text("##filedir", source="目录", color=[255, 0, 0])
    add_text("文件: ")
    add_same_line()
    add_label_text("##file", source="文件", color=[255, 0, 0])
    add_text("文件路径: ")
    add_same_line()
    add_label_text("##filepath", source="文件路径", color=[255, 0, 0])

start_dearpygui()

@iamdongge
Copy link

There is issue #299 about some bug with file picker.
I also failed to set the title of main window with chinese, even the font was added.
I don't know why but the added font seems like just work with widgets.

@hoffstadt
Copy link
Owner

We will be replacing the file dialog system. This bug is in their library.

@hoffstadt
Copy link
Owner

Closing for now. This is on our todo.

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

No branches or pull requests

3 participants