I have a problem with rendering a font. Everything works fine except when the text size is 16 or a multiple of it (e.g. 16, 32, 64, etc.). Below, I will provide some examples. I don't want to be limited to only those text sizes.

16px (good)

18px (bad)

32px (good)

37px (bad)

It's probably a pixel font, which only has specific sizes. You might have to use a fixed size or a different font.

If it's a bitmap font you could try scaling it by a factor of 2 with nearest neighbor in an image editor and then try using it scaling down via text size but you'll likely find that it gets blurred anyways. Might be less noticeable if you've scaled it up very high(but that will have performance ramifications likely).