Certain letters not appearing on screen

Started by Dave Gilbert, Thu 13/04/2017 01:10:22

Previous topic - Next topic

Crimson Wizard

Quote from: Snarky on Tue 18/04/2017 11:20:41
Of course, those games are built with and run on an older version of the engine by default. The goal of running already-built old games with a newer version of the engine is, IMO, the lowest-priority form of backwards compatibility.

This kind of compatibility was primarily needed for the ports, that cannot run old games with their original executable.

From the beginning of this project it was struggling between two tasks: making ports run all games, both old and new, and continue developing new versions.


Quote from: Snarky on Tue 18/04/2017 11:20:41
Oh, that's cool! I didn't know you could do that.
You can replace almost every resource in game that way, because AGS gives files on disk higher priority than to ones in package.
People were doing "unofficial" translations for decade like that, by placing both TRA and font files in the game folder to override ones in game.

abstauber

QuoteI wasn't aware of that. And MMM games are released in recent years, so I thought they are still using it.
They are still using the Lucasfan Font and at in the AGS source I found this:
https://github.com/adventuregamestudio/ags/blob/master/Common/font/ttffontrenderer.cpp

Quote
#if !defined(WINDOWS_VERSION)
  // FIXME: (!!!) this fix should be done differently:
  // 1. Find out which OUTLINE font was causing troubles;
  // 2. Replace outline method ONLY if that troublesome font is used as outline.
  // 3. Move this fix somewhere else!! (right after game load routine?)
  //
  // Check for the LucasFan font since it comes with an outline font that
  // is drawn incorrectly with Freetype versions > 2.1.3.
  // A simple workaround is to disable outline fonts for it and use
  // automatic outline drawing.
  if (get_font_outline(fontNumber) >=0 &&
      strcmp(alfont_get_name(alfptr), "LucasFan-Font") == 0)
      set_font_outline(fontNumber, FONT_OUTLINE_AUTO);
#endif

The outline found is the same as in the 9Verb template, so that should not cause any problems

Crimson Wizard

#22
Quote from: abstauber on Tue 18/04/2017 13:06:49in the AGS source I found this:
https://github.com/adventuregamestudio/ags/blob/master/Common/font/ttffontrenderer.cpp

Quote
#if !defined(WINDOWS_VERSION)
  // FIXME: (!!!) this fix should be done differently:
  // 1. Find out which OUTLINE font was causing troubles;
  // 2. Replace outline method ONLY if that troublesome font is used as outline.
  // 3. Move this fix somewhere else!! (right after game load routine?)
  //
  // Check for the LucasFan font since it comes with an outline font that
  // is drawn incorrectly with Freetype versions > 2.1.3.
  // A simple workaround is to disable outline fonts for it and use
  // automatic outline drawing.
  if (get_font_outline(fontNumber) >=0 &&
      strcmp(alfont_get_name(alfptr), "LucasFan-Font") == 0)
      set_font_outline(fontNumber, FONT_OUTLINE_AUTO);
#endif

That is a hack for other ports made by JJS. The thing is that OTHER ports already use updated library, but without much compatibility fixes, which causes some of these fonts render incorrectly (hence this crude hack).

I recall there were other affected fonts, like in Primordia: https://github.com/adventuregamestudio/ags/issues/126

abstauber

So if the fonts in the included 9verb template are rendered correctly even with the new library, then I'd say update it is safe to update it.

The MMM guys would just need to upgrade a single .ttf file. And for older games without the sources they would just need to provide the ttf file outside of the ags resource file.

Danvzare

Quote from: Snarky on Tue 18/04/2017 11:20:41
Quote from: Crimson Wizard on Tue 18/04/2017 11:12:34
There are still other solutions, like suggest override the font with another one, which works if you put it in the game folder.

Oh, that's cool! I didn't know you could do that.
Me neither. This changes everything! 8-0

Dave Gilbert

#25
So I just... put the font in the game's folder and viola? I am going to try this now!

edit: aaand now the "M" disappears. :) This is just weird.

