views:

126

answers:

6

I'm building a website(PHP) with chinese fonts. The problem is most browsers doesn't have chinese fonts installed by default. I want the client machine to have this font installed to view the webpage.

How can I do this?

Edit:

I've partially solved the problem with this website : http://www.font2web.com/

it works in IE and FF but not in webkit browsers. Do i need to do some css hack for webkit browsers?

+1  A: 

http://alexandermp.com/post/2010/07/10/Your-favorite-custom-fonts-in-your-webpage.aspx

This page explains all known methods how to make fonts show on a client browser.

Alexander
Well.. yes, but does this sort the issue of asian characters once and for all as well? You never know what other problems there are with non-latin character sets...
Pekka
as long as the response transmits the codepage in the headers, it shouldn't really matter. If the customer has asian fonts, then the page is rendered correctly, but using these methods, you can either give the font to the client for this page alone, or render it using JS or other methods as described.
Alexander
+1  A: 

This might solve your problem http://www.css3.info/preview/web-fonts-with-font-face/ , font-face is allowed in css3, you don't need to install fonts on clients machine

Ninja Dude
Oops. ccs3 is not supported by not so old web browsers still to take into account in the market.
Ramon Araujo
+4  A: 

Most computers today have unicode fonts installed, so as long as you're HTML is encoded for your target language, you should be OK.

mkoistinen
Is there a statistic? I mean, I make pages compatible for IE6 because of some 4-6% of users. Is the number of users that don't have chinese fonts installed lower?
Alexander
I wouldn't know the stats, but I think this is less dependant on the browser, and more dependant on the OS and the set of installed fonts. Nearly all of the base fonts installed by modern OS'es are unicode though. If you were to stick to Arial, I'd say you'd do well.
mkoistinen
Yes, it's about the OS, and a lot of people still use Windows XP, which, by default, as I remember, doesn't have Chinese fonts installed. I even remember having trouble with Cyrillic fonts.
Alexander
It would really be interesting to get exact statistics on what fonts are installed by default on which OS.
Pekka
+3  A: 

You say most browsers don't have Chinese fonts installed. I beg to differ -- I don't generally browse chinese sites, but when I have done (or when there have been Chinese comments in an English forum), I've always seen the Chinese characters. Same goes for other scripts such as Russian.

Maybe there's more to it than that, but that has been my experience ever since Windows XP, including Windows 7 and also various Linux desktops.

In any case, I would say it's even more likely that anyone who can read Chinese would have the appropriate fonts installed. And anyone who can't read chinese probably won't affected by not having them render properly.

Spudley
I don't agree with the first two paragraphs: Windows XP and probably even 2000 still hold a notable market share. The last paragraph is a good point, though.
Pekka
A: 

Hi,

If you look in this link you will have a huge description of every charset you can use. Besides, sites like cn.china.cn use the following content type:

<meta http-equiv="Content-Type" content="text/html; charset=gbk" />

Just use this and you will have this rendered with no problem ;)

Hope that helps,

Ramon Araujo
+1  A: 

well, i updated my chrome to the latest version and this code:

@font-face {
    font-family: 'bloodrev';
    src: url('fonts/bloodrev.eot');
    src: local('?'), url('fonts/bloodrev.woff') format('woff'), url('fonts/bloodrev.ttf') format('truetype'), url('fonts/bloodrev.svg') format('svg');
    font-weight: normal;
    font-style: normal;
}

is all it takes to display my custom font in IE, FF and chrome. I've not tested in Safari yet.

Thanks for your replies and suggestions.

jest