Skip to content
yaqinking edited this page Mar 7, 2017 · 2 revisions

From kirikiriz file format page

  • Original support font in System fonts folder.
  • The prerendered font use krkrfont export .ttf or .otf to kirikiri only .tft format font file. Then use Layer.font.mapPrerenderedFont("FILENAME") to use.
  • Use addFont.dll plugin to load .ttf .otf format font. Detail and usage see svn readme page.

The example to use addFont plugin in tjs. (KAG system)

// In Initialize.tjs Plugins.link place, put addFont.dll to plugins/ folder
Plugins.link("addFont.dll");

// put font file under data/
System.addFont("SourceHanSansCN-Normal.otf", true);

var layer = new Layer(kag, kag.fore.base);

with (layer) {
	.loadImages("test.png");
	.setPos(0, 0);
	.setSizeToImageSize();
	.font.face = "思源黑体 CN Normal";
	.font.height = "24";
	.drawText(0, 0, "中文显示测试", 0x000000);
	.visible = true;
}

Clone this wiki locally