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.
Argument Description ind Index of the font to check.
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".