From 2cb0e45c630e568ef7a4c7b5f0f195f0d67f92ce Mon Sep 17 00:00:00 2001 From: Eugene Sandulenko Date: Wed, 12 Oct 2016 19:16:57 +0200 Subject: GRAPHICS: Further work on BDF font scaling --- graphics/fonts/bdf.cpp | 7 +++++++ 1 file changed, 7 insertions(+) (limited to 'graphics/fonts/bdf.cpp') diff --git a/graphics/fonts/bdf.cpp b/graphics/fonts/bdf.cpp index a783a22f5e..34155fcec1 100644 --- a/graphics/fonts/bdf.cpp +++ b/graphics/fonts/bdf.cpp @@ -701,6 +701,11 @@ BdfFont *BdfFont::loadFromCache(Common::SeekableReadStream &stream) { } BdfFont *BdfFont::scaleFont(BdfFont *src, int newSize) { + if (!src) { + warning("Emtpy font reference in scale font"); + return NULL; + } + if (src->getFontSize()) { warning("Requested to scale 0 size font"); return NULL; @@ -720,6 +725,8 @@ BdfFont *BdfFont::scaleFont(BdfFont *src, int newSize) { data.firstCharacter = src->_data.firstCharacter; data.defaultCharacter = src->_data.defaultCharacter; data.numCharacters = src->_data.numCharacters; + data.familyName = strdup(src->_data.familyName); + data.slant = strdup(src->_data.slant); BdfBoundingBox *boxes = new BdfBoundingBox[data.numCharacters]; for (int i = 0; i < data.numCharacters; ++i) { -- cgit v1.2.3