Jump to content

Text quality - Real help needed


.:HyPeX:.

Recommended Posts

Before anything please sustain from answering without some knowledge/testing. I'm already at my nerves becouse of this.

My only basic problem in this simple world, is having a good quality small-size text.

I can already make the text fit exactly the size in every resolution. (Resizing according to screen relatives is perfect in other words).

But i cannot find any way to draw the text in good quality.

Tried using a render target to make the text look good quality and then draw as an image to avoid quality loss - Still bad results when drawn small

Tried using screen relative values directly (Yeah, fuck perfect resizing) - Bad results

Fixed values - Not an option for smaller resolutions, text would get out of positions

This is a photoshop output - Veery small size, yet good quality: http://i.imgur.com/2JLCgma.png

(Please Note MTA's screen output is a bit sucky, somehow MTA doesnt get a good text imaging, you will notice a bit of blur arround the texts)

This is a MTA output - a bit larger size - and horrible quality - Using a big screen size: http://i.imgur.com/lHvx3iL.jpg

This is MTA output - Smallest resolution - 640x480 - horrible quality (Barely readable): http://i.imgur.com/RE5xSMB.png

So, is there anyone out there who has managed any way to get a good quality text? i'm already about to explode in anger on this subject.

Link to comment

I assume you're using the scale argument in dxDrawText to size it up and down - so yes, obviously there will be quite a quality loss.

What you'll have to do, well, at least what I do - is create several fonts. Usually one "normal" and one "smaller". Then I look up the aspect ratio of the client and use the smaller font for smaller aspect ratios.

Link to comment

Avoid using scale of any float value. It usually makes font quality really low. Use 1,2,3,... to keep it as good-looking as possible. So use something like math.ceil or math.floor together with resolution-based scaling and you should be good to go.

If you need some really small text, you should consider importing a new font with really small sizes. But that doesn't change the fact that MTA can actually make fonts worse as far as it doesn't have font hinting.

Link to comment
Avoid using scale of any float value. It usually makes font quality really low. Use 1,2,3,... to keep it as good-looking as possible. So use something like math.ceil or math.floor together with resolution-based scaling and you should be good to go.

If you need some really small text, you should consider importing a new font with really small sizes. But that doesn't change the fact that MTA can actually make fonts worse as far as it doesn't have font hinting.

I was coming as that as a temporary solution already, but it is still not greatest quality..

I'll look into dealman's part about the aspect ratio.. that should actually play a role, as my friend with 1920x1080 screen sees the texts "HD" while my 1360x768 widescreen doesnt so good.

http://prntscr.com/5s57i5

1360x768

http://prntscr.com/5s58hd

1280x720

http://prntscr.com/5s57sw

800x600

http://prntscr.com/5s5844

640x480

Link to comment
  • Moderators

You tried to use a render target?

When using rendertargets you will lose your anti aliasing/sub-pixels.

What I will recommend is to enable the subPixelPositioning argument during drawing your text.

[b]subPixelPositioning:[/b] A bool representing whether the text can be positioned sub-pixel-ly. Looks nicer for moving/scaling animations. 

Link to comment
You tried to use a render target?

When using rendertargets you will lose your anti aliasing/sub-pixels.

What I will recommend is to enable the subPixelPositioning argument during drawing your text.

[b]subPixelPositioning:[/b] A bool representing whether the text can be positioned sub-pixel-ly. Looks nicer for moving/scaling animations. 

i tried drawing a high quality render target aswell, the quality is the same while drawing. (Even a bit worse possibly, as render targets arent so good for texts)

Subpixelpositioning didnt return any noticeable change either..

Link to comment
  • Moderators

There must be changes, fonts are vectors formats that have their own raster. By enable subPixelPositioning the font will be using it's own raster and it will flow. Like switching in Photoshop from sharp to smooth. The first time I enabled it, I saw directly the differences.

Those are default fonts right?

If they are, then I will recommend you to make a screenshot with another computer, because anti-aliasing is enabled for default fonts.

Link to comment
There must be changes, fonts are vectors formats that have their own raster. By enable subPixelPositioning the font will be using it's own raster and it will flow. Like switching in Photoshop from sharp to smooth. The first time I enabled it, I saw directly the differences.

Those are default fonts right?

If they are, then I will recommend you to make a screenshot with another computer, because anti-aliasing is enabled for default fonts.

I'm always using my own custom fonts, this option will afect custom fonts aswell?

For the record, they're pt sans bold/default.

Link to comment
Custom fonts have terrible anti-aliasing and subPixelPositioning argument probably doesn't work well on them.

I am not a fan of custom fonts. :(

Thanks for the advice, i'll see if i can actually do anything on this.

By the way, dxCreateFont("default", scale,true) would work?

Else i dont know how to set actually a more exact value with decimal scaling in the dxDraw itself

Link to comment
Custom fonts have terrible anti-aliasing and subPixelPositioning argument probably doesn't work well on them.

I am not a fan of custom fonts. :(

Thanks for the advice, i'll see if i can actually do anything on this.

By the way, dxCreateFont("default", scale,true) would work?

Else i dont know how to set actually a more exact value with decimal scaling in the dxDraw itself

I'll update this. You seem to actually be right. Custom fonts actually suck.

They're both the exact same font and size. MTA's hardcoded one rocked over the custom one.

In-game the difference is even more devastating.

http://i.imgur.com/1YAa5Ge.jpg

  
default = dxCreateFont("fonts/normal.ttf", -- s8) -->
--[[ Stuff ]]  
dxDrawText("Test Text", x*0.5,y*0.65,x,y,tocolor(255,255,255,255),2.5,"default") 
dxDrawText("Test Text", x*0.5,y*0.5,x,y,tocolor(255,255,255,255),2.5,default) 
  

Now i came across the point we discussed on scaling on perfect positions - i posted a topic about the math issue involved.

viewtopic.php?f=91&t=84253

Thanks to you all guys.

EDIT: Even more devastating results. i enabled sub-pixel positioning for this one.

http://i.imgur.com/FJ8E53b.jpg

EDIT2: Tried with verdana, the font by excelence with most clear results.

http://i.imgur.com/IKpBUNq.jpg

PD: For the record, i'm taking the fonts out directly from window's library, so good quality in the .ttf file can be asumed.

Link to comment
When you create custom font, don't change scale with dxDrawText, keep use 1.

Tried it.

  
clear = dxCreateFont("fonts/clear.ttf", 8*6.5) 
  
--  
dxDrawText("Test Text", x*0.4,y*0.5,x,y,tocolor(255,255,255,255),6.1,"clear","left","top",false,false,true,true,true) 
dxDrawText("Test Text", x*0.4,y*0.65,x,y,tocolor(255,255,255,255),1,clear,"left","top",false,false,true,true,true) 
  

http://i.imgur.com/dngxsVj.jpg

I would still give the point to MTA's default. (Upper one)

Link to comment

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
  • Recently Browsing   0 members

    • No registered users viewing this page.
×
×
  • Create New...