Enum.Font DOES NOT Identify New Roblox Fonts

Reproduction Steps

Method A

  1. Open your Roblox Studio application;
  2. Select an existing/new Roblox Baseplate;
  3. Go to the Explorer tab and locate the service StarterGui;
  4. Once adding a Frame and a TextLabel, create a LocalScript underneath the TextLabel class and type the following code:
local TextLabel = script.Parent
TextLabel.Label = "Hello World!"
TextLabel.Font = Enum.Font.
  1. Type the newest fonts in the Roblox Studio engine it has on the Toolbox and you bought it (for instance, Codystar).

Method B

  1. Open your Roblox Studio application;
  2. Select an existing/new Roblox Baseplate;
  3. Go to the Explorer tab and locate the service StarterGui;
  4. While creating a simple interface with a little information, buy a new Roblox font located on the Toolbox tab;
  5. With the interface containing texts, replace their font with new ones you bought recently;
  6. Using a plugin that converts GUI over to Scripts/ModuleScripts, select the interface you developed and convert;
  7. Analyze the Script and primarily, the Enum.Font.

Expected Behavior

Expected that nothing would happen and I would move on to another part during a development of a project.

Actual Behavior

On the actual behavior, the Roblox Studio engine does not identify the new fonts and calls them as Unknown, breaking a few parts of the experience to locate exactly the font of the text:

1 Like

This is working as intended. The hardcoded font enum has been replaced with an asset ID based mechanism (similar to images, sounds, meshes) and new fonts are only available as asset IDs.

To work with new fonts from scripts, you’ll need to use the FontFace property and the Font data type instead.

To use Codystar in a script, you can do this:

TextLabel.FontFace = Font.fromId(12187363887)

This ID number can be obtained from the Toolbox by going to the … menu and clicking “Copy ID”. It can also be done from the Properties Panel by right clicking on one of the fonts in the dropdown and clicking “Copy ID”.

7 Likes

How about for cases when a developer would like to have a new font and uses the following steps as you provided, but also wants to have a specific Font Weight through LocalScripts? As I tried to make this, as it interconnects somewhat to the overall issue, it seems to be having errors and is not considered valid:

TextLabel.FontFace = Font.fromId(11702779517)
TextLabel.Weight = Enum.FontWeight.ExtraLight
18:53:10.986  Weight is not a valid member of TextLabel "Players.JuanGamerPlayz_RBLX.PlayerGui.ScreenGui.Frame.TextLabel"  -  Client - gui2lua #1:24
18:53:10.986  Stack Begin  -  Studio
18:53:10.987  Script 'Players.JuanGamerPlayz_RBLX.PlayerGui.gui2lua #1', Line 24  -  Studio - gui2lua #1:24
18:53:10.987  Stack End  -  Studio

You have to create a new Font user data and assign the FontFace to a reference of the user data.

Tried following up on your suggestion and it seems that it works, yet the problem is that it cannot find the last FontWeight (Black):

local font = script.Parent
local FontClone = Font.new("rbxassetid://11702779517", Enum.FontWeight.Black, Enum.FontStyle.Normal)
print(tostring(FontClone))

@Tiffblocks Is this also intended?

P.S. Thank you for the little tips, @Tiffblocks & @lolmansReturn overall!

The last one is actually named Enum.FontWeight.Heavy instead of Black. In the UI it shows differently because it uses the name that the font goes by, rather than the enum value.

1 Like

I believe this can confuse a few users whenever developing through scripts… In this sense, it would be proper if change the name Black to Heavy on the Properties tab to not make a mess. :sweat_smile: :pray:

6 Likes

I agree, it’s kind of odd how this isn’t consistent but I can see why.

This topic was automatically closed 14 days after the last reply. New replies are no longer allowed.