Jump to content

  • Log In with Google      Sign In   
  • Create Account


TTF font is poor quality


Old topic!
Guest, the last post of this topic is over 60 days old and at this point you may not reply in this topic. If you wish to continue this conversation start a new topic.

  • You cannot reply to this topic
5 replies to this topic

#1 thefollower   Members   -  Reputation: 176

Like
0Likes
Like

Posted 05 November 2012 - 04:02 PM

Hey, im trying to work out why my font output is so pixelated. I don't understand what i am doing wrong... i use the blended option for SDL TTF.

See screen shot for the font output:

http://213.175.192.158/~civilian/img.jpg

I have this as my code:


[source lang="cpp"] TTF_Font *font = NULL; SDL_Color textColor = { 248, 248, 255 }; font = TTF_OpenFont( "font.ttf", 16 ); if(!font) { printf("TTF_OpenFont: %s\n", TTF_GetError()); exit(0); } SDL_Surface* message = TTF_RenderText_Blended( font, caption.c_str(), textColor );[/source]


I don't know how to fix the issue, any ideas?

Sponsor:

#2 BaneTrapper   Members   -  Reputation: 943

Like
0Likes
Like

Posted 05 November 2012 - 04:40 PM

Default font sizes are usual 12, 18, 24 use one of those values to get perfect result. Else it is to the quality of the font.
Is the font clear around edges? or is it fuzzy around edges / blur ?
If u don't have program to open .ttf files, press "Start" in search bar type "fonts" hit enter
copy your font there and open it from there, and then check how it looks like.
Hope it helps!

Current projects:
The Wanderer, 2d turn based rpg style game

www.gamedev.net/topic/641117-check-up-the-wanderer/


#3 thefollower   Members   -  Reputation: 176

Like
0Likes
Like

Posted 05 November 2012 - 04:43 PM

Its the same quality regardless of size i put in the script.

The file and the font itself is crystal clear quality ... observe:

Attached Thumbnails

  • Capture.JPG


#4 leeor_net   Members   -  Reputation: 306

Like
0Likes
Like

Posted 05 November 2012 - 08:18 PM

The font handling routines in Windows are more sophisticated than those in FreeType2 (which is what SDL_TTF uses)... so a malformed TTF or any number of other issues could be causing blitting issues in the TTF rendering library itself.

As a note, I don't see any 'pixelation' in your screenshot aside from the jpeg compression artifacts, so I'm unsure of what issue you're actually describing. Do you mean the distorted outlines? Because that's not pixelation, that's distortion, and that can be explained by my previous statement.

Try using a different font, perhaps a default Windows font, to see if you get different results. If you do, you know you have a font file that may have issues or may be causing issues with FT2.

Edited by leeor_net, 05 November 2012 - 08:19 PM.

-The Legend of Mazzeroth-Project Lead, Lead Software Architect & Engineer, General Tasks and Professional Chef.

 

http://www.lairworks.com


#5 BaneTrapper   Members   -  Reputation: 943

Like
0Likes
Like

Posted 06 November 2012 - 11:22 AM

Its the same quality regardless of size i put in the script.

The file and the font itself is crystal clear quality ... observe:


I check the font and image... that's the font you are using since all letters match but Q is so weird...
On the other hand does your string have ' '(white spaces) , if it does try removing them and see what result you get.
Also try moving the drawing position of the font left or right 1 pixel and repeat for up down.

And if that does not help, gimme the source code. I did SDL for some time now and i had issues like this before.

Edited by BaneTrapper, 06 November 2012 - 11:25 AM.

Current projects:
The Wanderer, 2d turn based rpg style game

www.gamedev.net/topic/641117-check-up-the-wanderer/


#6 frob   Moderators   -  Reputation: 16157

Like
0Likes
Like

Posted 06 November 2012 - 12:33 PM

The image looks like the font was scaled and interpolated after being rendered.

Are you rendering your surface at exactly the correct number of pixels, or is it being scaled?

Edited by frob, 06 November 2012 - 12:34 PM.

Check out my personal indie blog at bryanwagstaff.com.




Old topic!
Guest, the last post of this topic is over 60 days old and at this point you may not reply in this topic. If you wish to continue this conversation start a new topic.



PARTNERS