Jump to content
  • Advertisement
Sign in to follow this  
Martin Perry

FreeType2 and font size across device

This topic is 484 days old which is more than the 365 day threshold we allow for new replies. Please post a new topic.

If you intended to correct an error in the post then please contact us.

Recommended Posts

I am creating multiplatform game, that will run on several devices. In my font rendering engine, I have used FreeType. Now, I have set font size to be 12pt and "pixel" sizes are calculated based on DPI. However, this doesn´t look nice. Fonts have the same size across all devices, but on mobile phones with high DPI, fonts are too big with respect to overall screen size. On the other hand, on classic 24" monitor, heights are quite OK.

How should I handle font sizes? Setting size in pixels directly doesn´t seem to be correct, since with high DPI, it could end up being unreadable.

Edited by Martin Perry

Share this post


Link to post
Share on other sites
Advertisement

Now, I have set font size to be 12pt and "pixel" sizes are calculated based on DPI.

This is correct if you want the same physical text size, but a 24'' monitor is much bigger than a smartphone display: text sizes that look large and readable on the former becomes oversized on the latter. Scaling text size by the ratio of expected viewing distances would be a good starting point.

You should simply use different font sizes, and maybe an essentially different layout of text columns, margins etc., depending on the screen size and the viewing distance.

Aren't you already adapting the layout of game scenes for different screen aspect ratios?

Share this post


Link to post
Share on other sites
Sign in to follow this  

  • Advertisement
×

Important Information

By using GameDev.net, you agree to our community Guidelines, Terms of Use, and Privacy Policy.

We are the game development community.

Whether you are an indie, hobbyist, AAA developer, or just trying to learn, GameDev.net is the place for you to learn, share, and connect with the games industry. Learn more About Us or sign up!

Sign me up!