Jump to content
  • Advertisement
Sign in to follow this  
sepultura

FreeType Question

This topic is 4862 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

my game is using freetype to deal with truetype fonts. in world of warcraft, when you resize the window, the font size remains proportional to however you resize it. how can I do this in my game? I have something like this but it seems totally wrong: FT_SetCharSize(face, 0, TO_26_6(fontsize), viewport.height/600.f, viewport.height/600.f); the 600 is from 800 x 600 where the font looks most like it does in word or photoshop. when scaling to 1024x768, it looks somewhat proportional. the reason I used height in both the width and height column is that our app supports widescreen resolution modes, and I don't want it to get fatter. thanks in advance for any help! $§$

Share this post


Link to post
Share on other sites
Advertisement
Hey, I really don't know anything about FreeType, but I did a quick google search and found this doc.

I'm not sure if messing with the resolution is the thing to do... you might simply want to affect the width and height of the character... something like :


const float fHeight = viewport.height / fNumLinesInViewport; // define how many lines you want in your viewport
const float fWidth = fHeight * 0.5f; // just a guess

FT_SetCharSize(face, fWidth, fHeight, 0.f, 0.f); // passing both 0.f at the end will use the default resolution



Hope this helps

Eric

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!