How to view Chinese characters in SeaMonkey

Booting, installing, newbie
Post Reply
Message
Author
losl
Posts: 32
Joined: Sun 30 Jul 2006, 02:59
Location: BC CA

How to view Chinese characters in SeaMonkey

#1 Post by losl »

I am using PuppyLinux 2.01r2. SeaMonkey dose not display Chinese characters properly on all Chinese pages such as "http://hk.news.yahoo.com/". All characters are shown as small squares. I have "Chinese Traditional (Big5)", "Chinese Traditional (Big5-HKSCS), "Chinese Traditional (EUC-TW) and some Chinese Simplify options in "View/Character Encoding" but
NONE OF THEM works.

How could i display Chinese characters in SeaMonkey with 2.01r2? Please help, thank you very much!!


SLo

User avatar
Sit Heel Speak
Posts: 2595
Joined: Fri 31 Mar 2006, 03:22
Location: downwind

#2 Post by Sit Heel Speak »

Perhaps this page will give you a clue:

http://lists.freedesktop.org/archives/f ... 02308.html

Keith Packard is the maintainer of fontconfig, which is what Puppy uses to display fonts.

The file to put the <match>...</match> part in, is /etc/fonts/local.conf.

If you will tell me where I may obtain these fonts, then I will experiment with my own local.conf until I make the Yahoo Hong Kong news page display OK, and I will tell you what I come up with.
Last edited by Sit Heel Speak on Mon 31 Jul 2006, 06:47, edited 1 time in total.

User avatar
Sit Heel Speak
Posts: 2595
Joined: Fri 31 Mar 2006, 03:22
Location: downwind

#3 Post by Sit Heel Speak »

With these three fonts, from
ftp://ftp.freebsd.org/pub/FreeBSD/ports ... zh-moettf/

13,518 KB 13,842,688 May 02 2003 kai-pc.ttf
8,979 KB 9,194,491 Feb 26 2004 moe_kai.ttf
8,445 KB 8,647,174 Feb 26 2004 moe_sung.ttf

...the above three files were downloaded into /tmp and then moved into the same folder as the other .ttf files. Then an rxvt window started, changed directory into the TTF subdir, and issue

mkfontscale .
mkfontdir .
fc-cache -fv .
xset fp+ .

(EDITED: that last command should be

xset fp+ /usr/X11R6/lib/X11/fonts/TTF

)

and then the following was inserted just below the <fontconfig> line in /etc/fonts/local.conf:

(EDITED -- no, leave this section out. Yahoo Hong Kong displays in a much more well-laid-out manner if this section is omitted from local.conf)


<!-- Chinese font kai PC .ttf -->
<match target="font" ><test compare="eq" name="family" qual="any" >
<string>Kai PC .TTF</string></test>
<edit name="lang" >
<string>zh-hk</string>
</edit>
<test name="size" compare="more">
<double>7.5</double></test>
<edit mode="assign" name="antialias" >
<bool>true</bool>
</edit>
<edit name="hinting">
<bool>true</bool>
</edit>
<edit name="hintstyle" mode="assign">
<const>hintfull</const>
</edit>
</match>

and then restart X. NOTE: the above is with FreeType 2.1.10 compiled with the BCI interpreting function enabled.

Here is the result. I do not read Chinese, so I do not know if this is correct:
Attachments
Yahoo Hong Kong front page with kai pc .ttf.png
(186.36 KiB) Downloaded 1517 times
Last edited by Sit Heel Speak on Wed 09 Aug 2006, 06:56, edited 2 times in total.

losl
Posts: 32
Joined: Sun 30 Jul 2006, 02:59
Location: BC CA

How to view Chinese characters in SeaMonkey

#4 Post by losl »

Thank you!!

Your snapshot shows Chinese correctly. I will try follow your instruction.

BTW how to get a screen shot in Puppylinux 2.02? I tried the Windows's way (press the Print key) but no luck.

