Slick Forums

Discuss the Slick 2D Library
It is currently Sun May 19, 2013 6:42 am

All times are UTC




Post new topic Reply to topic  [ 5 posts ] 
Author Message
 Post subject: Unicode Text Problems
PostPosted: Fri May 11, 2012 7:31 pm 
Offline

Joined: Fri May 11, 2012 7:26 pm
Posts: 3
Hey,

This is my first post on here so please forgive me in advance if I seem a bit of a Noob.

I'm having trouble displaying text in my game, it used to work fine however recently its started jittering around on the screen and displaying badly, I was wondering if anyone knew what was wrong and could help me fix it?

Here's an image of what the text looks like in game:

Image

Thanks in advance!


Top
 Profile  
 
PostPosted: Fri May 11, 2012 9:15 pm 
Offline

Joined: Fri May 11, 2012 7:26 pm
Posts: 3
I've made some progress with this, it turns out that if i set the line hight like so:

Code:
tahoma = new UnicodeFont(tahomaLocation, 24, false, false);
tahoma.addAsciiGlyphs(); //Add Glyphs
tahoma.addGlyphs(400, 600); //Add Glyphs
tahoma.setGlyphPageHeight(24);
//tahoma.setGlyphPageWidth(24);
tahoma.getEffects().add(new ColorEffect(java.awt.Color.WHITE)); //Add Effects
tahoma.loadGlyphs(); //Load


Then it doesn't look as bad but its still not great, so any input would still be appreciated!

Thanks!


Top
 Profile  
 
PostPosted: Fri May 11, 2012 10:38 pm 
Offline
Slick Zombie

Joined: Sat Jan 27, 2007 7:10 pm
Posts: 1467
Why do you need unicode fonts? Why not use bitmap fonts?
http://twl.l33tlabs.org/themer/fonttool.jnlp (save as text for AngelCodeFont support)

UnicodeFont is buggy and has extremely slow loading times, IMO it should be deprecated/refactored.

Bitmap fonts have a very small memory footprint, load very quickly, and are fast to render. If you really need the features UnicodeFont brings (e.g. if you needed Chinese glyphs) then look into TWL's font mapper instead -- at least until unicode font support is smoothed out in Slick.


Top
 Profile  
 
PostPosted: Sat May 12, 2012 11:39 am 
Offline

Joined: Fri May 11, 2012 7:26 pm
Posts: 3
Ok, but I can't see how to set the font size...


Top
 Profile  
 
PostPosted: Sat May 12, 2012 12:16 pm 
Offline
Slick Zombie

Joined: Fri Jan 29, 2010 7:02 pm
Posts: 1171
What about the "Font size" slider top left?

_________________
TWL - The Themable Widget Library


Top
 Profile  
 
Display posts from previous:  Sort by  
Post new topic Reply to topic  [ 5 posts ] 

All times are UTC


Who is online

Users browsing this forum: No registered users and 3 guests


You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot post attachments in this forum

Search for:
Jump to:  
Powered by phpBB® Forum Software © phpBB Group