Tiny Core Base > TCB Q&A Forum
How to display chinese font in file manager?
lizardidi:
@gadget42: of course a great shot! Taken with TCL 15! ;D ;D
as attached is the test.txt file.
to @GNUser:
--- Quote ---$ locale
--- End quote ---
--- Quote ---locale: Cannot set LC_CTYPE to default locale: No such file or directory
locale: Cannot set LC_MESSAGES to default locale: No such file or directory
locale: Cannot set LC_ALL to default locale: No such file or directory
LANG=en_US
LC_CTYPE="en_US"
LC_NUMERIC="en_US"
LC_TIME="en_US"
LC_COLLATE="en_US"
LC_MONETARY="en_US"
LC_MESSAGES="en_US"
LC_PAPER="en_US"
LC_NAME="en_US"
LC_ADDRESS="en_US"
LC_TELEPHONE="en_US"
LC_MEASUREMENT="en_US"
LC_IDENTIFICATION="en_US"
LC_ALL=
--- End quote ---
--- Quote ---tc@box:~$ tce-status -i | grep font
Xorg-fonts
fontconfig
libXfont2
libfontenc
mononoki-ttf-fonts
notocjk-regular-fonts-ttc
--- End quote ---
--- Quote ---tc@box:~$ tce-status -i | grep locale
getlocale
glibc_i18n_locale
libfm-locale
mc-locale
mylocale
pcmanfm-locale
rox-filer-locale
--- End quote ---
--- Quote ---tc@box:~$ ls -lh /etc/sysconfig/tcedir/optional/mylocale.tcz
-rw-rw-r-- 1 tc staff 1.5M Nov 7 02:47 /etc/sysconfig/tcedir/optional/mylocale.tcz
--- End quote ---
--- Quote ---tc@box:~$ echo $G_FILENAME_ENCODING
iso8859-1
--- End quote ---
As you all can see, do forgive me if the output is a total mess. As a seasoned Noob I can't completely recalled what else commands I throw at the terminal.
Thank you all very, very much for showing great patience in assisting me!
GNUser:
Hi lizardidi. Thanks for the additional information. I did some tests and this is the bare minimum that pcmanfm needs to show chinese characters in filenames:
1. a good enough font
2. G_FILENAME_ENCODING set correctly
This should work for you:
--- Code: ---$ tce-load -wi unifont
$ G_FILENAME_ENCODING=UTF-8 pcmanfm
--- End code ---
If you don't want to specify G_FILENAME_ENCODING=UTF-8 each time you run pcmanfm, you can either add export G_FILENAME_ENCODING=UTF-8 to your ~/.profile or create a wrapper script for pcmanfm.
P.S. I noted that your locale is not set correctly, but you don't need to fix that to fix your file manager issue.
gadget42:
latest report:
fresh TinyCorePure64-15.0.iso, good checksum, good dd to stick, booted on Lenovo Y580 laptop, mount stick with test???.txt file, no chinese font
connect to internet, loaded rox-filer-doc(no change naturally), loaded rox-filer(no change), loaded rox-filer-locale(no change...no chinese font)
all locale are "C"
tce-status -i | grep font reports fontconfig, libXfont, and libfontenc
tce-status -i | grep locale reports rox-filer-locale
so rox displaying chinese font doesn't originate in rox and/or it's dependencies, must be something else that was added.
it would be nice to figure out exactly which package is providing this functionality. we'll keep thinking and experimenting.
Rich:
Hi gadget42
--- Quote from: gadget42 on November 09, 2024, 10:42:37 AM --- ... so rox displaying chinese font doesn't originate in rox and/or it's dependencies, must be something else that was added.
it would be nice to figure out exactly which package is providing this functionality. we'll keep thinking and experimenting.
--- End quote ---
My guess would be this package that includes Simplified/Traditional Chinese fonts:
--- Quote from: lizardidi on November 08, 2024, 11:41:57 PM --- ...
--- Quote ---tc@box:~$ tce-status -i | grep font
----- Snip -----
notocjk-regular-fonts-ttc
--- End quote ---
...
--- End quote ---
polikuo:
Hi all
Looks like I'm late to the party.
Generally speaking, to display Chinese characters, you'll need:
1. glibc locale support (get_locale.tcz)
2. global variable (export LC_ALL=zh_CN.utf8 or in bootloader lang=zh_CN.utf8)
3. proper font package (unifont.tcz), note that unifont is designed for utf8, if you need special encoding such as big5 or gb18030, you'll need dedicated fonts. (zh_CN.big5)
4. BTW, you'll need file managers that were compiled with font-config support, TC packages tend to aim for the minimum, dropping that is possible. (pcmanfm-locale.tcz looks promising)
5. Configure the system so that it knows where to find the fonts (TC standards: /usr/locale/share/fonts), which normally automatically configured when the font is loaded. (tce-load -i fontconfig; fc-cache -fv)
I don't have any x86_64 TC computer around at the moment, so I could only guess the start up scripts need some fixing.
Navigation
[0] Message Index
[#] Next page
[*] Previous page
Go to full version