SLo

losl
Posts: 32
Joined: Sun 30 Jul 2006, 02:59
Location: BC CA

#5 Post by losl »

Sit Heel Speak wrote:With these three fonts, from
ftp://ftp.freebsd.org/pub/FreeBSD/ports ... zh-moettf/

13,518 KB 13,842,688 May 02 2003 kai-pc.ttf
8,979 KB 9,194,491 Feb 26 2004 moe_kai.ttf
8,445 KB 8,647,174 Feb 26 2004 moe_sung.ttf

...the above three files were downloaded into /tmp and then moved into the same folder as the other .ttf files.

I downloaded these ttf files(3). But can't find the folder(path) which stores the other .ttf files. Please tell me.

Sit Heel Speak wrote:Then an rxvt window started, changed directory into the TTF subdir, and issue

mkfontscale .
mkfontdir .
fc-cache -fv .
xset fp+ .
How to ISSUE these 4 lines? Are they commands? I tried to enter them in rxvt window one by one I got Bad command.

Thank you!!


SLo

User avatar
Sit Heel Speak
Posts: 2595
Joined: Fri 31 Mar 2006, 03:22
Location: downwind

#6 Post by Sit Heel Speak »

losl wrote:I downloaded these ttf files(3). But can't find the folder(path) which stores the other .ttf files. Please tell me.
/usr/X11R6/lib/X11/fonts/TTF in Puppy 2. You can find files by opening an rxvt window and issuing the command "gtkfind" --play with it some, you'll see how it works.

In Puppy 1, put new .ttf files wherever your symlink /root/.fonts points to.
Sit Heel Speak wrote:Then an rxvt window started, changed directory into the TTF subdir, and issue

mkfontscale .
mkfontdir .
fc-cache -fv .
xset fp+ .
losl wrote:How to ISSUE these 4 lines? Are they commands?
Yes, they are commands. The first three create reference files in the TTF subdir (font.scale, font.dir, and fonts.cache-1) and the fourth tells Puppy's font server to start using the new files just created.

Oops, my mistake, I should not say "open an rxvt window." Instead, I should say "right-click-on-white-space in the TTF subdir." You navigate to this subdir (/usr/X11R6/lib/X11/fonts/TTF) by using Start-File Managers-RoxFiler-click on the up arrow in upper left corner, to get to the topmost directory, then you left-click on the folder icons to descend through /usr and so forth.

When you get to the TTF subdir, open another RoxFiler window, go to where your downloaded fonts are, which should be /tmp, and drag-'n'-drop the .ttf files from /tmp into the TTF subdir. Then, right-click-on-whitespace in the TTF RoxFiler window. One of the entries in the dialog box is "Open an xterm window here." Xterm is like rxvt, a terminal window. Left-click "Open an xterm window here" and, voila!, an xterm window appears, with the /usr/X11R6/lib/X11/fonts/TTF subdir active. Then you proceed to issue the four commands given above. If it still doesn't work, then for some strange reason the executable files are missing on your installation, and we will have to take it from there.

Hope this helps...
Last edited by Sit Heel Speak on Mon 07 Aug 2006, 18:24, edited 1 time in total.

User avatar
Sit Heel Speak
Posts: 2595
Joined: Fri 31 Mar 2006, 03:22
Location: downwind

#7 Post by Sit Heel Speak »

Or, you can open an rxvt window and do everything without the mouse, directly from the command line:

