WelcomeWelcome | FAQFAQ | DownloadsDownloads | WikiWiki

Author Topic: How to display chinese font in file manager?  (Read 748 times)

Offline lizardidi

  • Newbie
  • *
  • Posts: 14
Re: How to display chinese font in file manager?
« Reply #15 on: November 08, 2024, 11:41:57 PM »
@gadget42: of course a great shot! Taken with TCL 15!  ;D ;D

as attached is the test.txt file.

to @GNUser:
Quote
$ locale
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=

Quote
tc@box:~$ tce-status -i | grep font
Xorg-fonts
fontconfig
libXfont2
libfontenc
mononoki-ttf-fonts
notocjk-regular-fonts-ttc

Quote
tc@box:~$ tce-status -i | grep locale
getlocale
glibc_i18n_locale
libfm-locale
mc-locale
mylocale
pcmanfm-locale
rox-filer-locale

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

Quote
tc@box:~$ echo $G_FILENAME_ENCODING
iso8859-1

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!
« Last Edit: November 08, 2024, 11:47:20 PM by lizardidi »

Offline GNUser

  • Wiki Author
  • Hero Member
  • *****
  • Posts: 1499
Re: How to display chinese font in file manager?
« Reply #16 on: November 09, 2024, 07:59:11 AM »
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: [Select]
$ tce-load -wi unifont
$ G_FILENAME_ENCODING=UTF-8 pcmanfm
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.
« Last Edit: November 09, 2024, 08:06:30 AM by GNUser »

Offline gadget42

  • Hero Member
  • *****
  • Posts: 780
Re: How to display chinese font in file manager?
« Reply #17 on: November 09, 2024, 10:42:37 AM »
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.
The fluctuation theorem has long been known for a sudden switch of the Hamiltonian of a classical system Z54 . For a quantum system with a Hamiltonian changing from... https://forum.tinycorelinux.net/index.php/topic,25972.msg166580.html#msg166580

Offline Rich

  • Administrator
  • Hero Member
  • *****
  • Posts: 11594
Re: How to display chinese font in file manager?
« Reply #18 on: November 09, 2024, 02:14:28 PM »
Hi gadget42
... 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.

My guess would be this package that includes Simplified/Traditional Chinese fonts:
...
Quote
tc@box:~$ tce-status -i | grep font

 ----- Snip -----

notocjk-regular-fonts-ttc
...

Online polikuo

  • Hero Member
  • *****
  • Posts: 719
Re: How to display chinese font in file manager?
« Reply #19 on: November 10, 2024, 04:31:52 AM »
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.

Offline lizardidi

  • Newbie
  • *
  • Posts: 14
Re: How to display chinese font in file manager?
« Reply #20 on: November 11, 2024, 06:49:16 AM »
Big shoutout to everyone who helped me out! I reset my installation and have been fumbling around, trying other tcz. but your advice has been priceless. Seriously, thank you!