When calculating the font size clamp by the requested cursor size instead of 256. This will often make the cursor smaller since allowing 256px wide cursors is quite large. Also de-duplicate size checks & round the text size to an integer to avoid fractional scaling from subtle changes to the text.