hoffstadt / hoffstadt/DearPyGui

Custom fonts appear blurry on high dpi monitors

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

Description

Version: 1.0.2
Operating System: macOS 10.15.7
## My Issue

Custom loaded fonts appear somewhat blurry. This seems to be a regression from previous dearpygui versions 0.6 when loading fonts. I don't have a non high DPI monitor to check but @Pcothren mentioned he had seen this issue on high DPI but not regular monitors.

## Screenshots

![font_issue](https://user-images.githubusercontent.com/1454335/138878275-547f0aa4-adfd-4b3e-880b-da14fef23674.jpg)

I know it looks like a small issue, but the whole interface ends up looking slightly blurry. Even for larger fonts the edges are soft. Perhaps for the high dpi scaling non-integer scaling is happening? Oddly the horizontal direction seems to be more blurred than the vertical dimension.

## Standalone, minimal, complete and verifiable example

```python
import dearpygui.dearpygui as dpg
import dearpygui

dpg.create_context()

with dpg.font_registry():
# Download font here: https://fonts.google.com/specimen/Open+Sans
font = dpg.add_font("OpenSans-Regular.ttf", 15, tag="ttf-font"
)

with dpg.window(label="Fonts") as main_window:
dpg.add_text(default_value=f"DPG {dearpygui.__version__}: default font.")
dpg.add_text(default_value=f"DPG {dearpygui.__version__}: custom ttf font.")
dpg.bind_item_font(dpg.last_item(), "ttf-font")

dpg.create_viewport()
dpg.setup_dearpygui()
dpg.set_primary_window(main_window, True) # Should fill viewport but does not on macOS
dpg.show_viewport()
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.