• Advertisement
Sign in to follow this  

FreeType2 and font size across device

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

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now

Sign in to follow this  

  • Advertisement