[Scummvm-git-logs] scummvm master -> a2d453a8f935466b56997a377d8b61daa36385c7
ysj1173886760
42030331+ysj1173886760 at users.noreply.github.com
Mon Jul 26 12:56:06 UTC 2021
This automated email contains information about 1 new commit which have been
pushed to the 'scummvm' repo located at https://github.com/scummvm/scummvm .
Summary:
a2d453a8f9 GRAPHICS: MACGUI: don't apply the kerning offset for the generated font
Commit: a2d453a8f935466b56997a377d8b61daa36385c7
https://github.com/scummvm/scummvm/commit/a2d453a8f935466b56997a377d8b61daa36385c7
Author: ysj1173886760 (1173886760 at qq.com)
Date: 2021-07-26T20:55:49+08:00
Commit Message:
GRAPHICS: MACGUI: don't apply the kerning offset for the generated font
because we have already applied it when we are generating the font.
Changed paths:
graphics/fonts/macfont.cpp
diff --git a/graphics/fonts/macfont.cpp b/graphics/fonts/macfont.cpp
index 48d56c96e3..afe7a95e4e 100644
--- a/graphics/fonts/macfont.cpp
+++ b/graphics/fonts/macfont.cpp
@@ -301,6 +301,8 @@ bool MacFONTFont::loadFont(Common::SeekableReadStream &stream, MacFontFamily *fa
_data._rowWords = stream.readUint16BE() * 2; // row width of bit image in 16-bit wds
_data._surfHeight = _data._fRectHeight;
+
+ // i use this as a flag to indicate whether the font is generated. see more detail on drawChar.
_data._slant = 0; // only used in generated font
if (getDepth(_data._fontType) != 1) {
@@ -415,7 +417,10 @@ void MacFONTFont::drawChar(Surface *dst, uint32 chr, int x, int y, uint32 color)
uint16 xStart = (x < 0) ? -x : 0;
uint16 xStop = glyph->bitmapWidth;
+ // due to the way we are handling the generated fonts. we only add the kerning offset for the original font
+ if (!_data._slant)
x += glyph->kerningOffset;
+
if (x >= dst->w)
return;
More information about the Scummvm-git-logs
mailing list