Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Performance is very bad when set label with Thai text in Unity

I have a Button in a Canvas, and when I set text button with English text, it works correct, but when set with Thai text, it delays up to 6 seconds (bad performance).

First I thought it was because I load many sounds and images, but after removing all of them, it's still slow, and if I change my Thai text, it works fast.

Does anyone know how to fix this issue?

public Text text;

void Start () {

    text.text = "เพลงจิ้งจก";

}

I tried changing the font (Thonburi font), but no affect. So, my solution is change that text to image, which is a bad solution but cannot find any useful ways.

like image 701
Nguyen Tran Avatar asked Nov 13 '15 07:11

Nguyen Tran


1 Answers

Last version of Unity has some performance issue on asian font due frequent call of iphone::GetFontPath() in RequestCharactersInTexture

A possible solution is track all characters used on application (I have script that do it) and set a special font as custom set with all characters used.

It is very hard to maintain but boost performance.

like image 77
Klamore74 Avatar answered Nov 16 '22 13:11

Klamore74