Commit graph

15 commits

Author SHA1 Message Date
Clownacy
fe76fe6dea Big scary messy unfinished font overhaul
This is currently hardcoded to 640x480 English builds.

What I've done is temporarily gutted the FreeType2 font renderer, and
instead introduced a system where the font is read from a
pre-rendered font atlas. This allows me to get 100% accurate font
rendering to Windows XP... because I literally created these atlases
with Windows XP.

So not only does this eliminate the issue of FreeType producing
misshapen glyphs, but it also works around the copyright issue
regarding bundling the Courier New and MS Gothic fonts with CSE2.

You see, font files can be copyrighted like any old software, however
typefaces have a lot less protection - they're basically fair-game.
IANAL, of course - look it up yourself.

I don't really want to throw away the FreeType font system since I
spent a ton of time working on it, it allows you to use other font
files, and I'll probably wind up needing it for CSE2EX. I guess I'll
just have to find some way to either have the two systems coexist, or
make it so one or the other can be selected at compile-time.
2020-09-17 15:02:36 +01:00
Clownacy
17da39fa14 Rename FontObject to Font
Explicitly calling it an object just seems unnecessarily verbose,
2020-09-14 11:54:37 +01:00
Clownacy
988f1128dd Convert a bunch of ints to size_t
ints are dumb - only use them when you have to
2020-09-10 17:36:21 +01:00
Clownacy
4d322be866 Change render backend namespace to RenderBackend_ 2020-04-04 20:24:34 +01:00
Clownacy
ae8aeae2ac Restored the new font system 2019-09-04 15:43:28 +00:00
Clownacy
f956eb9264 Mostly ASM-accurate Draw.cpp
See #74
2019-08-31 17:43:45 +01:00
Clownacy
f354b84f6a Revert "Glyphs now regenerate with the rest of the game's textures"
This reverts commit aa6174b3f2.
2019-08-14 16:26:37 +00:00
Clownacy
aa6174b3f2 Glyphs now regenerate with the rest of the game's textures
God-damn this code is ugly
2019-08-13 18:32:44 +01:00
Clownacy
6d385e674f Font refactor part 1: Software
With this, font blitting is handled by the rendering backend, paving
the way for hardware-accelerated font drawing in the accelerated
backends.
2019-07-23 16:38:04 +01:00
Clownacy
f25df2ce07 Remove SDL2 dependency from Font.cpp 2019-04-21 21:28:18 +01:00
Clownacy
4f7db164d6 Overhauled graphics system
Along with being more accurate to the original, this fixes switching out
of fullscreen causing textures to disappear. This was caused by DirectX
destroying textures that are marked as render-targets when a device-loss
occurs. SDL2 doesn't do anything to recover them, unlike regular
textures, so my solution is just to avoid render-target textures
entirely.

On the upside, this should make drawing text to surfaces much faster,
since we're not reading back bitmaps from the GPU.
2019-01-30 21:07:47 +00:00
Clownacy
90ef30bece Added option for fonts to be loaded from Windows
This restores some compatibility with Config.dat's font settings.
2019-01-29 14:20:25 +00:00
Clownacy
ea0b3d32ac Corrected Font.h includes 2019-01-25 04:07:21 +00:00
Clownacy
69a2357ca3 Fixed font gamma-correction
Also did some cleanup.
2019-01-25 03:57:17 +00:00
Clownacy
3bb0435c27 Overhauled font system
Now with super-sexy accurate subpixel rendering and Japanese support
2019-01-24 17:36:18 +00:00