https://media.discordapp.net/attachments/396880245187280906/403049843028787200/Capture.PNG
font I'm using: http://www.1001fonts.com/octin-stencil-free-font.html
I have a local server setup and the code is clientside meaning its in lua>autorun>client
font IS in the resource folder
I have been trying this for TWO days and I have googled as much as I could. This is getting insanely frustrating.
I have tried multiple .ttf fonts and none of them are working. Please. Help.
[code]
surface.CreateFont( "Clocktower", {
font = "Octin Stencil Rg",
size = 100,
weight = 500
} )
local message = "My Text"
hook.Add( "HUDPaint", "HUDIdent", function()
surface.SetFont( "Octin Stencil Rg" )
surface.SetTextPos( ScrW()/2, ScrH()/2 )
surface.SetTextColor( 100, 100, 200, 125 )
surface.DrawText( message )
end)[/code]
When changing the font to Arial (and adding the font to the resource>fonts folder) I get this message:
https://imgur.com/a/5rKSc
I have been stuck on this for two days and all of the answers I've found are either half constructed or the links to helpful articles are no longer active.
surface.SetFont( "Clocktower" )
No.
https://imgur.com/a/QAKOD
and no.
surface.CreateFont
surface.SetFont
addons/clocktower/lua/autorun/client/cl_thepurge.lua:75
That line will be calling draw.SimpleTextOutlined. It's specifying "Arial" instead of the font name created using surface.CreateFont, much like what was going on in your snippet above.
Ah f*ck I could hug you. Thank your momma for you lmao
In conclucsion: surface.CreateFont was being used to create the font name "Clocktower" by designating the font as "Arial" or "Octin Stencil Rg"
My Error:
I was calling the name of the actual font with surface.SetFont instead of the custom fount I had created earlier with surface.CreateFont.
Fix:
Using the name of the custom font I created for the "SetFont" bits.
surface.CreateFont( "Clocktower", {
font = "Octin Stencil Rg",
size = 100,
weight = 500
} )
local message = "My Text"
hook.Add( "HUDPaint", "HUDIdent", function()
surface.SetFont( "Clocktower" )
surface.SetTextPos( ScrW()/2, ScrH()/2 )
surface.SetTextColor( 100, 100, 200, 125 )
surface.DrawText( message )
end)
Sorry, you need to Log In to post a reply to this thread.