Jibble

Author Topic: TTF fonts look horrible in a high-res game  (Read 4399 times)

Dave Gilbert

  • Mittens Vassal
  • Posts: 2,642
  • Hi. Our names are FRIGGING ADORABLE.
    • Lifetime Achievement Award Winner
    • Dave Gilbert worked on a game that won an AGS Award!
    •  
    • Dave Gilbert worked on a game that was nominated for an AGS Award!
Re: TTF fonts look horrible in a high-res game
« Reply #20 on: 03 Feb 2016, 22:12 »
Is this the info you're looking for?


Crimson Wizard

  • Posts: 8,794
    • Best Innovation Award Winner 2013, for spearheading the AGS 3.3.0 project
    • Lifetime Achievement Award Winner
    • Crimson Wizard worked on a game that won an AGS Award!
    •  
    • Crimson Wizard worked on a game that was nominated for an AGS Award!
Re: TTF fonts look horrible in a high-res game
« Reply #21 on: 03 Feb 2016, 22:43 »
Dave, you took this screenshot while running windowed mode :D.

It is like a month while I am trying to know your fullscreen mode you run the game in, because I was curious what kind of ratio the filter uses.
I now feel like in tech support hell. :D


Anyway, I think I realize what you mean by "looking terrible".


Let me explain how this works. AGS scales WHOLE game image to the final display resolution.
This means that the fonts are first drawn at resolution 640 x 360 (using as much smoothness as it is required at that small resolution). And only then the whole picture is getting scaled up.
Of course, its getting very pixelated, because even the "smoothing" half-grey pixels added for anti-aliasing are enlarged proportionally. So the font's anti-aliasing looses its effect.

At this moment, I cannot think of any workarounds, except you maybe could try using Anti-aliased scaling filter (works only in Direct3D mode), but I am not sure if that will help.
« Last Edit: 03 Feb 2016, 22:47 by Crimson Wizard »

Dave Gilbert

  • Mittens Vassal
  • Posts: 2,642
  • Hi. Our names are FRIGGING ADORABLE.
    • Lifetime Achievement Award Winner
    • Dave Gilbert worked on a game that won an AGS Award!
    •  
    • Dave Gilbert worked on a game that was nominated for an AGS Award!
Re: TTF fonts look horrible in a high-res game
« Reply #22 on: 04 Feb 2016, 11:34 »
Sorry! I had included the desktop size in my list of stats but it must have gotten a bit lost in the muddle.

I play my game using two monitors. The control-V monitor size from which the two "goth club" screenshots were taken is 1600 x 900.  On my larger monitor, the results are 1920 x 1080 (and the text looks the same- blurry with anti-aliasing on, heavily pixellated with it off).

Here's another example of how the text looks with anti-aliasing on. The font is "monaco" and it is being displayed on a GUI with a transparent background on my 1920x1080 monitor:



Calin Leafshade's spritefont renderer is something I am also looking into, but it doesn't appear to be able to render fonts to a GUI. So unless there is a workaround for this, my best bet is to probably just play around with non-antialiased fonts until I find something I can live with. 

Thanks for the help and dealing with my apparent idiocy!
« Last Edit: 04 Feb 2016, 11:45 by Dave Gilbert »

Calin Leafshade

  • Posts: 3,514
  • Long live King Cat!
    • I can help with making music
    • I can help with voice acting
    • Calin Leafshade worked on a game that won an AGS Award!
    •  
    • Calin Leafshade worked on a game that was nominated for an AGS Award!
Re: TTF fonts look horrible in a high-res game
« Reply #23 on: 04 Feb 2016, 12:16 »
Calin Leafshade's spritefont renderer is something I am also looking into, but it doesn't appear to be able to render fonts to a GUI.

Does.

Crimson Wizard

  • Posts: 8,794
    • Best Innovation Award Winner 2013, for spearheading the AGS 3.3.0 project
    • Lifetime Achievement Award Winner
    • Crimson Wizard worked on a game that won an AGS Award!
    •  
    • Crimson Wizard worked on a game that was nominated for an AGS Award!
Re: TTF fonts look horrible in a high-res game
« Reply #24 on: 04 Feb 2016, 12:42 »
Sorry! I had included the desktop size in my list of stats but it must have gotten a bit lost in the muddle.

I play my game using two monitors. The control-V monitor size from which the two "goth club" screenshots were taken is 1600 x 900.  On my larger monitor, the results are 1920 x 1080 (and the text looks the same- blurry with anti-aliasing on, heavily pixellated with it off).

