When using the font. We often forget to pre-load TTF fonts into resource so that fonts cannot be used.
So it needs to be added in the following format after Resource.js. Use font-related content again
{
Type: "Font",
Name: "Thonburi",
srcs:["Res/fonts/thonburi.eot", "Res/fonts/thonburi.ttf"]
}
Used in code
var L = new CC. Labelttf ("After 3 seconds Grossini should move", "Thonburi", 16);
The usefulness of EOT and Woff,
With EoT and Woff, you can improve compatibility. Because not all browsers can support TTF. EOT is Microsoft's font format, and Woff is another commonly used Web font format. Some browsers only support Woff.
Both EOT and Woff can be converted from TTF, and there are free conversion tools on the Web.
can use CC. Labelttf to create.
Be sure to pre-load under Resource.js:
var g_resources = [
{
Type: "Font",
Name: "Thonburi",
srcs:["Res/fonts/gamefonts.ttf"]
}
];
Cc. Labelttf use note, TTF font use note