Reproduction Steps
- Open Roblox Studio.
- Create a new Baseplate.
- Insert a ScreenGui on the StarterGui class.
- Inside the ScreenGui, add a TextLabel.
- Underneath the TextLabel, insert a LocalScript with the following code:
local TextLabel = script.Parent
local TextID = "rbxassetid://12187363887"
TextLabel.FontFace = Font.fromId(TextID, Enum.FontWeight.Heavy, Enum.FontStyle.Normal)
print(TextLabel.FontFace.Family)
Alternatively, you can directly set the font using the code below:
TextLabel.FontFace = Font.fromId("rbxassetid://12187363887", Enum.FontWeight.Heavy, Enum.FontStyle.Normal)
- Play the game and observe the output.
Expected Behavior
The Font.fromId() function should successfully retrieve the font specified by the “rbxassetid://” URL and set it as the font for the TextLabel. The output in the console should display the family name of the font.
Actual Behavior
The Font.fromId() function fails to retrieve the font when using the “rbxassetid://” format. The TextLabel retains its default font instead. The output in the console displays invalid argument #1 to 'fromId' (number expected, got string)
.
Additional Information
This bug occurs consistently when attempting to use the “rbxassetid://” format with the Font.fromId() function. The issue persists even when using valid asset IDs and attempting to retrieve fonts distributed through Roblox Studio’s Toolbox.
Issue Area: Studio
Issue Type: Display
Impact: Moderate
Frequency: Constantly
Date First Experienced: 2023-06-06 19:08:00 (UTC-3)
Date Last Experienced: 2023-07-09 01:45:00 (UTC-3)