[Function Request] dpg.create_viewport(title='xxx'),Utf-8 coding problem
monkeycc opened this issue · comments
monkeycc commented
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()
Unfortunately, the new version has not fixed this issue all along
Vladimir Ein commented
Duplicates #2261.