emilk / emilk/egui

`SubMenu` arrow icon does not render without a supporting font

Open
#3,529 4 comments 3 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**
Sub menu items do not render their arrow icon if current fonts do not support the "⏵" glyph:
![Screenshot 2023-11-04 182958](https://github.com/emilk/egui/assets/12216742/d7ee0005-064e-45bf-ad06-a45c13996f1d)

Looking at egui code for `SubMenu`, it is indeed using the "⏵" glyph.
```rust
impl SubMenu {
fn new(parent_state: Arc>, text: impl Into) -> Self {
let index = parent_state.write().next_entry_index();
Self {
button: SubMenuButton::new(text, "⏵", index),
parent_state,
}
}
}
```

**To Reproduce**

Steps to reproduce the behavior:
1. Replace default fonts with custom fonts
2. Add a nested `ui.menu_button(...)`
3. Observe "?" being displayed instead of "⏵" on the submenu item

**Expected behavior**
The submenu arrow icon should be font-agnostic, like `CollapsingHeader` arrows:

![Screenshot 2023-11-04 184150](https://github.com/emilk/egui/assets/12216742/53020696-e1e0-4ff0-b237-f6357a8f21d2)

Contributor guide

Open the contributing guide

Research direction

Start by inspecting the `SubMenu::new` implementation and its `SubMenuButton`, then compare the submenu arrow with the font-agnostic arrows used by `CollapsingHeader`. Reproduce the issue with custom fonts and a nested `ui.menu_button(...)`; done means the submenu arrow renders without requiring the "⏵" glyph.

Written by the indexing model from the issue text.

Assessment

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

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.