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

sev- sev at scummvm.org
Mon Oct 10 23:29:46 CEST 2016


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:
d7a452a6f6 GRAPHICS: Use PIXEL_SIZE as BDF font size


Commit: d7a452a6f670aa1df3e505d21880740299bc0539
    https://github.com/scummvm/scummvm/commit/d7a452a6f670aa1df3e505d21880740299bc0539
Author: Eugene Sandulenko (sev at scummvm.org)
Date: 2016-10-10T14:00:41+02:00

Commit Message:
GRAPHICS: Use PIXEL_SIZE as BDF font size

Changed paths:
    devtools/convbdf.cpp
    graphics/fonts/bdf.cpp



diff --git a/devtools/convbdf.cpp b/devtools/convbdf.cpp
index 5fbcd98..6ec453d 100644
--- a/devtools/convbdf.cpp
+++ b/devtools/convbdf.cpp
@@ -142,10 +142,9 @@ int main(int argc, char *argv[]) {
 		if (in.fail() || in.eof())
 			error("Premature end of file");
 
-		if (hasPrefix(line, "SIZE ")) {
-			int hDpi, vDpi;
-			if (sscanf(line.c_str(), "SIZE %d %d %d", &font.size, &hDpi, &vDpi) != 3)
-				error("Invalid SIZE");
+		if (hasPrefix(line, "PIXEL_SIZE ")) {
+			if (sscanf(line.c_str(), "PIXEL_SIZE %d", &font.size) != 1)
+				error("Invalid PIXEL_SIZE");
 		} else if (hasPrefix(line, "FONT ")) {
 			fontName = line.substr(5);
 		} else if (hasPrefix(line, "COPYRIGHT ")) {
diff --git a/graphics/fonts/bdf.cpp b/graphics/fonts/bdf.cpp
index 1a23133..9c5105d 100644
--- a/graphics/fonts/bdf.cpp
+++ b/graphics/fonts/bdf.cpp
@@ -336,10 +336,9 @@ BdfFont *BdfFont::loadFont(Common::SeekableReadStream &stream) {
 			font.defaultBox.height = height;
 			font.defaultBox.xOffset = xOffset;
 			font.defaultBox.yOffset = yOffset;
-		} else if (line.hasPrefix("SIZE ")) {
-			int hDpi, vDpi;
-			if (sscanf(line.c_str(), "SIZE %d %d %d", &font.size, &hDpi, &vDpi) != 3) {
-				warning("BdfFont::loadFont: Invalid SIZE");
+		} else if (line.hasPrefix("PIXEL_SIZE ")) {
+			if (sscanf(line.c_str(), "PIXEL_SIZE %d", &font.size) != 1) {
+				warning("BdfFont::loadFont: Invalid PIXEL_SIZE");
 				freeBitmaps(bitmaps, font.numCharacters);
 				delete[] bitmaps;
 				delete[] advances;





More information about the Scummvm-git-logs mailing list