From 8a476715f6a733a0d6aa765204e87547725c243e Mon Sep 17 00:00:00 2001 From: Eugene Sandulenko Date: Sat, 21 Jan 2017 23:45:59 +0100 Subject: GRAPHICS: More work on MacFont scaling --- graphics/fonts/macfont.cpp | 11 +++-------- 1 file changed, 3 insertions(+), 8 deletions(-) (limited to 'graphics') diff --git a/graphics/fonts/macfont.cpp b/graphics/fonts/macfont.cpp index 0f057a8321..f20b64eb63 100644 --- a/graphics/fonts/macfont.cpp +++ b/graphics/fonts/macfont.cpp @@ -419,7 +419,6 @@ MacFONTFont *MacFONTFont::scaleFont(MacFONTFont *src, int newSize) { data._ascent = (int)((float)src->_data._ascent * scale); data._descent = (int)((float)src->_data._descent * scale); data._leading = (int)((float)src->_data._leading * scale); - data._rowWords = (int)((float)src->_data._rowWords * scale); data._family = src->_data._family; data._size = src->_data._size; @@ -438,14 +437,10 @@ MacFONTFont *MacFONTFont::scaleFont(MacFONTFont *src, int newSize) { 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]; + data._rowWords = newBitmapWidth; - //glyph->bitmapOffset = bitmapOffsets[i]; - //glyph->bitmapWidth = bitmapOffsets[i + 1] - bitmapOffsets[i]; - glyph->width = (int)((float)src->_data._glyphs[i].width * scale); - glyph->kerningOffset = (int)((float)src->_data._glyphs[i].kerningOffset * scale); - } + uint16 bitImageSize = data._rowWords * _data._fRectHeight; + _data._bitImage = new byte[bitImageSize]; #if 0 for (int i = 0; i < data.numCharacters; i++) { -- cgit v1.2.3