Make best fit more consistent and resolution dependant

Hey, two questions

  1. When I use the font component with best fit, I will have font sizes between let’s say 15 and 60. Now, I only want fontsize 60 if my resolution width is bigger than 1024. Otherwise I want the best fit max size to be 40. Is there a way to achieve this?

  2. I don’t like it when the font sizes between 2 texts are off by a small value. Assuming a fixed size to draw on, can I precompute a font size which suits all texts if I know the texts in advance? So that my code e.g. finds out that font size 29 is the biggest I can use for all upcoming texts?

I would suggest, that you don’t work with the best fit property, but only with the font size property. If you then have your text in a layout group with a canvas scaler, that matches to a reference pixel size, you will probably get the effect you want: The text will be the same size throughout the elements, but it still will resize, if the screen size changes. :slight_smile:

1 Like

What do you mean with layout group, canvas scaler and reference pixel size?

bump :slight_smile:
Seeing what incredible resolutions are possible now on tablets, I need to find a good way to handle this problem.
Best fit is definately not the way to go on this. Maybe you can elaborate more on this reference pixel size or give me a pointer, thx