About Store Forum Documentation Contact



Post Reply 
Font Question
Author Message
Xhizors Offline
Member

Post: #1
Font Question
Hello.

I made a 12px Arial font and it looks like image #1, Then I display this image like this.

Code:
// Load Fonts
font_Areal12px = Fonts("Fonts/Arial12px.font");

Text_ds.font   = font_Areal12px;
Text_ds.scale  = Vec2( 0.06, 0.06 );
Text_ds.color  = 0xFFFAFAFB;
Text_ds.shadow = 0;

In game the font does not look anything like this, Check image #2. ( Yes I have all characters in the image, Just display this on the image just compare the two big 'F's)

Any ideas why it looks more "bold"? I just want it to look the same smile
09-16-2009 08:32 AM
Find all posts by this user Quote this message in a reply
Xhizors Offline
Member

Post: #2
Re: Font Question
Sooo any ideas?
09-17-2009 12:50 PM
Find all posts by this user Quote this message in a reply
Esenthel Offline
Administrator

Post: #3
Re: Font Question
generally it is not recommended to use so small fonts and then draw them with 1:1 pixel to pixel,

this isn't used in modern games, and doesn't look good, and font has different visible sizes according to selected resolution.

altough I think it is possible to enable that:
Code:
Byte f=D.filter(); D.filter(0); // disable filtering
TextDS tds; tds.scale=D.pixelToScreenSize(VecI2(12,12)); // set 1:1 pixel to pixel font size
D.text(tds,"text");
D.filter(f); // restore filtering
But I haven't tested it, so I dont know if it work ok,


you should test different values, not only 12,12
09-17-2009 01:13 PM
Find all posts by this user Quote this message in a reply
Xhizors Offline
Member

Post: #4
Re: Font Question
Esenthel Wrote:generally it is not recommended to use so small fonts and then draw them with 1:1 pixel to pixel,

this isn't used in modern games, and doesn't look good, and font has different visible sizes according to selected resolution.

altough I think it is possible to enable that:
Code:
Byte f=D.filter(); D.filter(0); // disable filtering
TextDS tds; tds.scale=D.pixelToScreenSize(VecI2(12,12)); // set 1:1 pixel to pixel font size
D.text(tds,"text");
D.filter(f); // restore filtering
But I haven't tested it, so I dont know if it work ok,


you should test different values, not only 12,12

I tried this, but the result was not that good. I also tested 18 in size, but its to large.

So how can I render 12px size fonts in good resolution? Possible?

Thanks.
09-17-2009 02:47 PM
Find all posts by this user Quote this message in a reply
Xhizors Offline
Member

Post: #5
Re: Font Question
It should be good, because I really want to use this font smile Can you test it out?

Thanks.
09-18-2009 10:31 AM
Find all posts by this user Quote this message in a reply
Esenthel Offline
Administrator

Post: #6
Re: Font Question
have you tried putting different values here VecI2(12,12)); ?
09-18-2009 10:39 AM
Find all posts by this user Quote this message in a reply
Xhizors Offline
Member

Post: #7
Re: Font Question
Esenthel Wrote:have you tried putting different values here VecI2(12,12)); ?

Yes I have, The font gets bigger and seems like its bold.
09-18-2009 11:08 AM
Find all posts by this user Quote this message in a reply
Esenthel Offline
Administrator

Post: #8
RE: Font Question
this will work in the next engine release:
-wait for the next sdk
-recreate your font
-use the following code:

Code:
Byte f=D.filter(); D.filter(0); // disable filtering
TextDS tds; tds.scale=D.pixelToScreenSize(font.height()); // set 1:1 pixel to pixel font size
D.text(tds,"text");
D.filter(f); // restore filtering
10-17-2009 01:53 PM
Find all posts by this user Quote this message in a reply
Post Reply