Dave, your desktop resolution is not important... I mean, it is, but it is not an obvious answer. The game may be stretched to whole resolution, but it may also have black borders around it to prevent proper aspect ratio, and that may affect the looks of the game.
I was not asking for a screenshot, because I know that making screenshot in fullscreen does not always work; I was asking to merely quote the information displayed in that Ctrl+V text box in fullscreen mode.

Anyway, that's just to elaborate on what I was asking about before.
I think I clearly understand the general problem you have with fonts.

I never used SpriteFont plugin, but unless it allows to draw text on top of after-scaled game frame, I honestly cannot see how it may improve the situation.

In AGS the text is never a separate object, it is always drawn on something else, like GUI, for example, and that happens before the scaling takes place.
« Last Edit: 04 Feb 2016, 12:45 by Crimson Wizard »

Dave Gilbert

  • Mittens Vassal
  • Posts: 2,642
  • Hi. Our names are FRIGGING ADORABLE.
    • Lifetime Achievement Award Winner
    • Dave Gilbert worked on a game that won an AGS Award!
    •  
    • Dave Gilbert worked on a game that was nominated for an AGS Award!
Re: TTF fonts look horrible in a high-res game
« Reply #25 on: 04 Feb 2016, 18:47 »
You are correct. I tried the plugin and had the same issues. I will just try and find pixelly fonts I can live with. Thanks for the attempted help! :)

monkey0506

  • Posts: 7,031
  • SEND PIZZA.
    • Best Innovation Award Winner 2017, for his work to help AGS games reach the widest possible audience - through popular distribution platforms (Steam, Galaxy) as well as other operating systems (Android, Linux)
Re: TTF fonts look horrible in a high-res game
« Reply #26 on: 05 Feb 2016, 05:16 »
Question about this, was the font rendering somehow changed from AGS 3.2 to newer versions? I was considering an Android port of my game IWWHIIWWHITOMIROTPG, but running the game with AGS 3.3.0 or later the fonts become unreadable. The game was built with AGS 3.2, and it seems AA was turned off. I lost the source some time ago though. Is there a way to disable TTF font AA from the CFG? And any reason why 3.3.0 and later would be forcing it when it wasn't being used in 3.2?

Edit: Actually... I think AA must have been enabled in the game settings, but 3.2 just wasn't applying it to the speech for some reason. :/ When dialog options are rendered (3.2 engine) there is visibly AA, but it isn't applied to speech or GUI labels. I think since I do not have the source I can use a custom engine build for this app that just brute-forces AA to be off. Not ideal, but it's the best I can think of since I don't have the game source.
« Last Edit: 05 Feb 2016, 06:03 by monkey0506 »

Crimson Wizard

  • Posts: 8,794
    • Best Innovation Award Winner 2013, for spearheading the AGS 3.3.0 project
    • Lifetime Achievement Award Winner
    • Crimson Wizard worked on a game that won an AGS Award!
    •  
    • Crimson Wizard worked on a game that was nominated for an AGS Award!
Re: TTF fonts look horrible in a high-res game
« Reply #27 on: 05 Feb 2016, 13:04 »
Question about this, was the font rendering somehow changed from AGS 3.2 to newer versions?

From the Changes.txt:
Quote
VERSION 3.2, June 2010
<...>
- Added support for anti-aliased TTF fonts in all situations where they weren't
   previously supported.


Is there a way to disable TTF font AA from the CFG? And any reason why 3.3.0 and later would be forcing it when it wasn't being used in 3.2?
This seem to be a case of backwards compatibility. If you are able to deduce where AA was not applied prior to 3.2, then you can add compatibility patch, which disables AA for these cases if the game format version is lower than 3.2.

Also, since 3.3.0 I was adding special "overriding" options to the config, that modified game's behavior. Their current list may be found here: https://github.com/adventuregamestudio/ags/blob/master/OPTIONS.md
If really needed, disabling TTF anti-aliasing option could be added as well.
« Last Edit: 05 Feb 2016, 13:06 by Crimson Wizard »

monkey0506

  • Posts: 7,031
  • SEND PIZZA.
    • Best Innovation Award Winner 2017, for his work to help AGS games reach the widest possible audience - through popular distribution platforms (Steam, Galaxy) as well as other operating systems (Android, Linux)
Re: TTF fonts look horrible in a high-res game
« Reply #28 on: 05 Feb 2016, 18:53 »
The game was made using a pre-release version of 3.2, in December of 2009. I don't know if it really warrants a general-purpose patch. That would require going back and trying to determine where AA was or wasn't being applied, and adding a lot of branching to the code. I don't think that this would really (reasonably) be the "expected" behavior... this game shouldn't have had AA enabled in the first place, being made at 320x240 resolution. Thank you for the response though.