Sorry your browser is not supported!

You are using an outdated browser that does not support modern web technologies, in order to use this site please update to a new browser.

Browsers supported include Chrome, FireFox, Safari, Opera, Internet Explorer 10+ or Microsoft Edge.

AppGameKit Classic Chat / Problem with font - can anyone help?

Author
Message
Hudd
17
Years of Service
User Offline
Joined: 23rd Aug 2007
Location:
Posted: 10th Jun 2022 11:04
I have a released AppGameKit game - works fine for most people, but one customer has reported that the font is all garbled. Anyone any ideas?



You can kinda read it... The text in the bottom right should read "English", "Scroll Speed" and "Move grid" respectively.

I'm using AppGameKit classic:

UseNewDefaultFonts(1)

Most of that screen uses this font.
loadfont(1,"fonts\kingthings_exeter.ttf")

But the header is:
loadfont(3,"fonts\MorrisRoman-Black.ttf")

Anyone seen anything like this before?

I'm thinking I'll put in an option as a short term fix to use a really basic font like tahoma - but obviously this will need some coaching of the people affected and many will just push the refund button...

Attachments

Login to view attachments
Virtual Nomad
Moderator
18
Years of Service
User Offline
Joined: 14th Dec 2005
Location: SF Bay Area, USA
Posted: 10th Jun 2022 13:05 Edited at: 10th Jun 2022 13:35
i haven't seen an issue like thaat before but a quick search for "garbled text" lead to this: https://answers.microsoft.com/en-us/windows/forum/all/garbled-text-in-metro-ui-windows-start-button-and/7e9abb8f-2ecf-406e-a720-6ba1544b3e7e

which stemmed from https://answers.microsoft.com/en-us/windows/forum/all/garbled-text-in-metro-ui-windows-start-button-and/7e9abb8f-2ecf-406e-a720-6ba1544b3e7e containing this image which looks similar to yours?

from the first, "I did it!!! Increase you dpi scaling to 120% and fonts are readable again!!!!"

at a glance, it was also suggested that the fonts could be corrupted (and restored).

either might be something to explore/a place to start with your customers?

meanwhile, i would ask for their system details to try to track the issue down and account for it, if you haven't already.

btw, this is the only other font-related thread that i recall: https://forum.thegamecreators.com/thread/226691 the issue is different but it may provide some insight.
Hudd
17
Years of Service
User Offline
Joined: 23rd Aug 2007
Location:
Posted: 10th Jun 2022 15:44
I think I remember having that problem on Windows!
I don't think this one is a Windows problem though - it's only affecting my game.

The AppGameKit thread is interesting though - I've given the customer a few options of things to do that might sort things out.

1 - I've added an option to force to a default font rather than the slightly heraldic one I was using.
2 - There is already an option to increase or decrease text size - one of the things suggested in the AppGameKit thread was that some fonts don't like being different sizes. Advised to try different settings.
3 - He clearly has a program overlaying play time and FPS - again a suggestion from the AppGameKit thread was to try turning this off...

I will see if any of these work!

Thanks for your suggestions!
Raven
19
Years of Service
User Offline
Joined: 23rd Mar 2005
Location: Hertfordshire, England
Posted: 10th Jun 2022 20:25
UseNewDefaultFont( Enable/Disable ) simply changes the Default Font uses for Print / Text as opposed to Custom Fonts.

Now beyond this TrueType and OpenType Fonts are (generally) Vectored or "Scalable Vector Graphics"... this allows for displaying the font at any size.
Corruption we're seeing here is rare but can happen because of how SVG Fonts are Processed.

Specifically speaking, it's how the Windows Font Shader works... it is set to UV Wrapping Mode; this means any value outside of 0.0 to 1.0 is wrapped around to fit within these UV Mapping Values.
What can cause the effect being see is specifically a corruption in the Scaling Values for the SVG; and more specifically we're talking about Overlays that "Hijack" the Rendering Context; as they have no knowledge of external variables essential to said Context; say like SVG Scaling Values.
Now if you notice in the image., while most letters are affected, some letters aren't... and consistently we're talking about individual letters in the Font, as opposed to in the Words.

This is because the Font itself is Rasterised into a Bitmap Font when first loaded., this includes multiple sizes; and so it will ONLY recalculate this if you use an "Uncommon" Size.
Something you might've noticed with Modern UI Overlays is that they will not enable for a few seconds after the Application has begun., this is because IF they do it can result in the displayed issues.
As the Microsoft help indicates, a "Workaround" is to simply increase the Resolution Scaling until the Text appears correctly again... but a better solution is NOT to use things like MSI Afterburner or other Overlays that bypass the Post-Launch Hook but instead Hook via the Display Drivers; as this is what causes the corruption as they tend to have their own Scaling Values.

With this said., there is a solution that will ALWAYS work... and that's switching to a Bitmap (pre-rasterised) Font.
Given that most people will be using "Common" Resolutions (720p, 1080p, 1440p, 2160p) even on Mobile Devices., you can reasonably easily construct a Bitmap Font with prescribed sizes and scaling on those resolutions.
It'll use a bit more Storage Space., but will prevent issues like this; and while it will prevent you from using the "Print" Command (which doesn't support Bitmap Fonts iirc) you can still use Text just fine.
Hudd
17
Years of Service
User Offline
Joined: 23rd Aug 2007
Location:
Posted: 10th Jun 2022 21:22
It seems like it is all working now!

He's not really sure what he did that made it work - he tried all the suggestions and nothing... Then quit, went back in and it was fine!

I suspect it was the overlay - whatever that was.

Thanks very much for your help, both!

Maybe next time I write a game I will use a bitmap font...

Login to post a reply

Server time is: 2024-11-17 22:17:53
Your offset time is: 2024-11-17 22:17:53