WelcomeWelcome | FAQFAQ | DownloadsDownloads | WikiWiki

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

Offline lizardidi

  • Newbie
  • *
  • Posts: 19
How to display chinese font in file manager?
« on: November 01, 2024, 10:15:33 AM »
Good day, TCL forum!

I have quite a few ebooks with chinese font file name. I already installed the flysung.tcz (correct me if misspelled)  and able to view chinese font fine in firefox.

However, in file manager those books name cannot display properly. I tried spacefm and Pcmanfm, the file appear as ??????.pdf.

Is there other .tcz i need to install in order to display them correctly?

My system is TCL 15 32bit on a intel atom netbook with 2 gb of ram.

Offline lizardidi

  • Newbie
  • *
  • Posts: 19
Re: How to display chinese font in file manager?
« Reply #1 on: November 01, 2024, 10:21:53 AM »
Sorry, what i meant is ? ? ? ? ?.pdf but it automatically turned into those emoji.

Offline Rich

  • Administrator
  • Hero Member
  • *****
  • Posts: 11670
Re: How to display chinese font in file manager?
« Reply #2 on: November 01, 2024, 10:51:55 AM »
Hi lizardidi
According to this:
http://ignorantguru.github.io/spacefm/spacefm-manual-en.html
there are a bunch of places for setting fonts. Open the manual
with your web browser and search for font.

Offline lizardidi

  • Newbie
  • *
  • Posts: 19
Re: How to display chinese font in file manager?
« Reply #3 on: November 01, 2024, 11:44:54 AM »
Hi lizardidi
According to this:
http://ignorantguru.github.io/spacefm/spacefm-manual-en.html
there are a bunch of places for setting fonts. Open the manual
with your web browser and search for font.

Thank you Rich!
Tried spacefm font option adjustments, unable to display chinese fonts.
I suspect this is not due to spacefm settings, because Pcmanfm also cannot display the file name correctly.

Maybe this is a system locale thing?

I tried to install getlocale.tcz then i set locale to zh_CN.UTF-8
Then i reboot and in terminal i type lang=zh_CN.UTF-8 ... Unsuccessful T.T




Offline GNUser

  • Wiki Author
  • Hero Member
  • *****
  • Posts: 1528
Re: How to display chinese font in file manager?
« Reply #4 on: November 01, 2024, 12:57:53 PM »
Pcmanfm also cannot display the file name correctly.

Hi lizardidi. I once had a similar issue, where I had loaded the fonts I needed and my locale was correct, but GUI file managers failed to display diacritical marks. For me what solved the problem was to add this:
Code: [Select]
G_FILENAME_ENCODING=@localeor this:
Code: [Select]
G_FILENAME_ENCODING=UTF-8to ~/.profile and reboot.
But before you try that, make sure your locale is correct by typing locale in a terminal.

Offline Rich

  • Administrator
  • Hero Member
  • *****
  • Posts: 11670
Re: How to display chinese font in file manager?
« Reply #5 on: November 01, 2024, 01:12:29 PM »
Hi lizardidi
This thread looks like it might be relevant, though it appears
to be a mix of Chinese and English so I can't read it:
https://forum.tinycorelinux.net/index.php/topic,4222.0.html

I also found this from polikuo:
I prefer unifont over fireflysung cause I've seen plenty of words missing with fireflysung.
However, unifont.tcz is slightly larger than fireflysung.tcz

Offline lizardidi

  • Newbie
  • *
  • Posts: 19
Re: How to display chinese font in file manager?
« Reply #6 on: November 03, 2024, 03:01:32 AM »
@Rich : Thanks for the referemce. That topic is about chinese input method. Whereas I just need to display chinese character file name... which is my pdf ebooks.

@GNUser : Tried your method, not working... However when I checked with 'locale' in terminal, it is LOCALE=C.. Which is weird.. I might have broken the Tiny Core system when I learn and trying lots of stuff here..For now I formatted the HDD and reverted to old system for daily chores.. Usually when I paste chinese .ttf font in /usr/share/fonts/ and restart X, the file name will display properly.. Will tinkering again next week.

Offline GNUser

  • Wiki Author
  • Hero Member
  • *****
  • Posts: 1528
Re: How to display chinese font in file manager?
« Reply #7 on: November 03, 2024, 03:45:17 PM »
when I checked with 'locale' in terminal, it is LOCALE=C
Hi lizrdidi. That's most likely the main problem. I think you'll have success if you follow these steps:

1. Load the extensions you need:
   tce-load -wi getlocale
   and either  tce-load -wi unifont  or  tce-load -wi fireflysung
   (note: I use TCL15 x86_64, which does not have fireflysung in the repo. Presumably your TCL version has it)
2. When prompted by getlocale, select your desired locale (zh_CN.UTF-8)
3. When getlocale is done, make sure it created /etc/sysconfig/tcedir/optional/mylocale.tcz
4. Make sure /etc/sysconfig/tcedir/onboot.lst contains this line (if this line does not exist in the file, add it):
Code: [Select]
mylocale.tcz5. If you see getlocale.tcz in /etc/sysconfig/tcedir/onboot.lst, it's okay to remove it
6. Add G_FILENAME_ENCODING=@locale to ~/.profile
7. Your bootloader entry for TCL has a linux line and an initrd line. The to the linux line you should add lang=zh_CN.UTF-8
My bootloader's TCL entry has this linux line, for example (UUID show below was edited for privacy):
Code: [Select]
linux /boot/vmlinuz64 tce=UUID="e473b991-b711-4ad0-bf79-d6aaaaabbbbb" opt=UUID="e473b991-b711-4ad0-bf79-d6aaaaabbbbb" tz=EST+5EDT,M3.2.0/2,M11.1.0/2 syslog lang=en_US.UTF-8 user=bruno
I think after all the above is in place, things will work as you expect after you reboot.
« Last Edit: November 03, 2024, 04:04:38 PM by GNUser »

