Can't display Chinese in Slackware 9.0
After installing Slackware 9.0, I cannot reliably display Chinese under X (KDE). Some applications, like Konqueror and Hanzim display Chinese fine, but most, like Mozilla, instead display giant squares with hexidecimal numbers in them. I assume that this is a font issue but why would some programs work and others not? I am pulling my hair out over this. Please help.
Following up to my own post to add some more info. Mozilla works after removing the package that came with Slackware 9 and installing the copy from mozilla.org. For some reason, the one that comes with Slackware doesn't support Chinese.
But I still have the same problem in Pan that I had in Mozilla. Chinese newsgroups display nothing but squares with hex numbers in them. I downloaded and compiled Pan, but it still doesn't work. Does anyone know if it has to be compiled with special options?
Download and install the (kdei) package. It provides multi-lingual support in KDE apps.
What about our console tools, such as vim (or emacs)?
Does anyone know how to get vim to display chinese characters? I've tried the :set encode=big5 or whatever. Doesn't seem to work.
I'm thinking about serving some web pages with chinese characters, and it'd be nice to be able to edit with vim over a terminal and still understand the characters.
i posted some artical base on slackware 9,
or u can email me, i send u my document
The original problem in this thread existed because the programs that would not display Chinese correctly were set to use True Type fonts, and no Chinese True Type fonts come with Slackware 9.0. The programs that would display Chinese correctly were probably using Type 1 Chinese fonts (although I haven't checked into this). A good way to solve this problem would be to install some Chinese True Type fonts on your system. There are a few available for free at the GNU ftp site. To install these fonts on your system just unzip them and copy them to a subdirectory under /usr/share/fonts. It doesn't matter what you name it, but something like truetype or TTF would make sense. Also remember to make the fonts world readable (chmod +r *.ttf). Then reboot your system (or run fc-cache on the directory you made and restart X and/or the program you wish to use the fonts with). The same goes for any new True Type fonts that you wish to add to your system.
I am trying to fix the same problem with mozilla, but I need it to display Japanese fonts other than Chinese ones. Is there anybody who know where can I get free Japanese true type fonts? Thanks in advance :)
Thanks for your explanation on installing fonts, Rodrin.
Some of the easiest to find and extract, free Japanese True Type fonts are the ones from Microsoft. I found them at an Australian university ftp site. One is a serif font and the other is sans serif. I also found the serif font at a US university site.
for the full Windows install program or
for just the font by itself (probably what you want for Linux)
(full Windows install)
The only problem with the sans serif file is that it is a Windows executable CAB file (if I remember correctly; if not, the only other possibility is a self extracting zip file). You need to either open it with a Windows machine or get cabextract and use it to extract the ttf file among the Windows installation files (unless it is a zip; then you just need to use unzip).
Unionway also offers a free Japanese font, but I don't know of any way to extract it without using Windows (I haven't bothered to extract it yet myself). Here's the link anyway:
There is also an RPM of some Japanese True Type fonts along with RPMs for a bunch of other language fonts available from the Sisyphus project (Alt Linux). I haven't looked to see what fonts are actually contained in it. Here's the link:
These should get you started anyway. You can also add True Type fonts to the programs in Slackware that don't use fontconfig with the following steps:
1. From the command prompt as root change to the directory where you have put the fonts and run mkfontscale and mkfontdir. For example:
(the order of these mk commands is important, and I accidentally had them inversed before; sorry)
2. Add to your XF86Config file:
a) In the Modules section
Edit: You may alternatively want to use the xtt module rather than freetype on a primarily Japanese machine. I don't know if the xtt module will cause any problems with fontconfig enabled programs or not since I have never run xtt.
b) In the Files section, the FontPath to the True Type fonts. For example:
Installed Mozilla 1.4
Thanks a lot for your help, Rodrin! ;)
I followed your advice in installing the Japanese fonts and mkfontdir, mkfontscale, etc. But mozilla stopped working after that. It doesn't even allow me to start the program and exit immediately with an error 11. This is the version of mozilla that caused me a lot of problems.
Mozilla/5.0 (X11; U; Linux i686; en-US; rv:1.3) Gecko/20030313
So, I gave up and try installing the latest build from Mozilla.org, ie Mozilla 1.4 into a separate directory. Now I can see all Traditional Chinese, Simplified Chinese and Japanese fonts beautifully :)
One more question regarding truetype fonts. Can we simply copy truetype fonts from Windoz and use it in Linux? Are they the same for Windoz and Linux?
If Mozilla crashes after you install the fonts, then that usually means you forgot to give read permission to the font files you installed. I mentioned this in the earlier post about installing True Type fonts, but I failed to mention that it could cause Mozilla to crash if you forgot to do it. If you forget to do it, that will also make the fonts unavailable to other programs (programs that get their fonts from X Window may still be able to use them because of the permissions X is running with; I've never checked; but fontconfig enabled programs won't be able to use them). Just run, as root, in the font directory,
chmod +r *.ttf *.TTF
chmod 644 *.ttf *.TTF
(Edit: I accidentally had this as 744 and +x before. If you used either of those, you really should run it again with 644, or run it with -x so that these files aren't flagged as executable on your system.)
That should take care of the crashing problem. I recommend you try to get the Mozilla that comes with Slackware 9 working because, if you have good True Type fonts, the fonts look a lot better in the fontconfig enabled version of Mozilla than they do in the regular version. (For English language True Type fonts I highly recommend the Bitstream Vera fonts and/or the fonts that come with Windows.) The other steps I added about running mkfontscale, mkfontdir, and so forth are only to make True Type fonts available to other programs that don't use fontconfig (like the version of Mozilla you are using at the moment). They are not necessary for the fonts to work with the fontconfig enabled version of Mozilla that comes with Slackware 9.0, or other fontconfig enabled programs, like the GNOME that comes with Slack 9.
In answer to your last question, yes, True Type fonts in Linux are the same as True Type fonts in Windows. Apple True Type fonts are different, but it is possible to convert them for use in Linux or Windows, although I have never done this myself.
Thanks again, Rodrin. I have tried to make the fonts I installed world readable but it still doesn't work :( But I will try to find out if I have missed anything... and one more thing that I don't understand is the fontconfig thing. What is it and what does it do?
I finally repaired the original mozilla that comes with Slackware. Yeah, your are right, Rodrin. It does display fonts better :D
Btw, the cause of the problems is that: I forgot to make the truetype fonts I installed in /usr/X11R6/lib/X11/fonts/TTF world-readable.
Thanks again for your help, Rodrin. :)
That is strange. Perhaps, as you suggested, there is something you or I missed, or something I did not state clearly enough. When you say it still doesn't work, do you mean Mozilla still crashes? I am using that version of Mozilla (the one that comes with Slackware 9) successfully with the Microsoft True Type Japanese fonts, the Chinese True Type fonts from GNU's ftp server, as well as the Bitstream Vera fonts and Microsoft Core Fonts for the Web (along with a few other True Type fonts). Perhaps you could post more information about your setup, like the name of the directory you made for your new fonts along with its full path and whether or not you have GNOME installed and the fonts are working for it. You could also check to see if fc-cache is running on startup like it normally does in Slack 9 and whether or not you see a fonts.cache-1 file in your True Type directory.
Fontconfig is a new way of dealing with fonts in X Window. Generally it really simplifies things (in Slackware at any rate) as well as providing high quality font rendering with anti-aliasing. The description from their web site reads, "Fontconfig is a library designed to provide system-wide font configuration, customization and application access." The programs in Slack that support it look really good once you have the proper fonts installed. In Slackware 9 the hard part is done for you because /etc/fonts.conf and /etc/fonts.dtd are set up already. With the default configuration of Slack 9, installing new True Type fonts for fontconfig enabled programs is as simple as putting them in the correct directory and making them world readable. (Although, by what I've read, fontconfig also supports Type1 fonts, some of the programs that use it, like fontconfig enabled Mozilla, appear to support only True Type fonts) Then you just reboot, and the fonts.cache-1 file is updated automatically to reflect your new fonts. The only reason you still have to make fonts.scale and fonts.dir files and fiddle with XF86Config is to make the fonts available to those programs that don't yet support fontconfig. The fonts don't look as good in these programs, but many of these are moving toward fontconfig support. For example, versions of both AbiWord and the Gimp that support fontconfig are in development for their next major releases (if not sooner). During this transitional period, you have to set up your fonts both the old way that Slackware used up to 8.1 and the new way for fontconfig enabled software if you want all your programs to have access to them.
By the way, I will be away for a few days without Internet access after tonight, so if I don't reply right away, don't think I gave up and am ignoring you. I will try to remember to check back when I return. Also, don't feel obligated to follow my suggestions to get it to work the way I think it ought to if you are satisfied with the way you've gotten it to work already.
P.S. You posted the problem as solved while I was composing this. You may find some of the information useful or interesting anyway. I'm glad I was able to help.
You are really helpful, Rodrin. Thanks again for your detailed explanation :) I hope one day when I am no more a newbie I can help others, too, in the way you helped me. :)
Good luck :D
by the way,i still cannot use my keyboard to input the japanese language although i have configured my keyboard layout to 'japanese 106 key'.Can u tell me whats wrong and how i can fix it?:)
|All times are GMT -5. The time now is 03:55 PM.|