forked from mirror/OpenTTD
Codechange: replace error/usererror printf variant with fmt variant and rename
This commit is contained in:
@@ -11,6 +11,7 @@
|
||||
#include "../../debug.h"
|
||||
#include "font_osx.h"
|
||||
#include "../../blitter/factory.hpp"
|
||||
#include "../../error_func.h"
|
||||
#include "../../fileio_func.h"
|
||||
#include "../../fontdetection.h"
|
||||
#include "../../string_func.h"
|
||||
@@ -272,7 +273,7 @@ const Sprite *CoreTextFontCache::InternalGetGlyph(GlyphID key, bool use_aa)
|
||||
} else {
|
||||
bounds = CTFontGetBoundingRectsForGlyphs(this->font.get(), kCTFontOrientationDefault, &glyph, nullptr, 1);
|
||||
}
|
||||
if (CGRectIsNull(bounds)) usererror("Unable to render font glyph");
|
||||
if (CGRectIsNull(bounds)) UserError("Unable to render font glyph");
|
||||
|
||||
uint bb_width = (uint)std::ceil(bounds.size.width) + 1; // Sometimes the glyph bounds are too tight and cut of the last pixel after rounding.
|
||||
uint bb_height = (uint)std::ceil(bounds.size.height);
|
||||
@@ -283,7 +284,7 @@ const Sprite *CoreTextFontCache::InternalGetGlyph(GlyphID key, bool use_aa)
|
||||
uint height = std::max(1U, bb_height + shadow);
|
||||
|
||||
/* Limit glyph size to prevent overflows later on. */
|
||||
if (width > MAX_GLYPH_DIM || height > MAX_GLYPH_DIM) usererror("Font glyph is too large");
|
||||
if (width > MAX_GLYPH_DIM || height > MAX_GLYPH_DIM) UserError("Font glyph is too large");
|
||||
|
||||
SpriteLoader::Sprite sprite;
|
||||
sprite.AllocateData(ZOOM_LVL_NORMAL, width * height);
|
||||
|
Reference in New Issue
Block a user