diff --git a/Common/Render/Text/draw_text_cocoa.mm b/Common/Render/Text/draw_text_cocoa.mm index a98084112d..449ac404d1 100644 --- a/Common/Render/Text/draw_text_cocoa.mm +++ b/Common/Render/Text/draw_text_cocoa.mm @@ -138,6 +138,10 @@ TextDrawerCocoa::~TextDrawerCocoa() { // TODO: Share with other backends. void TextDrawerCocoa::SetOrCreateFont(const FontStyle &style) { + if (style.sizePts <= 0) { + return; + } + auto iter = fontMap_.find(style); if (iter != fontMap_.end()) { fontStyle_ = style; diff --git a/Common/UI/View.cpp b/Common/UI/View.cpp index 489d03868c..f052661c7c 100644 --- a/Common/UI/View.cpp +++ b/Common/UI/View.cpp @@ -1089,6 +1089,7 @@ const FontStyle *GetTextStyle(const UIContext &dc, TextSize size) { default: break; } + _dbg_assert_(style->sizePts > 0); return style; }