Scaling fonts using scale in DrawString

I currently start with a target resolution of 2500x1500, and then using the actual screen size and the Safe Area percent, calculate a horizontal scale and vertical scale value. This code works correctly. For the font scaling, I use the horizontal scale. value. Is this the correct way to calculate the amount I should scale my font by?

Currently, it seems to scale correctly for font 34, but font 46 looks too large. By too large, I mean it’s larger compared to other items in the 2500x1500 drawing in illustrator using the font sizes.

Thank you.

-Nick

Wich platform are you using?
I have noticed as well that even the original XNA handles font sizes in a weird way…
Can you try to do the same in an pure XNA project and see if there are differences with monogame?

After doing some testing, it appears that Monogame on Android is scaling the fonts correctly. My problem is that Illustrator font sizes do not export at the same size the context processor exports at. Does anyone know roughly what the ratio is? Tomorrow I’ll be doing some testing to get estimates, but thought I’d ask in case someone has already done the work.

-Nick

You really need to express your situation more clearly for people here to help you: if i understand it correctly you are experiencing different font sizes on Illustrator and XNA using the compiled SpriteFont description.

My guess is that XNA rendering system that translates SpriteFont -> XNB is a bit off so if you need to perfectly control font size i suggest you use a tool that generates the texture as a png so that you can check the results and in case change the font size until it fits the one in illustrator. Such a took exists and is called SpriteFont2, i use it constantly.

http://www.nubik.com/SpriteFont/