aboutsummaryrefslogtreecommitdiff
path: root/graphics/fonts/bdf.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'graphics/fonts/bdf.cpp')
-rw-r--r--graphics/fonts/bdf.cpp7
1 files changed, 7 insertions, 0 deletions
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) {