font_get_fontname


描述

With this function you can get the actual system name of the selected font asset. This function returns a string and not an index, and the name returned will depend on the font being used. For example, you may have a font asset called "fnt_Main" in the GameMaker Studio 2 resource tree, and the font itself may be the Windows system font Arial. In this case the function will return "Arial" as that is the system name of the font. Should you need the name as it appears in the resource tree, you should use font_get_name.


语法:

font_get_fontname(ind);


参数 描述
ind 待检测的字体索引。


Returns:

字符串


例如:

fnt_Name = font_get_fontname(font0);

The above code will get the system name of a font resource and store it as a string in the variable "fnt_Name".