[Scummvm-cvs-logs] SF.net SVN: scummvm:[51586] scummvm/trunk/graphics/font.cpp

lordhoto at users.sourceforge.net lordhoto at users.sourceforge.net
Sun Aug 1 21:31:37 CEST 2010


Revision: 51586
          http://scummvm.svn.sourceforge.net/scummvm/?rev=51586&view=rev
Author:   lordhoto
Date:     2010-08-01 19:31:37 +0000 (Sun, 01 Aug 2010)

Log Message:
-----------
GUI: Fix font cache.

The bounding boxes of the glyphs use signed coordinates. We stored only
unsigned coordinates, which resulted in incorrect glyph positioning.

Conrecte example: the bounding box of the glyphs for clR6x12-iso-8859-5.bdf
used:

x y  w h
0 -3 6 12

We on the other hand interpreted that as:

x y     w h
0 65533 6 12

when loading the font from our font cache.

Modified Paths:
--------------
    scummvm/trunk/graphics/font.cpp

Modified: scummvm/trunk/graphics/font.cpp
===================================================================
--- scummvm/trunk/graphics/font.cpp	2010-08-01 19:31:18 UTC (rev 51585)
+++ scummvm/trunk/graphics/font.cpp	2010-08-01 19:31:37 UTC (rev 51586)
@@ -609,8 +609,8 @@
 	cacheFile.writeUint16BE(font.desc.height);
 	cacheFile.writeUint16BE(font.desc.fbbw);
 	cacheFile.writeUint16BE(font.desc.fbbh);
-	cacheFile.writeUint16BE(font.desc.fbbx);
-	cacheFile.writeUint16BE(font.desc.fbby);
+	cacheFile.writeSint16BE(font.desc.fbbx);
+	cacheFile.writeSint16BE(font.desc.fbby);
 	cacheFile.writeUint16BE(font.desc.ascent);
 	cacheFile.writeUint16BE(font.desc.firstchar);
 	cacheFile.writeUint16BE(font.desc.size);
@@ -667,8 +667,8 @@
 	data->height = stream.readUint16BE();
 	data->fbbw = stream.readUint16BE();
 	data->fbbh = stream.readUint16BE();
-	data->fbbx = stream.readUint16BE();
-	data->fbby = stream.readUint16BE();
+	data->fbbx = stream.readSint16BE();
+	data->fbby = stream.readSint16BE();
 	data->ascent = stream.readUint16BE();
 	data->firstchar = stream.readUint16BE();
 	data->size = stream.readUint16BE();


This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site.




More information about the Scummvm-git-logs mailing list