O
Occupant
Guest
If text is being dynamically generated and drawn to some confined space, there seems to be two ways to deal with sizing the font correctly:
1. use draw_text_transformed to draw a scaled version of the string, after string_width_ext and _string_height_ext so that you can compare it to the constraints of the confined space know how much to scale it up or down.
Does the above approach involve any kind of pixel loss or distortion? I'm guessing it must, since it probably isn't as pixel-perfect as just choosing a different font size to begin with? Which brings me to the second way to solve the problem:
2. Create numerous versions of the desired font, each at different sizes. When drawing the text, try the largest font size, and if it doesn't fit, try a smaller font size, until the text fits the constraints.
Assuming this is calculated only once per display of text (and not every step), this seems like a viable alternative, though much harder to implement.
So my question is: does using draw_text_transformed cause pixel distortions? And if so, how bad are they at big jumps in scale?
1. use draw_text_transformed to draw a scaled version of the string, after string_width_ext and _string_height_ext so that you can compare it to the constraints of the confined space know how much to scale it up or down.
Does the above approach involve any kind of pixel loss or distortion? I'm guessing it must, since it probably isn't as pixel-perfect as just choosing a different font size to begin with? Which brings me to the second way to solve the problem:
2. Create numerous versions of the desired font, each at different sizes. When drawing the text, try the largest font size, and if it doesn't fit, try a smaller font size, until the text fits the constraints.
Assuming this is calculated only once per display of text (and not every step), this seems like a viable alternative, though much harder to implement.
So my question is: does using draw_text_transformed cause pixel distortions? And if so, how bad are they at big jumps in scale?