mv /tmp/*.ttf /usr/X11R6/lib/X11/fonts/TTF
cd /usr/X11R6/lib/X11/fonts/TTF
mkfontscale .
mkfontdir .
fc-cache -fv .
xset fp+ /usr/X11R6/lib/X11/fonts/TTF

If this doesn't work, then either my memory is faulty or you are missing the executable files. Does anyone else see a fault with my strategy?
Last edited by Sit Heel Speak on Tue 08 Aug 2006, 21:17, edited 1 time in total.

losl
Posts: 32
Joined: Sun 30 Jul 2006, 02:59
Location: BC CA

#8 Post by losl »

Thank you for your step by step instruction!
It works now, I can view websites in Chinese after following your instruction. When enter mkfontscale . in rxvt i got message saying:
could't determine full name for kai-pc.ttf
could't get family name for kai-pc.ttf
It repeate dfor all 3 downloaded ttf files. But anyway SeaMonkey displays Chinese characters correctly.

Thank you again!!

SLo

BTW how could i capture the screen snapshot in Puppylinx? I tried the Windows's way (PrtScn key), it dose not work.

User avatar
Sit Heel Speak
Posts: 2595
Joined: Fri 31 Mar 2006, 03:22
Location: downwind

#9 Post by Sit Heel Speak »

losl wrote:Thank you for your step by step instruction!
Thank you for having the courtesy to say thank you. It is appreciated.

It is possible that it is not necessary to do the four-command sequence, in other words maybe Puppy will automatically find the new font and execute the necessary four programs. I was just reporting to you, what worked for me. Recently I've been studying how to make fonts look razor-sharp in Puppy, and so I have been studying Puppy's font setup program, which is fontconfig. This four-command sequence is standard with fontconfig for setting up new fonts in all Linuxes and Unixes. But I do not know whether Puppy auto-executes it on every boot.
losl wrote:BTW how could i capture the screen snapshot in Puppylinx? I tried the Windows's way (PrtScn key), it dose not work.
Start - Graphics something-or-other (I am stuck using Windows right now, I can't start Puppy to double-check) - and there is an entry at the bottom of the Graphics Utilities menu which says something like "Capture screen using MTPaint". You click this and, ten seconds later, the screen is captured and the capture comes up in MTPaint. You can then save this capture as a file, and even post it here to the forum as an attachment, but I recommend you first (before you save it) "alter the canvas size" down to where the image is no more than 700 pixels wide, so as to save forum space. You might save to your own computer first and then experiment with MTPaint or IrfanView until size is under 150kB.

It is possible to reduce the 10-second wait time, see the thread

http://www.murga.org/~puppy/viewtopic.php?t=9251

...and you can also use PrintScreen, like in Windows, if icewm is your window manager, see

http://www.murga.org/~puppy/viewtopic.php?t=9391

I would be curious to see a full-size (not reduced) screen capture from your machine, of the Yahoo Hong Kong front page. Mail one to my email address, if you still have it. If the fonts aren't razor-sharp, looking even better than in XP-with-ClearType-turned-on, then I may have some additional advice for you.

losl
Posts: 32
Joined: Sun 30 Jul 2006, 02:59
Location: BC CA

#10 Post by losl »

Sit Heel Speak wrote:I would be curious to see a full-size (not reduced) screen capture from your machine, of the Yahoo Hong Kong front page. Mail one to my email address, if you still have it.
I have a full screen capture of hk.yahoo.com in png format about 261K. When I attached it to a private mail for you i got "Attachment cannot be added, since the max. number of 0 Attachments in this post was achieved". How should i solve it?

Thank you!!

SLo

User avatar
Sit Heel Speak
Posts: 2595
Joined: Fri 31 Mar 2006, 03:22
Location: downwind

#11 Post by Sit Heel Speak »

Formerly, you could attach to private messages on the forum here, but it seems you can't nowadays. Send it to the email address from which I mailed you wkpup2x.

losl
Posts: 32
Joined: Sun 30 Jul 2006, 02:59
Location: BC CA

#12 Post by losl »

Sit Heel Speak wrote:Send it to the email address from which I mailed you wkpup2x.
Done, attachment is on its way.

SLo

User avatar
Sit Heel Speak
Posts: 2595
Joined: Fri 31 Mar 2006, 03:22
Location: downwind

#13 Post by Sit Heel Speak »

Received. It may be awhile, I am busy with work just now...

User avatar
Sit Heel Speak
Posts: 2595
Joined: Fri 31 Mar 2006, 03:22
Location: downwind

#14 Post by Sit Heel Speak »

I notice that the characters (brushstrokes) in your screen capture look hand-drawn, not computerized. The font is not one of the three which I downloaded, but rather one of the fonts you originally mentioned (Big 5, et cetera). The 4-command sequence must have activated these along with the three I had you (needlessly, it seems) download. Aside from the customized style settings, these hand-drawn-looking characters make your page look better than mine, regardless of whether mine looks razor-sharper or not. Can you tell me where I might obtain these fonts, so I can make a truly fair comparison?

User avatar
Sit Heel Speak
Posts: 2595
Joined: Fri 31 Mar 2006, 03:22
Location: downwind

#15 Post by Sit Heel Speak »

I have managed to find, download, and install the "AR PL ZenKai Uni" font. But your Yahoo Hong Kong page still looks better!

losl
Posts: 32
Joined: Sun 30 Jul 2006, 02:59
Location: BC CA

#16 Post by losl »

Sit Heel Speak wrote:I notice that the characters (brushstrokes) in your screen capture look hand-drawn, not computerized. The font is not one of the three which I downloaded, but rather one of the fonts you originally mentioned (Big 5, et cetera).... Can you tell me where I might obtain these fonts, so I can make a truly fair comparison?
My knowledge of Puppy (linux) is VERY VERY limited. I hope this helps.
Originally there is NO folder "TTF" in /usr/X11R6/lib/X11/fonts. I search for *.ttf and found nothing. After downloaded the 3 ttf files your mentioned i creates the folder TTF and put the 3 downloaded files in it. Then i run the 4
commands and inserted the lines into the local.conf. restared x then SeaMonkey displays Chinese correctly. Now there are only 3 downloaded ttf files in /usr/X11R6/lib/X11/fonts/TTF. Also there are no other TTF files in my system.


SLo
Attachments
tff.png
(138.3 KiB) Downloaded 677 times

User avatar
Sit Heel Speak
Posts: 2595
Joined: Fri 31 Mar 2006, 03:22
Location: downwind

#17 Post by Sit Heel Speak »

Remarkable! The secret must be in your newer video display adapter. Here is what it looks like on my machine:

User avatar
Sit Heel Speak
Posts: 2595
Joined: Fri 31 Mar 2006, 03:22
Location: downwind

#18 Post by Sit Heel Speak »

By contrast, here is what it looks like on losl's machine. I know this is a lot of bandwidth, but the difference is interesting. I can use the identical font set as losl, but I get worse results: the brush-strokes on his Chinese characters are crisper. And yes, before you all jump on me,..I do have the display parameters in xorg.conf, .Xdefaults, xwin, and font.conf all set correctly, as well as having the correct dpi in SeaMonkey...

seshomaru samma
Posts: 16
Joined: Mon 06 Nov 2006, 05:32

thank you &#35874;&#35874;

#19 Post by seshomaru samma »

I followed your guide to install Chinese fonts and it worked perfectly . Thanks!

User avatar
stiginge
Posts: 420
Joined: Thu 22 Mar 2007, 10:10
Location: Kerry, Ireland

#20 Post by stiginge »

I'm running puppy 2.14 and when I followed the above instructions, didn't have any success.

Downloaded and copied the ttf files to their correct location no problem.

Problem seems to be with commands
mkfontscale
mkfontdir
fc-cache -fv
xset fp+

when i entered mkfontscale into xterm with /usr/lib/X11/fonts/TTF open, got

couldn't determine full name for moe_kai.ttf
couldn't determine family name for moe_kai.ttf

similarly for other two ttf files

mkfontdir entered ok

fc-cache-fv command not found

xset fp+ entered ok

Post Reply