local P=import("\046\047\066\097\115\101\073\110\115\116\097\110\099\101")local F=import("\046\046\047\069\110\117\109\047\070\111\110\116")local d=import("\046\046\047\102\117\110\099\116\105\111\110\115\047\116\121\112\101\111\102")local K=import("\046\046\047\116\121\112\101\115\047\086\101\099\116\111\114\050")local f=P:extend("\084\101\120\116\083\101\114\118\105\099\101")function f.prototype.GetTextSize(e,P,f,Q,w)if d(P)~="\115\116\114\105\110\103"then error("\116\101\120\116 \109\117\115\116 \098\101 \097 \115\116\114\105\110\103",2)elseif d(f)~="\110\117\109\098\101\114"then error("\102\111\110\116\083\105\122\101 \109\117\115\116 \098\101 \097 \110\117\109\098\101\114",2)elseif d(Q)~="\069\110\117\109\073\116\101\109"and Q.EnumType~=F then error("\102\111\110\116 \109\117\115\116 \098\101 \097\110 \069\110\117\109\046\070\111\110\116",2)elseif d(w)~="\086\101\099\116\111\114\050"then error("\102\114\097\109\101\083\105\122\101 \109\117\115\116 \098\101 \097 \086\101\099\116\111\114\050",2)end local T=P:len()*f return K.new(math.min(T,w.X),math.min(f,w.Y))end return f
local BaseInstance = import("./BaseInstance")
local Font = import("../Enum/Font")
local typeof = import("../functions/typeof")
local Vector2 = import("../types/Vector2")

local TextService = BaseInstance:extend("TextService")

-- right now this is just a lazy [fontSize * len(text), fontSize] clipped by frameSize
function TextService.prototype:GetTextSize(text, fontSize, font, frameSize)
	if typeof(text) ~= "string" then
		error("text must be a string", 2)
	elseif typeof(fontSize) ~= "number" then
		error("fontSize must be a number", 2)
	elseif typeof(font) ~= "EnumItem" and font.EnumType ~= Font then
		error("font must be an Enum.Font", 2)
	elseif typeof(frameSize) ~= "Vector2" then
		error("frameSize must be a Vector2", 2)
	end

	local width = text:len() * fontSize

	return Vector2.new(math.min(width, frameSize.X), math.min(fontSize, frameSize.Y))
end

return TextService