From a5d45b910f380560a928a5670d41e427a951260e Mon Sep 17 00:00:00 2001 From: Maxime Alvarez Date: Fri, 10 Aug 2018 15:00:43 +0200 Subject: [PATCH] Fixed the error message when the wrong bitmap font size is selected --- src/SFML/Graphics/Font.cpp | 15 ++++++++++----- 1 file changed, 10 insertions(+), 5 deletions(-) diff --git a/src/SFML/Graphics/Font.cpp b/src/SFML/Graphics/Font.cpp index cafba5ba7..308070a07 100644 --- a/src/SFML/Graphics/Font.cpp +++ b/src/SFML/Graphics/Font.cpp @@ -777,17 +777,22 @@ bool Font::setCurrentSize(unsigned int characterSize) const err() << "Failed to set bitmap font size to " << characterSize << std::endl; err() << "Available sizes are: "; for (int i = 0; i < face->num_fixed_sizes; ++i) - err() << face->available_sizes[i].height << " "; + { + const unsigned int size = (face->available_sizes[i].y_ppem + 32) >> 6; + err() << size << " "; + } err() << std::endl; } + else + { + err() << "Failed to set font size to " << characterSize << std::endl; + } } return result == FT_Err_Ok; } - else - { - return true; - } + + return true; }