|
Duplicate :
|
|
|
Relates :
|
|
|
Relates :
|
Download any Noto CJK Font and run this program against it
import java.io.File;
import java.awt.Font;
import java.awt.font.FontRenderContext;
public class SlowFontInit {
public static void main(String[] args) throws Exception {
String name = "NotoSansCJKjp-Regular.otf";
if (args.length > 0) {
name = args[0];
}
Font f = Font.createFont(Font.TRUETYPE_FONT, new File(name));
FontRenderContext frc = new FontRenderContext(null, false, false);
long t0 = System.currentTimeMillis();
f.getStringBounds(" ", frc);
long t1 = System.currentTimeMillis();
System.out.println((t1-t0)+"ms. "+ f.getFontName());
}
}
$ java SlowFontInit
1802ms. Noto Sans CJK JP Regular
Almost 2 seconds ..
|