Tiny Core Linux

Tiny Core Extensions => TCE Q&A Forum => Topic started by: starix on July 08, 2010, 09:28:21 AM

Title: How to setup cyrilic fonts?
Post by: starix on July 08, 2010, 09:28:21 AM
Micro Core Linux 3.x Alpha
Trying to get support of Russian lang, I did:
1) install kmap, glibc_gconv
2)
Code: [Select]
mkdir -pv /usr/lib/locale
localedef -i ru_RU -f ISO-8859-5 ru_RU
3) changed boot options to lang=ru_RU
4) changed /etc/profile = G_FILENAME_ENCODING=iso8859-5
5) backuped /etc/profile & /usr/lib/locale/locale-archive
6) reboot
7) sudo loadkmap < ru_win.kmap
Result: language seems to be changed ru Russian, BUT there is still no russian fonts...

(http://i8.fastpic.ru/big/2010/0708/a7/b47f98ad4ebca60eff634f05f46f1ca7.jpg)

but must be (this one on my router)

(http://i8.fastpic.ru/big/2010/0708/a8/8945b6e10b3e26be8793909df9b499a8.jpg)
Title: Re: How to setup cyrilic fonts?
Post by: Jason W on July 08, 2010, 09:59:25 AM
Do you have the dejavu-fonts-ttf.tcz package installed?

That may do it.
Title: Re: How to setup cyrilic fonts?
Post by: starix on July 08, 2010, 10:05:34 AM
not installed...
install, reboot => no changes
Title: Re: How to setup cyrilic fonts?
Post by: peterc on July 18, 2010, 02:19:04 PM
TrueType fonts won't work on the console, so installing DejaVu won't help the situation (unless you want to switch to X). What you need are console fonts that include Cyrillic; I haven't done it myself, but try installing the console-cyrillic fonts (http://ftp.de.debian.org/debian/pool/main/c/console-cyrillic/console-cyrillic_0.9.orig.tar.gz (http://ftp.de.debian.org/debian/pool/main/c/console-cyrillic/console-cyrillic_0.9.orig.tar.gz)). I'm a little unclear as to how to actually change the console font; it may be necessary to install console-tools (http://ftp.de.debian.org/debian/pool/main/c/console-tools/console-tools_0.2.3dbs-69.tar.gz (http://ftp.de.debian.org/debian/pool/main/c/console-tools/console-tools_0.2.3dbs-69.tar.gz)), since I can't see anything in the TC documentation on the subject.

Hopefully this will point you in the right direction; if it works, please tell us what you did.
Title: Re: How to setup cyrilic fonts?
Post by: peterc on July 18, 2010, 02:30:39 PM
I don't know if MicroCore looks at /etc/sysconfig/console, but looking at the documentation for LinuxFromScratch (http://www.linuxfromscratch.org/lfs/view/6.3/chapter07/console.html (http://www.linuxfromscratch.org/lfs/view/6.3/chapter07/console.html)), you may be able to use that to set the font and keymap.
Title: Re: How to setup cyrilic fonts?
Post by: curaga on July 19, 2010, 02:48:20 AM
Our busybox includes loadfont, which is setfont stripped down. You only need to grab one psf font from the cyrillic archive above, the rest isn't necessary.

Then run "sudo loadfont < /path/to/font.psf", first in the console to test out and then in bootlocal.sh (without sudo).
Title: Re: How to setup cyrilic fonts?
Post by: rodin.s on September 03, 2010, 05:03:51 PM
I know, it's not my topic but in my case it says:
Code: [Select]
tc@box:~$ sudo loadfont < Cyr_a8x16.psf
loadfont: KDFONTOP: Invalid argument

It says so under X, but in text mode font is loaded and I see Russian text until startx.
Title: Re: How to setup cyrilic fonts?
Post by: mountpeaks on December 29, 2011, 05:47:01 AM
I've experiencing the same problem.
Cyrillic issues track back to 2009!

Title: Re: How to setup cyrilic fonts?
Post by: curaga on December 29, 2011, 12:22:50 PM
@rodin.s, that is expected behavior, as the psf is a console font. Different fonts are needed for X apps (bitmap fonts for aterm and friends, TTF for gtk2/qt apps).
Title: Re: How to setup cyrilic fonts?
Post by: Scampada on March 30, 2015, 07:22:37 AM
Hi there one more time, yet in another thread. I've read it and tried to reproduce all actions needed to set cyrillic keymap (I need no locale, just want to be able to type in Ukrainian). So I have:
1. installed kmaps.tcz
2. made sudo loadkmap < /usr/share/kmap/qwerty/ua (in various combinations) [.kmap]
3. then sudo loadfont < /home/tc/console-fonts/pfs/ (various combinations of UniCyr, Cyr, etc.) [.psf]
4. Nothing happened except of that I could type plenty of ?????????? in the CLI. Then I tried to load yet another font from the folder above and started typing with blank symbols.
5. I tried to do it in reverse, that is, first I made loadfont and then loadkmap and gained no profit again.

I'm using pure CLI with graphics.KERNEL.

What's wrong?
Title: Re: How to setup cyrilic fonts?
Post by: Scampada on March 30, 2015, 08:21:49 AM
Even Links showed me cyrillic symbols when I tried Character set->KOI-8RU just for fun. But, its keymap lacks several symbols and even a dot, and when I type something in Cyr (in Links only), and then try to remove it with Backspace, the text pointer shifts right for the Cyrillic string length. Maybe some encoding issue. What encoding is default in TC? I'm not sure.

UPD: it's okay now, at least in Links. I changed to UTF-8 and now the string length doesn't double.
Title: Re: How to setup cyrilic fonts?
Post by: Scampada on March 30, 2015, 06:09:59 PM
I tried hard or, at least I tried, so after loadkmap and loadfont I could see Cyrillic symbols in the OUTPUT, but not when I typed them.
E.g. I typed and saw ???????, then I pressed Enter, the string was treated as a command and there were some output as: "/bin/sh: [NORMAL CYR SYMBOLS] : not found". I could also type in Cyrillic in Links setting Unicode UTF-8 in 'Character set' submenu.
Maybe for seeing Cyrillic symbols in typing I must set a relevant locale? But I don't want to see CLI output in my tongue; I want English there.
Also, when I tried to type in Cyrillic in vi, it was like I type one char and it prints a corresponding char and a space after it. Looked like "L o r e m  i p s u m . " Dunno what to do with that. I need Cyrillic in vi.
Title: Re: How to setup cyrilic fonts?
Post by: curaga on March 31, 2015, 04:33:19 AM
The locale has separate settings for language and various sub-options like dates, currency, paper, etc. You can change all but LC_MESSAGES to your locale and have messages still in English.
Title: Re: How to setup cyrilic fonts?
Post by: oeai on July 20, 2015, 01:38:24 PM
i found an interesting issue
i've installed kmaps and setup boot params
   
Code: [Select]
kmap=ruwin_cplk-UTF-8 ; # in file /tce/boot/extlinux/extlinux.conf boot linewhen i do
Code: [Select]
sudo loadfont ~/psf/UniCyr_8x16.psf  ; # in file /opt/bootlocal.sh  in terminal, then i can type with ???-???-???, but if i press enter after then i got раз-два-три (russian letters)
this also works with mcedit, but even better i can see letters with too much of space between, but after saving file i can read it normally
if i'm putting loadfont into opt/boot it doesn't work and i have to manually start it again,
but as for me, all i was needed just to type some texts in my olnb i think i'll make it work even without xorg now.

with xorg i've installed  xfonts, glibc2-locale base-locale, font-util, fontconfig, freetype, but all i needed to do was putting string
Code: [Select]
setxkbmap us,ru -option grp:caps_toggle & ; # in file ~/.xsession  
and it was working in geany and abiword, but i'd like to have xvesa, since there's not so much video ram
i'm fan of utf8, got it everywhere for compatibility

maybe some more tips any1?

there's an option that i found in gentoo, maybe that's the needed clue
Code: [Select]
DUMPKEYS_CHARSET="UTF-8"  ; # in etc/sysconfig/keymap but i don't know how to write it in sysconfig without some echo "" >> ././keymap command, so it was there before exec
Title: Re: How to setup cyrilic fonts?
Post by: oeai on July 20, 2015, 06:12:08 PM
they told me, that i'm sending a pair of bytes with my keyboard and stty interpret each byte as a symbol, because "stty -a" terminal probably built in one byte with key "-iutf8". to interpret it as unicode it should be "iutf8". - i don't know how t change it, all other clues and things i made including getlocale didn't get any success
also as a solution i found there's a program luit that kinda filters such things out, but i'm not sure on how's it works. i think that rebuild of terminal can help and will be more like true way
with setfont i've add a simpler string
Code: [Select]
  setfont -v Cyr-a8x16; # in /opt/boot script that boots neccesary font from /usr/local/share/consolefonts, also with -m there's an option to transliterate keys from one codepage to another, but it's not working because of "-iutf8" i guess. i'm not sure how to send one byte unicode from keyboard as well as i don't know how to properly build luit or stty i thik it's more like kernel stuff. Maybe that's just a switch to invoke stty, so it should be changed somewhere without recompiling.

http://man.he.net/man1/luit (http://man.he.net/man1/luit)
Title: Re: How to setup cyrilic fonts?
Post by: oeai on July 21, 2015, 03:58:58 AM
after getlocale cofiguring i got terminal strings of mc in russian, can read it, but it's not about command prompt

they told me that "readline" probably compiled without UTF-8 support or some mess in .inputrc
where's the .inputrc analog?
Title: Re: How to setup cyrilic fonts?
Post by: oeai on July 21, 2015, 06:57:59 AM
i've remade getlocale.sh to en_US.UTF-8 besides ru_RU.UTF-8
now i can switch between locales and type with mcedit \ nano normally, but vi got wrong spaces between letters as described before.
so it's partially solved, except Xvesa mode and maybe tty / vi support
Title: Re: How to setup cyrilic fonts?
Post by: bmarkus on July 21, 2015, 06:59:33 AM
Are you talking about the BusyBox applet vi or the mainsteram?
Title: Re: How to setup cyrilic fonts?
Post by: oeai on July 21, 2015, 07:05:52 AM
i didn't install it separately, so it's most probably yes - for busybox. then maybe that's the case of busybox some sort of utf-8 support?
Title: Re: How to setup cyrilic fonts?
Post by: oeai on July 22, 2015, 06:51:04 PM
well, yes, i found that in http://tinycorelinux.net/4.x/x86/release/src/busybox-1.20.2-config unicode wide chars and other related is not set and also in kernel-config no unicode support enabled

# CONFIG_INSTALL_NO_USR is not set
CONFIG_LOCALE_SUPPORT=y
# CONFIG_UNICODE_SUPPORT is not set
# CONFIG_UNICODE_USING_LOCALE is not set
# CONFIG_FEATURE_CHECK_UNICODE_IN_ENV is not set
CONFIG_SUBST_WCHAR=0
CONFIG_LAST_SUPPORTED_WCHAR=0
# CONFIG_UNICODE_COMBINING_WCHARS is not set
# CONFIG_UNICODE_WIDE_WCHARS is not set
# CONFIG_UNICODE_BIDI_SUPPORT is not set
# CONFIG_UNICODE_NEUTRAL_TABLE is not set
# CONFIG_UNICODE_PRESERVE_BROKEN is not set
Title: Re: How to setup cyrilic fonts?
Post by: Scampada on November 19, 2015, 06:59:52 AM
Hi.
I still got these problems.

0. I am not sure which codesets (I mean utf8, koi8-r etc.) my filenames are in.
1. ls inside a folder containing some kind of cyrillic filenames (see above for "why some kind") does: ?????????????????.mp3
2. mc showing this very folder usually lists: ??????????????????.mp3
3. Suppose I do something like mapfile [TAB] in this folder, substituting these ????????s as an argument.
3.1. The resulting command will look like: mapfile :\263\303\233\323\.... (not exactly, just e.g.)
3.2. The resulting output will look like: -bash: mapfile: `Киш Танец злобного гения.mp3' not a valid identifier.
#This mean my console is ABLE to output cyrillic!
4. After some magic with LC_ALL, LANG, LANGUAGE, mc had shown normal cyrillic filenames but only in one folder.
4.1 I had tried convmv in this folder but with no effect, I even hadn't actually renamed the files, doing only a dry run to test it. After that I noticed mc showed some filenames I ran convmv in another folder but mc hadn't showed it normally, so these actions I suppose are not linked between themselves.
5. vim wasn't working with cyrillic normally until I built it manually from git with utf8 support marked and packed as my own extension. Official nano doesn't do, too.

I will still reread this topic, but that's all of my issues. Maybe it's obvious to someone what to do, more than to me.
Title: Re: How to setup cyrilic fonts?
Post by: Scampada on November 19, 2015, 07:05:16 AM
Quote
3.1. The resulting command will look like: mapfile :\263\303\233\323\.... (not exactly, just e.g.)
Simply typing in console with cyrillic layout turned on will also turn into this. Moreover, typing some "рапрн" and getting ":\260\320\277\321\200\320\275" then pressing ENTER will end in totally nothing. No reaction at all. Just new PS string.

I do loadfont < terminus-u14.psf && loadkmap < ruwin_ct_sh-UTF8.kmap at start, having LANG=C.

If using /bin/sh (busybox's, not bash) then typing cyrillic will look like [no]?????????[/no] and pressing ENTER gives /bin/sh: вававав: not found
Title: Re: How to setup cyrilic fonts?
Post by: Scampada on November 25, 2015, 07:27:08 AM
Well, okay.
I've made it to get cyrillics almost everywhere in CLI. MC, console, nano, vim.

Added lang=uk_UA to boot options.
Exported LANG=uk_UA.utf8 to bash.
That's all, even nano stopped uglifying my texts (had to use vim instead, without knowing the way).
It was only ls who went on printing question marks. I thought that basic ls is implemented inside of busybox and grabbed coreutils from the repo. That one also didn't work. Even with all these lang variables etc. So I'd got to take coreutils sources and build em myself, now ls is working properly.
Are official coreutils built without some charset flags or something?..
Title: Re: How to setup cyrilic fonts?
Post by: Juanito on November 25, 2015, 07:57:08 AM
You can find the coreutils build instructions here:

http://repo.tinycorelinux.net/6.x/x86/release/src/toolchain/compile_tc6_x86
Title: Re: How to setup cyrilic fonts?
Post by: Scampada on November 25, 2015, 09:47:51 AM
Er... thank you, I will have a look at this document later, there are mentioned some interesting tricks about uname. But for coreutils - it was only ls that wasn't working properly, so I just built the source, got the new ls, stripped it, unsquashed the official extension and did a simple replace. Then packed it back again. Now it's working at last, whew.