Crimson Wizard

Quote from: Dave Gilbert on Wed 19/04/2017 18:44:44
So I just... put the font in the game's folder and viola? I am going to try this now!

edit: aaand now the "M" disappears. :) This is just weird.

Dave, I think you misunderstood something. That was not a solution for your problem, I just mentioned that this may be done, for example, to replace some font with different font.

Dave Gilbert

Yes I misunderstand that completely. Although why it made an entirely different letter disappear is a different mystery entirely. Either way, I'm just going to disable anti-aliasing and go with the pixelly version of the font. It looks fine!

Crimson Wizard

Quote from: Dave Gilbert on Wed 19/04/2017 19:15:10
Yes I misunderstand that completely. Although why it made an entirely different letter disappear is a different mystery entirely. Either way, I'm just going to disable anti-aliasing and go with the pixelly version of the font. It looks fine!
Have you managed to try out the version I gave you? I will probably try it out myself now, because I've got some time.
That would be interesting to know, at least for future reference, if upgrading to latest fonts library will fix this problem.

Dave Gilbert

Aaand there was a whole slew of posts on the first page that I didn't see. I am batting a hundred today. I am AFK at the moment so if you've got the time - great!

Crimson Wizard

#30
I tested and this build does not display any text with this font at all. Something might have been done wrong in there.

Dave Gilbert

Does it displays OK with anti-aliasing disabled? All problems go away for me, but it's obviously very pixelly.

Crimson Wizard

Quote from: Dave Gilbert on Thu 20/04/2017 14:19:54
Does it displays OK with anti-aliasing disabled? All problems go away for me, but it's obviously very pixelly.

Yes, it does. So there is something special in how anti-aliasing is implemented, which needs research.

Dave Gilbert

There could be something broken with the font itself. Every other font I try doesn't have this problem. Although I have yet to find a similar font that I like just as much.

Mandle

Quote from: Dave Gilbert on Thu 20/04/2017 14:25:24
There could be something broken with the font itself. Every other font I try doesn't have this problem. Although I have yet to find a similar font that I like just as much.

Can't you just rip the font characters and create a new font from them? Or is that a no-no?

Snarky

I tried opening the font in a font editor and just regenerating it, to see if that would help. It crashed FontLab Studio 5 (quite possibly a sign that there's something weird with the font), but I was able to do it in FontForge. When you generate the font it produces warnings about a bunch of errors (notably one about a kerning value being out of normal range and possibly not supported by some applications), which I ignored, but it might be worth trying to fix them to see if that takes care of it.

Here's the rebuilt file:

https://www.dropbox.com/s/516qz925vjnwej5/Cambria-Bold.ttf?dl=0

Dave Gilbert

#36
Oof. Okay, so the problem is obviously the font. Sorry to waste everyone's time with this.

I tried using that file you uploaded, Snarky, and it works! ...half of the time. The capitol "S" seems to disappear at arbitrary times (usually at the beginning of a sentance). I suppose that's better than when it disappeared all of the time, but still.

I guess it's time to find a font that looks somewhat similar. The issue is that since the game is 640 x 360, when blown up to full screen in anti-aliasing mode most fonts look AWFUL. Cambria was one of the few that didn't. :)

edit: And now the "M" disappears every time! haha. OK. I think it's time to retire Cambria.


Danvzare

"You are HU AN. RE E BER!"
Sounds like he's drunk. (laugh)

selmiak

Just a guess, I bet W disappears too, just because the letter is 1px too wide like the capital M. Try changing the M in the font and make it as wide as the other characters that are displayed, I bet my ass it displays then. If not, you won my ass :D

Mandle

A bit OT but I just thought I'd mention that Mostly Walking, a fairly famous youtube show that does weekly episodes blind-playing adventure games, just mentioned that they are playing a Wadjet Eye game starting from next week.

Previously they have played Gemini Rue and were very impressed with it. They have just finished The 7th Guest and said they need to "treat themselves" with a good game after that and decided on another Wadjet Eye game.

SMF spam blocked by CleanTalk