uobikiemukot / yaft

yet another framebuffer terminal
MIT License
606 stars 43 forks source link

Cyrillic characters are not displayed #35

Closed alex3kov closed 5 years ago

alex3kov commented 5 years ago

Hi, thanks for making this great simple program freely available. Here's the file that I use to test Cyrillic symbols display in terminals:

~: file fonttest.txt 
fonttest.txt: UTF-8 Unicode text
~: cat fonttest.txt 
а б в г д е ё ж з и к л м н о п р с т у ф х ц ч ш щ ъ ы ю я
А Б В Г Д Е Ё Ж З И К Л М Н О П Р С Т У Ф Х Ц Ч Ш Щ Ъ Ы Ю Я

a b c d e f g h i j k l m n o p q r s t u v w x y z
A B C D E F G H I J K L M N O P Q R S T U V W X Y Z

When I do cat fonttest.txt in plain linux console (tty) - all characters are displayed. In yaft, there are just empty spaces in place of Cyrillic characters:

~: cat fonttest.txt 

a b c d e f g h i j k l m n o p q r s t u v w x y z
A B C D E F G H I J K L M N O P Q R S T U V W X Y Z

Cyrillic characters are also replaced with empty spaces in mutt and ranger. Here's my cmdline and /etc/vconsole.conf (in case it matters):

~: cat /etc/vconsole.conf 
KEYMAP=ruwin_cplk-UTF-8
FONT=ter-c18b
FONT_MAP=8859-5
~: cat /proc/cmdline 
BOOT_IMAGE=/boot/vmlinuz-linux-zen root=UUID=<UUID> rw quiet video=DP-1:1920x1080@144 fbcon=map:10 fbcon=font:VGA8x8

yaft claims UTF-8 support on main page, so why are Cyrillic characters not displayed? Is additional configuration needed?

uobikiemukot commented 5 years ago

Hi, thank you for using yaft 😄

yaft claims UTF-8 support on main page, so why are Cyrillic characters not displayed? Is additional configuration needed?

Yes, yaft can handle UTF-8 encoding and Unicode BMP glyphs. But only If built-in fonts includes Cyrillic glyphs, you can see the glyphs in your display. Unfortunately default fonts does not have Cyrillic glyphs.

Please try these steps:

  1. check out latest develop branch (need this commit: b5f7c1c46200c1c563b9810a14e086e3da05edee)
  2. export LANG=en_US.UTF-8 (or other UTF-8 variants)
  3. make mkfont_bdf
  4. ./glyph_builder.sh unifont
  5. then make yaft
alex3kov commented 5 years ago

Thanks, that works. Will you make that font built-in and default in a future release? Unicode is all over the place these days :)
My distro package just downloads your source release and runs make+make install on it: https://aur.archlinux.org/cgit/aur.git/tree/PKGBUILD?h=yaft

uobikiemukot commented 5 years ago

I'll change default fonts, If there are many of the same requests.

Currently yaft is including public fonts because I don't want to include GNU unifont in this repository due to its license. If default fonts changed to unifont, users must download unifont from internet. And upstream updates (download URL change or something) may break yaft's building process.

alex3kov commented 5 years ago

Are there other fonts with similar Unicode coverage, but with compatible license? Personally I don't care about unifont specifically - as long as Unicode (Cyrillic in my case) gets displayed in "default" yaft installation (download source release -> make -> make install). Having only ASCII by default is a bit odd in any given application in 2018 :)

On Sun, Nov 11, 2018 at 08:06:46PM -0800, uobikiemukot wrote:

I'll change default fonts, If there are many of the same requests.

Currently yaft is including public fonts because I don't want to include GNU unifont in this repository due to its license. If default fonts changed to unifont, users must download unifont from internet. And upstream updates (download URL change or something) may break yaft's building process.

-- You are receiving this because you authored the thread. Reply to this email directly or view it on GitHub: https://github.com/uobikiemukot/yaft/issues/35#issuecomment-437747101

uobikiemukot commented 5 years ago

Are there other fonts with similar Unicode coverage, but with compatible license?

For example, Terminus font ( http://terminus-font.sourceforge.net/ ) supports ISO-8859-5 (Latin and Cyrillic) and license is not GPL (SIL Open Font License).

Personally I don't care about unifont specifically - as long as Unicode (Cyrillic in my case) gets displayed in "default" yaft installation (download source release -> make -> make install).

I see.

Having only ASCII by default is a bit odd in any given application in 2018 :)

In fact, default font includes some non-ASCII glyphs (ISO-2022-JP). Usually programmer does not care about foreign language...(It's my fault, Sorry)

Only few fonts support Unicode widely (so unifont is very rare font). Maybe I should merge several fonts to satisfy all users' requirements without unifont.

Anyway I'll reconsider about default font.

alex3kov commented 5 years ago

Usually programmer does not care about foreign language...

I'm trying to replace X with yaft and CLI apps for general usage.

On Mon, Nov 12, 2018 at 12:04:05AM -0800, uobikiemukot wrote:

Are there other fonts with similar Unicode coverage, but with compatible license?

For example, Terminus font ( http://terminus-font.sourceforge.net/ ) supports ISO-8859-5 (Latin and Cyrillic) and license is not GPL (SIL Open Font License).

Personally I don't care about unifont specifically - as long as Unicode (Cyrillic in my case) gets displayed in "default" yaft installation (download source release -> make -> make install).

I see.

Having only ASCII by default is a bit odd in any given application in 2018 :)

In fact, default font includes some non-ASCII glyphs (ISO-2022-JP). Usually programmer does not care about foreign language...

Only few fonts support Unicode widely (so unifont is very rare font). Maybe I should merge several fonts to satisfy all users' requirements without unifont.

Anyway I'll reconsider about default font.

-- You are receiving this because you authored the thread. Reply to this email directly or view it on GitHub: https://github.com/uobikiemukot/yaft/issues/35#issuecomment-437789941

uobikiemukot commented 5 years ago

I merged terminus font into default font. Cyrillic symbols are displayed like this: https://github.com/uobikiemukot/yaft/pull/37#issuecomment-438538330

And this fix was merged into master branch.

alex3kov commented 5 years ago

It works, thanks!