Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[BUG] Nerdfont is not being properly rendered #735

Open
TonyDC opened this issue Jun 4, 2023 · 2 comments
Open

[BUG] Nerdfont is not being properly rendered #735

TonyDC opened this issue Jun 4, 2023 · 2 comments
Labels

Comments

@TonyDC
Copy link

TonyDC commented Jun 4, 2023

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 --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

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

image

termion

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

image

pancurses

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

image

crossterm

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

image

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
$ 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

@TonyDC TonyDC added the bug label Jun 4, 2023
@gyscos
Copy link
Owner

gyscos commented Jul 7, 2023

Hi, and thanks for the report!

It looks like ncurses is messing up the glyph width here. Not sure what we can do about it :(

We might starts defaulting to crossterm as a backend once I fix some remaining perf issues (essentially moving the buffered backend into cursive proper)

@mattfbacon
Copy link

Is this performance issue documented anywhere? It would be nice to know when deciding which backend to use.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

3 participants