gyscos / gyscos/cursive

[BUG] Nerdfont is not being properly rendered

Open
#735 2 comments 0 reactions 0 assignees View on GitHub
bug
Dominant language
Rust
Stars
4.8k
Forks
270
Avg merge
5d 19h
Merged PRs (30d)
2

Description

**Describe the bug**
When a glyph from a Nerdfont-patched font is used, the interface is not properly rendered for some backends.

**To Reproduce**
After cloning the repo, I added the following change:

```diff
diff --git a/cursive/examples/dialog.rs b/cursive/examples/dialog.rs
index c044205..695f0de 100644
--- a/cursive/examples/dialog.rs
+++ b/cursive/examples/dialog.rs
@@ -10,7 +10,7 @@ fn main() {
// Creates a dialog with a single "Quit" button
siv.add_layer(
// Most views can be configured in a chainable way
- Dialog::around(TextView::new("Hello Dialog!"))
+ Dialog::around(TextView::new("Hello Dialog! \u{f049d} "))
.title("Cursive")
.button("Foo", |_s| ())
.button("Quit", |s| s.quit())
```

And then I experimented with various backends:

### ncurses

```bash
cargo run --example dialog --features ncurses-backend --no-default-features
```

![image](https://github.com/gyscos/cursive/assets/11735628/b1260927-b2c6-4518-af57-1c8cb77c30b1)

### termion

```bash
cargo run --example dialog --features termion-backend --no-default-features
```

![image](https://github.com/gyscos/cursive/assets/11735628/4ca22b61-9f40-4e12-800e-a77400e3cc81)

### pancurses

```bash
cargo run --example dialog --features pancurses-backend --no-default-features
```

![image](https://github.com/gyscos/cursive/assets/11735628/11577fa0-2e74-4336-958f-ac99267e181d)

### crossterm

```bash
cargo run --example dialog --features crossterm-backend --no-default-features
```

![image](https://github.com/gyscos/cursive/assets/11735628/91cffba0-87da-4b00-a88b-9c3de4087719)

**Expected behavior**
All backends should have the same result as `termion`.

**Environment**
* Operating system used: macOS Ventura 13.4
* Backend used: all macOS supported backends were tested
* Current locale
```bash
$ locale

LANG=""
LC_COLLATE="C"
LC_CTYPE="UTF-8"
LC_MESSAGES="C"
LC_MONETARY="C"
LC_NUMERIC="C"
LC_TIME="C"
LC_ALL=
```
* Cursive version: git commit hash `30046dc563b3041092f0f0475ddf87a84eef25f9` (I used the `main` branch)

**Additional context**

- the terminal emulator used was iTerm 2 (Build 3.4.19)
- the font used was MesloMGS Nerd Font Mono
- this issue was created as a follow-up of an issue in `ncspot`: https://github.com/hrkfdn/ncspot/issues/1154

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.