diff --git a/lua/entities/gmod_wire_textscreen.lua b/lua/entities/gmod_wire_textscreen.lua index 9b01a3ec6a..efeeb440f8 100644 --- a/lua/entities/gmod_wire_textscreen.lua +++ b/lua/entities/gmod_wire_textscreen.lua @@ -230,10 +230,9 @@ function ENT:Setup(DefaultText, chrPerLine, textJust, valign, tfont, fgcolor, bg self.chrPerLine = math.Clamp(math.ceil(chrPerLine or 10), 1, 15) self.textJust = textJust or 1 self.valign = valign or 0 - self.tfont = tfont or "Arial" - self:SendConfig() - + self.tfont = tfont and string.sub(tfont, 1, 32) or "Arial" self:TriggerInput("String", DefaultText or "") + self:SendConfig() end function ENT:TriggerInput(iname, value) @@ -241,7 +240,7 @@ function ENT:TriggerInput(iname, value) self.text = string.sub(tostring(value), 1, 1024) self.doSendText = true elseif iname == "Font" then - self.tfont = tostring(value) + self.tfont = string.sub(tostring(value), 1, 32) self.doSendConfig = true elseif iname == "FGColor" then self.fgcolor = Color(value.x, value.y, value.z) @@ -279,7 +278,7 @@ function ENT:SendConfig(ply) self.doSendConfig = false - local font = string.sub(self.tfont, 0, 31) + local font = self.tfont local size = self.chrPerLine if not WireLib.CheckFont(font .. math.floor(760 / size), ply) then