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

sev- sev at scummvm.org
Sat Jan 28 12:15:08 CET 2017


This automated email contains information about 2 new commits which have been
pushed to the 'scummvm' repo located at https://github.com/scummvm/scummvm .

Summary:
1f721e929f GRAPHICS: Implemented MacFont fallback
ca55163ea1 JANITORIAL: Fix code formatting


Commit: 1f721e929fdec3b5f6d90dbece6b3112fab4c681
    https://github.com/scummvm/scummvm/commit/1f721e929fdec3b5f6d90dbece6b3112fab4c681
Author: Eugene Sandulenko (sev at scummvm.org)
Date: 2017-01-28T11:40:45+01:00

Commit Message:
GRAPHICS: Implemented MacFont fallback

Changed paths:
    graphics/macgui/macfontmanager.cpp


diff --git a/graphics/macgui/macfontmanager.cpp b/graphics/macgui/macfontmanager.cpp
index 08b225a..cf7ec40 100644
--- a/graphics/macgui/macfontmanager.cpp
+++ b/graphics/macgui/macfontmanager.cpp
@@ -290,12 +290,14 @@ const char *MacFontManager::getFontName(int id, int size, int slant) {
 	static char name[128];
 	Common::String n;
 
-	if (_extraFontNames.contains(id))
+	if (_extraFontNames.contains(id)) {
 		n = _extraFontNames[id];
-	else if (id < ARRAYSIZE(fontNames))
+	} else if (id < ARRAYSIZE(fontNames)) {
 		n = fontNames[id];
-	else
-		return NULL;
+	} else {
+		warning("MacFontManager: Requested font ID %d not found. Falling back to Chicago", id);
+		n = fontNames[0]; // Fallback to Chicago
+	}
 
 	snprintf(name, 128, "%s-%d-%d", n.c_str(), slant, size);
 


Commit: ca55163ea1daa6e322ef1ddf4615ad73b4634e0d
    https://github.com/scummvm/scummvm/commit/ca55163ea1daa6e322ef1ddf4615ad73b4634e0d
Author: Eugene Sandulenko (sev at scummvm.org)
Date: 2017-01-28T12:14:49+01:00

Commit Message:
JANITORIAL: Fix code formatting

Changed paths:
    graphics/macgui/mactext.cpp


diff --git a/graphics/macgui/mactext.cpp b/graphics/macgui/mactext.cpp
index 7a23b01..1b58872 100644
--- a/graphics/macgui/mactext.cpp
+++ b/graphics/macgui/mactext.cpp
@@ -34,7 +34,7 @@ MacText::MacText(Common::String s, const Graphics::Font *font, int fgcolor, int
 	_surface = nullptr;
 	_textAlignment = textAlignment;
 
-	_interLinear = 0; // 0 pixels between the lines by default	
+	_interLinear = 0; // 0 pixels between the lines by default
 
 	splitString(_str);
 
@@ -121,8 +121,10 @@ void MacText::render(int from, int to) {
 
 	for (int i = from; i < to; i++) {
 		int xOffset = 0;
-		if (_textAlignment == kTextAlignRight) xOffset = _textMaxWidth - _font->getStringWidth(_text[i]);
-		else if (_textAlignment == kTextAlignCenter) xOffset = (_textMaxWidth / 2) - (_font->getStringWidth(_text[i]) / 2);
+		if (_textAlignment == kTextAlignRight)
+			xOffset = _textMaxWidth - _font->getStringWidth(_text[i]);
+		else if (_textAlignment == kTextAlignCenter)
+			xOffset = (_textMaxWidth / 2) - (_font->getStringWidth(_text[i]) / 2);
 
 		//TODO: _textMaxWidth, when -1, was not rendering ANY text.
 		_font->drawString(_surface, _text[i], xOffset, y, _maxWidth, _fgcolor);





More information about the Scummvm-git-logs mailing list