hoffstadt / hoffstadt/DearPyGui

Viewport name and input fields don't properly support Latin extended

Open
#1,564 3 comments 0 reactions 0 assignees View on GitHub
platform: Windows priority: high type: bug
Dominant language
C++
Stars
15.6k
Forks
783
PR merge metrics
No merged PRs in 30d

Description

Version: 1.3.1
Operating System: Windows 10 21H1

Keyboard layout: CES (Czech QWERTZ)
Code is saved with UTF-8 encoding.

## My Issue/Question

Creating a viewport that uses Latin extended characters causes them to become messed up.
Typing Latin extended characters into a text input field causes a similar issue, which doesn't appear when pasting the same range of characters or showing them as a default value.

## To Reproduce

Create a viewport that uses Latin extended characters, or type Latin extended into a text input field.
Pasting instead of typing into the input field does not trigger the issue.

## Expected behavior

Latin extended characters appear correctly, like when shown in a text field.

## Screenshots/Video

![image](https://user-images.githubusercontent.com/39402973/150682843-0c5c5956-bde5-41e4-8276-7a58b68b8524.png)
- The first input uses a default value, the second input has the same characters typed.
- The text is to demonstrate the font range is bound correctly.
- The viewport uses the same default value.

## Standalone, minimal, complete and verifiable example

```python
import dearpygui.dearpygui as dpg

test_text = "á č ď é ě í ň ó ř š ť ú ů ý ž Á Č Ď É Ě Í Ň Ó Ř Š Ť Ú Ů Ý Ž abcdefghijklmnopqrstuvwxyz"

dpg.create_context()

with dpg.font_registry():
with dpg.font("UbuntuMono-R.ttf", 15) as font1:
dpg.add_font_range(0x0100, 0x017F)
dpg.bind_font(font1)

with dpg.window(label="Input window", width=1000, height=500):
dpg.add_input_text(default_value=test_text)
dpg.add_input_text()
dpg.add_text(default_value=test_text)

dpg.create_viewport(
title=test_text,
width=1280,
height=720)

dpg.setup_dearpygui()
dpg.show_viewport()
dpg.start_dearpygui()
dpg.destroy_context()
```
Ubuntu font can be downloaded here: https://design.ubuntu.com/font/
The same issue can be observed with GNU Unifont (to prove it is not font-specific): https://unifoundry.com/unifont/index.html

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.