Advertisement

Sprite-based fonts messed up after move to new computer

Started by June 22, 2017 04:46 AM
11 comments, last by suliman 7 years, 6 months ago

Hi

Im using a 2d engine (HGE, uses directX 8.0) for my games. After buying a new computer with another graphicscard (and moving from win 7 to win 10), my fonts are sligthly messed up (missing some parts) in all my games. Im using the same monitor as before. See attached image (second "f" of effect is ugly, some of the numbers are missing, "o" of population is ugly).

The fonts are drawn as sprites from a image file containing all letters. However the same letters work in same cases and looks ugly in others. Also, this problem ONLY occurs when I run my games in windowed mode with less than native resolution (which is 1920x1080). In fullscreen mode (even if scaled down, eg 1366x768) or in 1920x1080 windowed the fonts look fine.

What could be the issue? Something with win 10?

Thanks!

 

error font.jpg

Sounds like some combination of the new video card (which probably means new video driver), and non-native resolution, and possibly the new OS. There are too many variables at play here for me to give you a definitive answer. 

You might be able to tweak your video driver's antialiasing and texture filtering settings (and probably other stuff I'm forgetting off the top of my head). You may also be able to play with screen resolutions. 

Advertisement

I have had the same problem using fully managed C# code to draw a font into a bitmap resulting in the very same image as yours when moving to Win7. It might have something caused by the native rendering code in Windows that causes these kind of issues. In C# it helped to set anti aliasing properly, maybe your engine is that old that it assumes occurence of some kind of MSAA beeing activated by default

nope, tested all my settings in the nvidia control panel. Still broken fonts :( (using gtx 970 now)

Noone else has any idea? This is really bugging me:(

I've had the same problem in one of my projects, and only in windowed mode.. It turned out that my window wasn't resized properly to match the resolution (the size is including the windows border etc., which changes from Win7 -> Win10), so a few lines were lost due to a very small downscaling. So try and go through your windows creation code :)

.:vinterberg:.

Advertisement

Ah im using an engine so I never really deal with that part of it... Would be a shame to drop windowed support for my games and also annoying during development (faster to debug in windowed mode).

Maybe change window size if not in fullscreen mode? (instead of 1600x900 i try 1650x950 for example)

Are you using AdjustWindowRect for resizing your window?

https://msdn.microsoft.com/en-us/library/windows/desktop/ms632665(v=vs.85).aspx

This function makes sure you get the right clientwindow size no matter how big titlebars, menus, borders etc. are.
On the other hand you can also adapt you backbuffer to the real clientsize so you can handle every windowsize.

I never use any CreateWindow function...

If you can get the HWND of the window you can call AdjustWindowRect() yourself :)

But I would highly recommend you switch to a more modern engine that doesn't use DX8, don't know any of them though as I write my own.. Or better yet, make your own: shouldn't be hard to make a simple 2D engine yourself using DX9, and as a result you'll get shader support which can do really great stuff for you!

 

.:vinterberg:.

This topic is closed to new replies.

Advertisement