Leun Kim's BlogWindy Odaiba

Others / Blog Tips

How to Use Different Fonts for English, Japanese, and Korean on a WordPress Blog

Blog TipsOthers

Translated from the Korean original. Read the original →

This post is also available in Korean.

If you blog on WordPress in a language that doesn't use the Latin alphabet, one of the first problems you'll hit is fonts. If you mostly write in just one language, it's not that hard to fix. But if your blog mixes several languages, giving each language its own font becomes a must.

When I first started my WordPress blog, I thought Korean text looked pretty unattractive, so I applied the NanumGothic font to the whole blog. Korean looked great after that, but now English looked bad. And Japanese too!

In this post, I'll show you a really simple way to set up "a different font for each language" on your blog (English, Japanese, and Korean here).

First, you need to download the fonts. Pretty much any font format should work, but I'll use three regular TTF fonts. I went with Tahoma for English, 07 Yasashisa Gothic for Japanese, and NanumGothic for Korean. You don't need to download Tahoma, though.
(07 Yasashisa Gothic download: http://www.fontna.com/blog/379)
(NanumGothic download: https://hangeul.naver.com/font)

(1) Upload the fonts you downloaded, using an FTP client or similar, to the folder on your server that contains style.css. Here's what that looked like for me:

http://www.leunkim.com/wp-content/themes/twentyeleven/NanumGothic.eot
http://www.leunkim.com/wp-content/themes/twentyeleven/NanumGothic.ttf
http://www.leunkim.com/wp-content/themes/twentyeleven/nihongo.eot
http://www.leunkim.com/wp-content/themes/twentyeleven/nihongo.ttf

Those are the paths I uploaded them to.

(2) Add the following code to your blog's header.php, or anywhere between <head> and </head>.

<style type="text/css" media="screen, print">
@font-face {
    font-family: nihongoeot;
    src: url(http://www.leunkim.com/wp-content/themes/twentyeleven/nihongo.eot);
}
    @font-face {
    font-family: ngeot;
    src:url(http://www.leunkim.com/wp-content/themes/twentyeleven/NanumGothic.eot);
}
</style>

Of course, put the path where you uploaded your own fonts inside src:url( ) so the right font gets loaded.

(3) Load the uploaded fonts in style.css as well. Specifically, add the following code near the top of style.css.

@font-face {
    font-family: nihongottf;
    src: url(http://www.leunkim.com/wp-content/themes/twentyeleven/nihongo.ttf);
}
@font-face {
    font-family: nihongoeot;
    src: url(http://www.leunkim.com/wp-content/themes/twentyeleven/nihongo.eot);
}
@font-face {
 font-family:ngttf;
 src:url(http://www.leunkim.com/wp-content/themes/twentyeleven/NanumGothic.ttf);
}
@font-face {
        font-family: ngeot;
        src:url(http://www.leunkim.com/wp-content/themes/twentyeleven/NanumGothic.eot);
}

The .eot files are for Internet Explorer, and the .ttf files are for every other browser.

(4) Finally, load the fonts wherever you want to use them. I wanted them across my whole blog, so I loaded them with font-family like this:

html, body, div, span, applet, object, iframe,
h1, h2, h3, h4, h5, h6, p, blockquote, pre,
a, abbr, acronym, address, big, cite, code,
del, dfn, em, font, ins, kbd, q, s, samp,
small, strike, strong, sub, sup, tt, var,
dl, dt, dd, ol, ul, li,
fieldset, form, label, legend,
table, caption, tbody, tfoot, thead, tr, th, td {
 border: 0;
font-family: Tahoma, nihongottf, nihongoeot, NanumGothic, "나눔고딕", ngttf, ngeot, dotum, "돋움", sans-serif;
 font-size: 100%;
 font-style: inherit;
 font-weight: inherit;
 margin: 0;
 outline: 0;
 padding: 0;
 vertical-align: baseline;
}

One thing to watch out for: the first font in the list, Tahoma, supports neither Korean nor Japanese. When that happens, a typical browser checks whether the next font in the list is available and tries to render everything Tahoma can't handle with that second font. Here the second font is 07 Yasashisa Gothic, which supports Japanese, so English shows up in Tahoma and Japanese in 07 Yasashisa Gothic. But 07 Yasashisa Gothic doesn't support Korean, so for anything that's neither English nor Japanese (Korean, in this case), the browser moves on to the third font. The third font I specified is NanumGothic, so all the remaining Korean text is shown in NanumGothic.

I tested this on my blog, and it worked really well in Firefox, Chrome, Safari, and IE10. In older versions of IE (around IE6?), though, English will still get Tahoma, the first font in the list, but the other languages may end up in the default Windows fonts. Below is what three languages in three different fonts look like with this method.

I write English with an English font.
僕は日本語は日本語のフォントで表します。
저는 한국어는 한글 폰트로 표현합니다.

* Convert TTF to EOT: http://ttf2eot.sebastiankippe.com

References
http://yiaong.egloos.com/4760266
http://heiswed.tistory.com/entry/%EB%B8%94%EB%A1%9C%EA%B7%B8%EC%97%90-%EB%82%98%EB%88%94%EA%B3%A0%EB%94%95-%EA%B8%80%EA%BC%B4-%EC%A0%81%EC%9A%A9%ED%95%98%EA%B8%B0

#WordPress fonts

More in Blog Tips

See all

Comments 0

    Leave a comment

    Your name and comment are shown on this page (private comments only to the blog owner). Your e-mail address is never shown.

    Back to top