ref: d52a69b0e6aad617fb2e8366b895f132d31d3755
parent: 9f353a993e0675beff91c60133f23aeaadc91004
author: Clownacy <Clownacy@users.noreply.github.com>
date: Fri Feb 1 06:07:47 EST 2019
Fix dumbass font problems The 320x240 font is still one pixel too high, but honestly I don't give a shit. It looks better anyway since the vanilla way is off-centre.
--- a/src/Draw.cpp
+++ b/src/Draw.cpp
@@ -447,16 +447,18 @@
{
//Get font size
unsigned int fontWidth, fontHeight;
- if (gWindowScale == 1)
+
+ // The original did this, but Windows would downscale it to 5/10 anyway.
+/* if (gWindowScale == 1)
{
fontWidth = 6;
fontHeight = 12;
}
else
- {
+ {*/
fontWidth = 5 * gWindowScale;
fontHeight = 10 * gWindowScale;
- }
+// }
#ifdef WINDOWS
// Actually use the font Config.dat specifies
--- a/src/Font.cpp
+++ b/src/Font.cpp
@@ -228,7 +228,7 @@
FT_Bitmap_Convert(font_object->library, &face->glyph->bitmap, &converted, 1);
const int letter_x = x + pen_x + face->glyph->bitmap_left;
- const int letter_y = y + ((FT_MulFix(face->ascender, face->size->metrics.y_scale) + (64 - 1)) / 64) - (face->glyph->metrics.horiBearingY / 64);
+ const int letter_y = y + ((FT_MulFix(face->ascender, face->size->metrics.y_scale) - face->glyph->metrics.horiBearingY + (64 / 2)) / 64);
for (int iy = MAX(-letter_y, 0); letter_y + iy < MIN(letter_y + converted.rows, surface->h); ++iy)
{
--
⑨