Adventure Game Studio

AGS Support => Beginners' Technical Questions => Topic started by: Gal Shemesh on Wed 23/08/2023 14:31:42

Title: Horizontal offset for outline WFN font?
Post by: Gal Shemesh on Wed 23/08/2023 14:31:42
Hi everyone,

I searched in the forum but didn't find anyone asking about this.

I'm using WFN fonts; 'Font 1' is the actual font where 'Font 2' is its outline. The thing is, the font is quite narrow, and so an outline around the letters kind of "close" upon the font, making it look even narrower... So I checked the Font 2 properties and saw that there's a VerticalOffset property, which works great for offsetting the font vertically. Though, I also wish to offset it horizontally, but there's no built-in option for that...

So, is there a simple script way to setting this up? (and if there's an option to make the outline font a little transparent that would be even better!)

*I know that I can edit the outline font, letter by letter, and to position each in a way that it will look in an offset, but that too much work and it won't give the freedom to dynamically change the angle of the outline font if I ever want to simple tune it.

Thanks
Title: Re: Horizontal offset for outline WFN font?
Post by: Crimson Wizard on Wed 23/08/2023 14:45:06
Quote from: Gal Shemesh on Wed 23/08/2023 14:31:42So, is there a simple script way to setting this up? (and if there's an option to make the outline font a little transparent that would be even better!)

No.

Although, in theory, you might script displaying 2 lines of same text with 2 fonts one above another.
Title: Re: Horizontal offset for outline WFN font?
Post by: Gal Shemesh on Wed 23/08/2023 14:57:34
Quote from: Crimson Wizard on Wed 23/08/2023 14:45:06Although, in theory, you might script displaying 2 lines of same text with 2 fonts one above another.
Hey, that's a great idea! Can you assist me to adding this to my custom 'say' function? Here's my code:
void sayNew(this Character*, int cue, String text)
{
  String cueString = String.Format("&%d", cue);
  {
    if (Speech.VoiceMode == eSpeechVoiceAndText && IsSpeechVoxAvailable())
    {
      AudioChannel* ch = Game.PlayVoiceClip(this, cue);
      this.SayAt(Game.Camera.Width /2, Game.Camera.Height + 15, -1, text);
      if (ch != null)
      {
        ch.Stop();
      }
    }
    else if (Speech.VoiceMode == eSpeechVoiceOnly && IsSpeechVoxAvailable())
    {
      this.Say(cueString);
    }     
    else if (Speech.VoiceMode == eSpeechTextOnly)
    {
      this.SayAt(Game.Camera.Width /2, Game.Camera.Height + 15, -1, text);
    }
  }
}
Title: Re: Horizontal offset for outline WFN font?
Post by: Khris on Thu 24/08/2023 13:32:23
You can use this: http://khris.ddns.net/agsfont/

First, select a TTF or OTF font, then adjust the outline to your liking.
Finally, download the wfn files and overwrite the ones in your game folder.
Title: Re: Horizontal offset for outline WFN font?
Post by: Gal Shemesh on Thu 24/08/2023 15:01:45
That's awesome, @Khris. Thanks!
Though, unfortunately - my game uses bare WFN pixel fonts. So I can't upload my files there...
Title: Re: Horizontal offset for outline WFN font?
Post by: Khris on Thu 24/08/2023 15:05:30
Yeah, I was afraid that was the case. I might add support for that at some point.