Applying a fontface to a new TextLabel

I’m trying to apply a font to a newly created TextLabel. Here’s the line of code which used from a previous devforum post, however it does not appear to be working for me. Here’s the line of code in question:

TextLabel.FontFace =  Font.fromName("Fredoka One",Enum.FontWeight.Medium,Enum.FontStyle.Normal)

What can I do to make it so that the font is applied to the newly created textbox.

For more information, here's the block of code including the textlabel of which the font I am trying to change
 elseif receiptInfo.ProductId == 1658851386 then
        for _, p in pairs(players:GetPlayers()) do
            if p ~= player then
                if p.Character.HumanoidRootPart then
                    local explosion = Instance.new("Explosion")
                    explosion.Position = CFrame.new(p.HumanoidRootPart.Position)
                end
            end
            local TextLabel = Instance.new("TextLabel")
            TextLabel.Parent = p.PlayerGui.Default
            TextLabel.Text = player.Name .. " has nuked the server!"
			TextLabel.FontFace =  Font.fromName("Fredoka One",Enum.FontWeight.Medium,Enum.FontStyle.Normal)
			TextLabel.TextScaled = true
			TextLabel.Size = UDim2.new(0.25, 0, 0.25, 0)
			TextLabel.Position = UDim2.new(0.375, 0, 0.386, 0)
			TextLabel.TextColor3 = Color3.new(158, 0, 0)

            TextLabel.Visible = true

            wait(5)

            TextLabel.Visible = false
        end
3 Likes

This should be "FredokaOne"

3 Likes

I know this has already been solved, but consider using Enum.Font instead of spelling out font names individually so you can avoid this issue

2 Likes

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