Codechange: replace error/usererror printf variant with fmt variant and rename

This commit is contained in:
Rubidium
2023-04-19 22:47:36 +02:00
committed by rubidium42
parent 43c65a3fec
commit f74e26ca7e
39 changed files with 176 additions and 131 deletions

View File

@@ -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);