Offline lizardidi

  • Newbie
  • *
  • Posts: 19
Re: How to display chinese font in file manager?
« Reply #8 on: November 07, 2024, 04:10:42 AM »
I tried all steps above. Indeed the system font of pcmanfm switched to chinese... But the filename is unable to display (??????.pdf)

Tried 3 fresh installation 32bit and 64bit.. Spacefm.. Pcmanfm.. Nnn... MC.. Emelfm.. Emelfm2... U named it, tried all of them all unable to display file name. Not only that, when you try to create a new file name with chinese characters, an error "invalid filename" will occur. I installed all the locale.tcz for these file managers. Browsers can display chinese fonts without problem.

ONLY on rox filer the filename will display correctly, not as some blocks or random code. So I guess I will stick to Rox filer is my only option on tiny core.


Offline gadget42

  • Hero Member
  • *****
  • Posts: 812
Re: How to display chinese font in file manager?
« Reply #9 on: November 07, 2024, 06:58:55 AM »
does anyone know how rox-filer displays this correctly? i have dug around and am here:

 https://github.com/rox-desktop/rox-filer/blob/dbc77943c043dba62d68f633757349c131d2fee8/ROX-Filer/src/Docs/Manual.xml#L2664

but it makes reference to "Open the Options box from the menu" then "Select a language from the list" then "Click on ok and restart the filer for the new setting to take full effect"

which "Options box" are they referring to?

full disclosure: i had the latest version of EasyOS at hand and knew it uses rox-filer so am currently on EasyOS LiveUSB and accessing /usr/local/apps/ROX-Filer/Help/Manual.html via chromium
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 GNUser

  • Wiki Author
  • Hero Member
  • *****
  • Posts: 1528
Re: How to display chinese font in file manager?
« Reply #10 on: November 07, 2024, 10:29:27 AM »
Hi lizardidi. I'm sorry to hear you're still having problems.

Today I loaded pcmanfm to see if I can reproduce your problem. I found that pcmanfm can handle chinese characters in filenames just fine. My tests were with pcmanfm as it comes "out of the box" without any special configuration.

I use a UTF-8 locale (specifically, en_US.UTF-8). If no unicode font is loaded, pcmanfm shows chinese filenames as little boxes with numbers (humorously referred to as "tofus"). But if I load a suitable font (e.g., unifont.tcz), close pcmanfm, and reopen pcmanfm, then the chinese filename displays correctly. See the "withoutfont.jpg" and "withfont.jpg" screenshots (attached).

Please, what's the output of these commands?

Code: [Select]
$ locale
$ tce-status -i | grep font
$ tce-status -i | grep locale
$ ls -lh /etc/sysconfig/tcedir/optional/mylocale.tcz
$ echo $G_FILENAME_ENCODING
« Last Edit: November 07, 2024, 10:44:58 AM by GNUser »

Offline lizardidi

  • Newbie
  • *
  • Posts: 19
Re: How to display chinese font in file manager?
« Reply #11 on: November 08, 2024, 04:35:49 AM »
https://ibb.co/jLkmmJQ

I attached my desktop here, showing Rox fm on the upper left displaying file name correctly. On the right, Pcmanfm.. Spacefm.. Xfe.. Mc.. Emelfm2... all unable to display the chinese font filename. Really weird behaviour.  :o :o :o

I only want to display filename correctly, without changing system language though..

« Last Edit: November 08, 2024, 04:38:12 AM by lizardidi »

Offline gadget42

  • Hero Member
  • *****
  • Posts: 812
Re: How to display chinese font in file manager?
« Reply #12 on: November 08, 2024, 05:23:21 AM »
@lizardidi, thanks for that great screenshot! it definitely provides clarification regarding what you are experiencing. still investigating at this end. rox-filer is _doing_something_ or _has_something_ that the others don't. but what? and naturally it will be simple once we figure it out...lol...sigh...

@GNUser, looking at your first screenshot you show the results of "locale" but in the second we don't get to see if that changes in any way after loading unifont.tcz?
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 gadget42

  • Hero Member
  • *****
  • Posts: 812
Re: How to display chinese font in file manager?
« Reply #13 on: November 08, 2024, 05:49:49 AM »
@lizardidi, could you attach your small(230b) test file "test****.txt" so i can use the exact same file for testing at my end? thanks.
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 GNUser

  • Wiki Author
  • Hero Member
  • *****
  • Posts: 1528
Re: How to display chinese font in file manager?
« Reply #14 on: November 08, 2024, 07:51:31 AM »
Hi gadget42. locale is the same in both screenshots.

Hi lizardidi. If you'd like to troubleshoot further, please post the output of the commands in my previous post. If you're happy with Rox and just want to move on, that's fine too :)