Determining Which Element to use for different Text Lengths

Hello, currently I am trying to design a radio system using text which supports upto 3 lines of text

I have different elements for each line size which all have a text size of 12 while this works it only does so on the screen size the UI is made for (1920x1080) and doesn’t work on some other screens as a result of how it works, how else could I do this

local line = LineSizes:FindFirstChild("3Lines"):Clone() -- Clone largest possibilty first
line.Text = message -- Set the message
		
if line.TextBounds.Y ~= 36 then -- Check if the bounds isn't that of a full 3 lines
	line:Destroy() -- Destroy last line type and then reclone below
    line = LineSizes:FindFirstChild("2Lines"):Clone()
	line.Text = message	
end
		
if line.TextBounds.Y ~= 24 and line.TextBounds.Y ~= 36 then -- Check if out of bounds for 2 and 3 lines
	line:Destroy() -- same as before
	line = LineSizes:FindFirstChild("1Line"):Clone()
	line.Text = message
end

If you need any more information I will be happy to provide it

Thanks in advance

You can access the screensize using the ViewportSize property of workspace.CurrentCamera. This should allow you to dynamically calculate the Y value of the lines (could be size.Y * 36/1080, or some other calculation)

Thanks, but that didn’t seem to work for me but lead me to think of another method but my problem is the TextFits property isn’t correct showing as false when it should be true, do you know how I could fix this?

If you know the label’s width you can use GetTextBoundsAsync to get Vector2 representing bounds of given text.