hoffstadt / DearPyGui

Dear PyGui: A fast and powerful Graphical User Interface Toolkit for Python with minimal dependencies

Home Page:https://dearpygui.readthedocs.io/en/latest/

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

[Function Request] dpg.create_viewport(title='xxx'),Utf-8 coding problem

monkeycc opened this issue · comments

Is your feature request related to a problem? Please describe.

import dearpygui.dearpygui as dpg

dpg.create_context()
dpg.create_viewport(title='我是中文', width=600, height=200)
dpg.setup_dearpygui()



with dpg.font_registry():
    with dpg.font(r"C:\Windows\Fonts\msyh.ttc", 20) as default_font:
        dpg.add_font_range_hint(dpg.mvFontRangeHint_Chinese_Full)
dpg.bind_font(default_font) # Binds the font globally


with dpg.window(label="我是**文字"):
    dpg.add_text("你好, 世界")

dpg.show_viewport()

# below replaces, start_dearpygui()
while dpg.is_dearpygui_running():
    # insert here any code you would like to run in the render loop
    # you can manually stop by using stop_dearpygui()
    print("this will run every frame")
    dpg.render_dearpygui_frame()

dpg.destroy_context()

微信截图_20220511003735

#1760

#1667

#2237

#2073

Unfortunately, the new version has not fixed this issue all along

Duplicates #2261.