• Custom DarkRP HUD - Can't get custom fonts working
    2 replies, posted
Obviously, I'm using darkrpmodifications for this. The font is stored in resource/fonts/AftaSans.otf - and it downloads fine with resource.AddFile("resource/fonts/AftaSans.otf") Then I use 2 files: cl_font.lua and cl_hud.lua I'm using surface.CreateFont to create the font in cl_font.lua: [CODE] surface.CreateFont( "AftasansUI", { font = "Aftasans", size = 20, weight = 100, blursize = 0, scanlines = 0, antialias = true, underline = false, italic = false, strikeout = false, symbol = false, rotary = false, shadow = false, additive = false, outline = false, }) [/CODE] No error messages of any kind are thrown when I call [CODE]draw.DrawText("Health: "..FullHP, "AftasansUI", HUD.PosX + 160 + HUD.BarWidth / 2, HUD.BPosY1 - 18, Color(0, 0, 0, 255), TEXT_ALIGN_CENTER, TEXT_ALIGN_CENTER)[/CODE] Despite this, the text stays in the default font (not sure what it is called). Any suggestions would be greatly appreciated.
Fonts are .ttf format, not .otf. Also, you resource.AddFile'd Afta[B]S[/B]ans, but called the font Aftasans.
The font name itself (when you open it in Windows) is "Aftasans". I'll try a truetype font right now and get back to you. [editline]3rd July 2014[/editline] Fixed. Thanks a ton code_gs.
Sorry, you need to Log In to post a reply to this thread.