In games we need to include all the character image as a rendered texture, and so it is a big problem for language like Chinese/Japanese where we have 20000 characters as opposed to English. Big texture is bad! So what’s the solution?

Use only kanji occurred in your game

This is a pain because you must write a post-processing tools to scan all text assets in the game and compile a list of possible kanji. Also if your game allows Japanese player to type Japanese language then you are doomed!

Use only frequently occurred kanji

To cover as many possible case as possible, a website like this has a kanji ranking by their frequency :

Kanji orderd by frequency of use -
Free PDF Kanji cards for download. Sorted lists of Kanji acording to your preferences along with Information for…

So it is a good idea to include a kanji from this list to try to cover everything…

Note that there is a thing called Jouyou kanji (regular use kanji characters)

Jōyō kanji - Wikipedia
The jōyō kanji (常用漢字, literally "regular-use Chinese characters") is the guide to kanji characters and their readings…

And here is the list

List of jōyō kanji - Wikipedia
The readings presented here are those noted in the official Jōyō table. Special readings and uncommon readings are…

It is up to you whether to use Jouyou or by-frequency list. But I don’t like the fact that the first one in that list is 亜 which I have never seen in “daily life” at all when I was in Japan.

Signed distance field rendering

Supposed we got 2000 characters to fit and we settle for 1024x1024 for all Japanese characters, the character is still too small! But we don’t want to go one step further to 2048x2048 because that’s quite large. (Adds 4MB to the game and adds considerable load time + RAM usage)

This paper by Valve “Improved Alpha-Tested Magnification for Vector Textures and Special Effects” describe a good method to render vector text by using raster texture.

The core idea is that we store a texture that looks strange and blurry, but those grey value has special meaning. And by the algorithm that calculate the distance of mid-grey pixel to brightest pixel etc… (please read it if you want to know this magic) we can get non-pixelated text rendering at any magnification!

Unity supports this in the form of TextMeshPro plugin that Unity acquired years ago. Now in UPM package!

(I have covered about SDF before but in Thai language)

Distance Field เทคนิควาด Font ให้คมในทุก Resolution ของ Valve แม้ขนาด Texture จะเล็ก
เมื่อวานนี้ผมได้ลงข่าวเรื่องที่ Text Mesh Pro ที่เป็น Plug-in สุดฮิตของ Unity ได้ถูก Unity…

Also read this excellent article about distance field in general

Signed Distance Fields Part 1: Unsigned Distance Fields
Welcome to the first blog post on It probably won't be all shaders, and probably not always fun, but I…

And so let’s do this

First I will show you that 512x512 is not enough even with all the magic of signed distance field rendering. I only include 500 most frequently used kanji in this texture + all hiragana, katakana.

The generated texture looks like this :

And when using it. I randomly copy texts from my Japanese Twitter account tweeted by real Japanese people :

As you can see the text looks like crap, but look at the magic of SDF rendering! Even if it looks like crap it wasn’t pixelated and looks vector-ish.

512x512 is 無理 and so we try 1024x1024 next

I have increased to cover 501–1000 frequently used kanji because we have much larger texture (4x) now.

Zoomed in, I think it in fact looked too good. And the test text is still missing a few kanji, so let’s try adding 1001–1500 kanji next.

You see it looks a lot crappier, but we get more coverage in 1024x1024 texture.

But wait! It looks quite good at smaller size :

This is because SDF rendering changes based on current scaling which affect the “distance field”, and it is doing quite well at small size!

Also I set a text padding too large at 5 pixels. With a lot of glyph like this changing form 5 to 2 pixels means a world of difference. (I estimated getting more than 200x200 pixels more from doing that, which could increase the clarity greatly or you could include more obscure kanji)

So if you want to use very large text but only rarely, you might make a separated texture for those and not a general purpose cover-it-all texture like this one. I am making a game with visual novel element so I have to be prepared for variety of texts but large size not required, so this texture is good to go for me.


1024x1024 is enough for 1–1500 frequently used kanji + all hiragana, katakana.

And for those who wants to copy this is my character list file :