CypherpunkArmory / UserLAnd

Main UserLAnd Repository
Other
3.61k stars 400 forks source link

Unicode font issues in terminal #246

Closed franckrasolo closed 6 years ago

franckrasolo commented 6 years ago

Similarly to what has previously been reported against https://github.com/corbinlc/GNURootDebian/issues/93,

I cannot get patched Powerline fonts to display as expected in the terminal and associated editor.

Expected rendering (taken from vim-airline): vim-airline-demo

Actual rendering (on my Android device): screenshot

Device Information

Device: Samsung Galaxy Tab S3 Android Version: Oreo 8.0.0 UserLAnd Version: 0.3.4

lapsio commented 6 years ago

Unicode support is handled by your SSH client. Not by UserLAnd itself. Applications may improperly detect UTF support. Try to change $TERM environment variable in your .bashrc file. I'm using xterm-256color and UTF-8 fonts do work on my device.

franckrasolo commented 6 years ago

Hi @lapsio,

It seems unicode is indeed supported by the ConnectBot client used with UserLAnd. It is already set to use xterm-256color and so is my $TERM environment variable as you can see below:

env_term

I have also ensured that LANG and all LC_* environment variables are set to a UTF-8 locale:

locales

However I am unsure how to change the default font. I installed fontconfig in my user profile and configured it to select exactly three specific fonts:

fonts

As their respective names suggest, these pached fonts from https://github.com/ryanoasis/nerd-fonts are the most complete that I could find.

The above changes still did not yield the expected results. To further troubleshoot this, I printed the following to illustrate the issue:

unicode_characters

franckrasolo commented 6 years ago

Well, the only[1] solution to this problem actually turned out to be Termux[2] with openssh.

With Termux, not only am I able to select any given font from internal/external storage, but I can also customise the terminal colours declaratively.

For posterity, it may help others to know how I fixed this:

  1. install Termux
  2. install the OTF/TTF font(s) you want to use:
    mkdir -p ~/.termux
    cp -v /sdcard/Download/<selected-font>.[ot]tf ~/.termux/
    cp ~/.termux/<selected-font>.[ot]tf ~/.termux/font.ttf
    termux-reload-settings
  3. assuming the UserLAnd service is running:
    pkg install openssh
    ssh -p 2022 user@localhost

I now have a half-decent setup as illustrated below:

vim-airline tabline termux_vim-airline_tabline

vim-airline statusline termux_vim-airline_statusline

[1] To date, none of Termius, JuiceSSH, Connectbot, VX Connectbot allow the selection of fonts from internal/external storage.

[2] Over the past year, I had transitioned from Termux to GNURoot Debian to UserLAnd, so I didn't expect to be returning to Termux to solve this one.

naveedpash commented 5 years ago

@cypherpunk can you build the termux-styling app (https://github.com/termux/termux-styling) and sign it with the same key that you used to sign UserLAnd?

I think that will add all the font support for powerline fonts