[Scummvm-git-logs] scummvm master -> c128cf9848b61cc0c9a255684fa801822b550386

AndywinXp noreply at scummvm.org
Fri Nov 10 17:42:44 UTC 2023


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:
c128cf9848 SCUMM: INDY4 (DOS/Mac Jap): Implement accurate Jap horizontal font kerning


Commit: c128cf9848b61cc0c9a255684fa801822b550386
    https://github.com/scummvm/scummvm/commit/c128cf9848b61cc0c9a255684fa801822b550386
Author: AndywinXp (andywinxp at gmail.com)
Date: 2023-11-10T18:42:38+01:00

Commit Message:
SCUMM: INDY4 (DOS/Mac Jap): Implement accurate Jap horizontal font kerning

As usual, taken from disasm. There is also vertical kerning to be
considered, but I will tackle that at a later date.

Changed paths:
    engines/scumm/charset.cpp
    engines/scumm/charset.h


diff --git a/engines/scumm/charset.cpp b/engines/scumm/charset.cpp
index 0c240085d5f..c042509f808 100644
--- a/engines/scumm/charset.cpp
+++ b/engines/scumm/charset.cpp
@@ -1119,6 +1119,24 @@ void CharsetRendererClassic::printChar(int chr, bool ignoreCharsetMask) {
 	if (_vm->_game.platform == Common::kPlatformAmiga && _vm->_game.id == GID_INDY4)
 		_drawScreen = vs->number;
 
+	// The following kerning corrections are taken from disasm. Originally they were
+	// used as character widths (e.g. 13, 15, 16), but we adapt them to small negative
+	// numbers using the formula:_cjkSpacing = japWidthCorrection - 16; where 16 is the
+	// full width of a Japanese character in this version.
+	if (_vm->_game.id == GID_INDY4 && _vm->_language == Common::JA_JPN &&
+		(_vm->_game.platform == Common::kPlatformDOS || _vm->_game.platform == Common::kPlatformMacintosh)) {
+		int japWidthCorrection = (_left == 161) ? 13 : 14;
+		//int japHeightCorrection = 15;
+		if (_vm->findVirtScreen(_top)->number == kMainVirtScreen && !_vm->isMessageBannerActive()) {
+			japWidthCorrection = 15;
+			//japHeightCorrection = 16;
+		} else if (_vm->isMessageBannerActive()) {
+			japWidthCorrection = 13;
+		}
+
+		_cjkSpacing = japWidthCorrection - 16;
+	}
+
 	printCharIntern(is2byte, _charPtr, _origWidth, _origHeight, _width, _height, vs, ignoreCharsetMask);
 
 	// Original keeps glyph width and character dimensions separately
diff --git a/engines/scumm/charset.h b/engines/scumm/charset.h
index af0b70682a1..21aec0bc367 100644
--- a/engines/scumm/charset.h
+++ b/engines/scumm/charset.h
@@ -159,7 +159,7 @@ protected:
 	virtual bool prepareDraw(uint16 chr);
 
 	int _width, _height, _origWidth, _origHeight;
-	const int _cjkSpacing;
+	int _cjkSpacing;
 	int _offsX, _offsY;
 	const byte *_charPtr;
 




More information about the Scummvm-git-logs mailing list