emilk / emilk/egui

Enabling default_fonts changes wrapping behavior for some reason

Open
#3,485 0 comments 0 reactions 0 assignees View on GitHub
bug
Dominant language
Rust
Stars
30.6k
Forks
2.1k
Avg merge
1d 9h
Merged PRs (30d)
72

Description

**Describe the bug**

Enabling `default_fonts` feature changes text wrapping.

**To Reproduce**
Steps to reproduce the behavior:
1. Enable default_fonts.
2. Don't use them at all (i.e. replace the style's font definitions with your own, created using `FontDefinitions::empty`, i.e. not even calling default at all.)
3. Put buttons in a non-resizable side panel with a default width of 0 (i.e. static / unmoving sidebar)

**Expected behavior**
Nothing should change, as changing the default fonts shouldn't have any impact on my custom fonts?

But for some reason wrapping gets all weird for no reason.

**Screenshots**

https://github.com/emilk/egui/assets/4723091/cdd2e267-e8be-4d7b-a4c4-3cfb18f2a88e

**Desktop (please complete the following information):**
- OS: Microsoft Windows 11 Enterprise Insider Preview 10.0.25931 Build 25931

**Additional context**
egui doesn't seem to recognize any of the private-use-area symbols that are embedded in Inter, or even any of the other unicode icons. Anything that isn't ASCII seems to get replaced with a question mark, even if the font really does contain that character (confirmed by charmap). So as a workaround I'm trying to get at egui's bundled emoji fonts, which I know do work, but when I merely enable the default_fonts feature then this happens. Weird.

Contributor guide

Open the contributing guide

Research direction

Start by reproducing the behavior with the `default_fonts` feature, `FontDefinitions::empty`, custom font definitions, and buttons in a fixed-width side panel. Inspect how `default_fonts` and custom font definitions affect text layout and wrapping. Done means enabling bundled fonts no longer changes wrapping when they are not used, while the custom-font setup still works.

Written by the indexing model from the issue text.

Assessment

Tech stack
rust
Domain
frontend
Issue type
Bug
Difficulty
4/5
Estimated time
3-5 days
Activity status
Stale
Clarity
Mostly clear
Newbie friendliness
35/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.