hoffstadt / DearPyGui

Dear PyGui: A fast and powerful Graphical User Interface Toolkit for Python with minimal dependencies
https://dearpygui.readthedocs.io/en/latest/
MIT License
12.94k stars 676 forks source link

UTF-8 font initialize incorrectly in window just aftrer dearpygui starts #981

Open yubeizhu opened 3 years ago

yubeizhu commented 3 years ago

Version of Dear PyGui

Version: after 0.8.0 Operating System: MacOS

My Issue/Question

When I use utf-8 font, and specify both "width" & "height" properties of a window, the font in that window will all be "question mark" just after dearpygui starts. In a short time, all fonts display normal.

To Reproduce

# Here's some code anyone can copy and paste to reproduce your issue
import dearpygui.dearpygui as dpg
with dpg.font_registry(  )  :
    f = "/tmp/SimSun.ttf"
    with dpg.font( file = f, size = 16, default_font = True   ):
        dpg.add_font_range_hint(dpg.mvFontRangeHint_Chinese_Full)

with dpg.window( label = "主窗口" ,height = 900, width = 300 ) as w_id:
  ...

dpg.start_dearpygui()

The font will be normal when I only specify one of "width" or "height".

# Here's some code anyone can copy and paste to reproduce your issue
import dearpygui.dearpygui as dpg
with dpg.font_registry(  )  :
    f = "/tmp/SimSun.ttf"
    with dpg.font( file = f, size = 16, default_font = True   ):
        dpg.add_font_range_hint(dpg.mvFontRangeHint_Chinese_Full)

with dpg.window( label = "主窗口" ,pos = [0,0], width = 300 ) as w_id:
  ...

dpg.start_dearpygui()

Thanks!

hoffstadt commented 3 years ago

Interesting issue. We will look into this and resolve it as soon as possible. Thank you for reporting.