aboutsummaryrefslogtreecommitdiff
path: root/graphics/fonts
diff options
context:
space:
mode:
authorEugene Sandulenko2017-01-20 09:01:01 +0100
committerEugene Sandulenko2017-01-20 09:01:01 +0100
commit76cfde072296afe783ea9ab24122bb264402812d (patch)
tree64d5b782bd5725b08bcc0efc74d2934ca65fd2df /graphics/fonts
parent286a74adeb3eb145a22d7081d07ba5b20e8ccebd (diff)
downloadscummvm-rg350-76cfde072296afe783ea9ab24122bb264402812d.tar.gz
scummvm-rg350-76cfde072296afe783ea9ab24122bb264402812d.tar.bz2
scummvm-rg350-76cfde072296afe783ea9ab24122bb264402812d.zip
GRAPHICS: Further work on MacFont font scaling
Diffstat (limited to 'graphics/fonts')
-rw-r--r--graphics/fonts/macfont.cpp13
1 files changed, 13 insertions, 0 deletions
diff --git a/graphics/fonts/macfont.cpp b/graphics/fonts/macfont.cpp
index fb3240ac76..0f057a8321 100644
--- a/graphics/fonts/macfont.cpp
+++ b/graphics/fonts/macfont.cpp
@@ -425,6 +425,19 @@ MacFONTFont *MacFONTFont::scaleFont(MacFONTFont *src, int newSize) {
data._size = src->_data._size;
data._style = src->_data._style;
+ // Dtermine width of the bit image table
+ int newBitmapWidth = 0;
+ for (uint i = 0; i < src->_data._glyphs.size() + 1; i++) {
+ MacGlyph *glyph = (i == src->_data._glyphs.size()) ? &_data._defaultChar : &_data._glyphs[i];
+
+ glyph->width = (int)((float)src->_data._glyphs[i].width * scale);
+ glyph->kerningOffset = (int)((float)src->_data._glyphs[i].kerningOffset * scale);
+ glyph->bitmapWidth = (int)((float)src->_data._glyphs[i].bitmapWidth * scale);
+ glyph->bitmapOffset = newBitmapWidth;
+
+ newBitmapWidth += ((glyph->bitmapWidth + 7) / 8);
+ }
+
for (uint i = 0; i < src->_data._glyphs.size() + 1; i++) {
MacGlyph *glyph = (i == src->_data._glyphs.size()) ? &_data._defaultChar : &_data._glyphs[i];