hoffstadt / hoffstadt/DearPyGui

Chinese characters in create_viewport title cant be displayed correctly

Open
#2,073 3 comments 2 reactions 0 assignees View on GitHub
state: pending type: bug
Dominant language
C++
Stars
15.6k
Forks
783
PR merge metrics
No merged PRs in 30d

Description

## Version of Dear PyGui

Version: 1.9.0
Operating System: Windows 10

## My Issue/Question
I have already set font_registry and bind_font, the Chinese in the text can be displayed normally, but the title is still garbled.
by the way, can I change the default font of dpg?

## To Reproduce

Steps to reproduce the behavior:
1. Just run the code below
2.The font simhei.ttf can be found in google.
## Expected behavior

I hope all the characters can be displayed correctly,thanks.

## Screenshots/Video

微信图片_20230405183736

## Standalone, minimal, complete and verifiable example

```python
import dearpygui.dearpygui as dpg

dpg.create_context()

with dpg.font_registry():
with dpg.font("simhei.ttf", 20) as default_font:
dpg.add_font_range_hint(dpg.mvFontRangeHint_Chinese_Full)
with dpg.font("simli.ttf", 20) as second_font:
dpg.add_font_range_hint(dpg.mvFontRangeHint_Chinese_Full)


with dpg.window(tag="Primary Window"):
dpg.add_text("Hello, 奇门遁甲")

dpg.bind_font(default_font)

dpg.create_viewport(title='奇门遁甲', width=600, height=200)
dpg.setup_dearpygui()
dpg.show_viewport()
dpg.set_primary_window("Primary Window", True)
dpg.start_dearpygui()
dpg.destroy_context()
```

Contributor guide

Open the contributing guide

Assessment

This issue has not been assessed yet.

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.