How to fix text scaling?

Why does my text scale from this:

to this when i use a new screen size:

here is the properties btw
image

and the explorer:
image
image

it is not scaling properly, i want it to be like the high res but just smaller.

1 Like

This is due to the “TextScaled” property. If you want to limit your texts size then you can try using the UITextSizeConstraint.

2 Likes

RichText lowers text’s resolution
that be might issue ?

you can use AutomaticSize instead of TextScaled
or both

But are you using Richtext for Color change like this ?
Wordswords

Yeah im using richtext to change the text colour. not in the example image but yeah + im using UITextSizeConstraint as u can see in the images but i may try to use it without textscaled enabled

as you can see in the image im using it, i now tried disabling textScaled but the text just goes even worse

1080p

other resolutions:

this is with UITextSizeConstraint and TextScaled Disabled

update: looks like this only happens on 1080p, i put all the other resolutions and they all look the same, the only one that is not working is on 1080p, and I designed the UI on that res…

Maybe try using UIPadding on the TextLabels instead of UITextSizeConstraint? It works with TextScaled. UIPaddings adjust the borders of GUIs, including text. It has 4 properties; the up, down, left, and right borders, all with UDim values which is the 1D version of UDim2.

2 Likes

nothing seems to work. i think the roblox text scaling is not well implemented :confused:

Roblox’s text size has a cap of 100. Maybe that’s the problem?

Apologies, seems like I didn’t see it.

Also, just a question. What are you really trying to achieve? I am having a hard time grasping your question here.

2 Likes

OP is using RichText which increases the text size cap. So it’s not a problem.

1 Like

Does all of the UIs have bigger scale on the bigger screen or is it just the text? Roblox adjusts the DPI scale of UIs on larger screens. On a retina display iPhone for example, they increase the UI grid size per pixel (or dots per inch, or any terms used to describe the division of resolution by grid size) to prevent UIs from being very small since 4K does not mean larger physical screen. You can adjust this in the windows executable properties window or by using Roblox’s fast-flags to disable DPI scaling. Also, this could be caused by the device emulator since the presets on the device emulator have DPI scaling built-in, for example on the iPhone 14 emulator. If this is also not the problem, then I have no more ideas to how this could be happening.

Im trying to fix this:

any res 1080p or higher:

any resolution less than 1080p:

I think the problem here may be the UITextSizeConstraint since I’m using textScaled and I’m limiting it to 35, so 1080p does not scale higher but less than 1080p is scaling to the max the text can do on the text label. I’m limiting the text size with that but only works for high-res. I want to know how to resize the textbox to any device the same. also sorry for my English, ik its very bad

Ah, I understand your issue better now!

For this, there are a few ways:

  • Ensuring the text label uses the scale size unit.
  • Using UIPadding to make the text a bit smaller.
  • Using scripts to size the text yourself.
    Something like:
local sizeOn1080 = 32
local diagonalDefaultSize = 2203
local screenSize = Camera.ViewportSize.Magnitude
local newSize = screenSize/diagonalDefaultSize * sizeOn1080

textLabel.TextSize = sizeOn1080

As for the “UITextSizeConstraint” it indeed could be called the issue and a good way to get through it is to use UIPadding.

1 Like

I tried the UIPadding thing but it doesn’t seem to work, do I have to just put it in? I tried changing the values but they just moved my text Offset (I’m not very familiar with it tho, to don’t say I’ve never used it)

It works just like the size property. You need to increase the TopPadding and BottomPadding in order to properly scale down the text.

1 Like

Thank you for the guide, but the UIPadding doesn’t seem to do anything, at least without code. But I got something. I made this code, I used yours to start tho.

local sizeOn1080 = 35  --base text size for 1080p res
local defaultWidth = 1920
local defaultHeight = 1080
local camera = workspace.CurrentCamera

local function updateTextSize()
	local viewport = camera.ViewportSize
	local scaleX = viewport.X / defaultWidth
	local scaleY = viewport.Y / defaultHeight
	local scaleFactor = math.min(scaleX, scaleY)
	local newSize = sizeOn1080 * scaleFactor
	script.Parent.UITextSizeConstraint.MaxTextSize = newSize
end

camera:GetPropertyChangedSignal("ViewportSize"):Connect(updateTextSize)
updateTextSize()

thanks for helping even when i took so much time to answer. I’m too busy I’m sorry =)

1 Like

Glad the issue is solved! I’d recommend marking my post as the solution as I gave the concept code. But it’s your choice.

I understand your point, but if someone has the same issue and finds this post, I can’t set a message that does not fix the problem. I’m sorry. Also why? just asking- I only wanna help the community I don’t care about solved stats and that. Greetings

Apologies if that sounded weird.

The point is that people know who gave the actual concept for the formulation of the solution and that person should be properly credited.

Of course, this is all up to you. It’s not like getting more solutions increases anyone’s reputation.

I’m just glad the issue is fixed. However, this still interests me.