diff --git a/release/datafiles/fonts/lastresort.woff2 b/release/datafiles/fonts/lastresort.woff2 deleted file mode 100644 index e5ad6f353f5..00000000000 Binary files a/release/datafiles/fonts/lastresort.woff2 and /dev/null differ diff --git a/source/blender/blenfont/intern/blf_font.cc b/source/blender/blenfont/intern/blf_font.cc index 1b924bcec3a..4f580956dfd 100644 --- a/source/blender/blenfont/intern/blf_font.cc +++ b/source/blender/blenfont/intern/blf_font.cc @@ -1985,7 +1985,6 @@ struct FaceDetails { /* Details about the fallback fonts we ship, so that we can load only when needed. */ static const FaceDetails static_face_details[] = { - {"lastresort.woff2", UINT32_MAX, UINT32_MAX, UINT32_MAX, UINT32_MAX}, {"Noto Sans CJK Regular.woff2", 0, TT_UCR_CJK_SYMBOLS | TT_UCR_HIRAGANA | TT_UCR_KATAKANA | TT_UCR_BOPOMOFO | TT_UCR_CJK_MISC | diff --git a/source/blender/blenfont/intern/blf_glyph.cc b/source/blender/blenfont/intern/blf_glyph.cc index 1c3d17172e3..15bcd97d536 100644 --- a/source/blender/blenfont/intern/blf_glyph.cc +++ b/source/blender/blenfont/intern/blf_glyph.cc @@ -811,17 +811,12 @@ static FT_UInt blf_glyph_index_from_charcode(FontBLF **font, const uint charcode } } - /* Next look in the rest. Also check if we have a last-resort font. */ - FontBLF *last_resort = nullptr; + /* Next look in the rest. */ for (int i = 0; i < BLF_MAX_FONT; i++) { FontBLF *f = global_font[i]; if (!f || f == *font || !(f->flags & BLF_DEFAULT)) { continue; } - if (f->flags & BLF_LAST_RESORT) { - last_resort = f; - continue; - } if (coverage_bit >= 0 && !blf_font_has_coverage_bit(f, coverage_bit)) { glyph_index = blf_get_char_index(f, charcode); if (glyph_index) { @@ -835,15 +830,6 @@ static FT_UInt blf_glyph_index_from_charcode(FontBLF **font, const uint charcode printf("Unicode character U+%04X not found in loaded fonts. \n", charcode); #endif - /* Not found in the stack, return from Last Resort if there is one. */ - if (last_resort) { - glyph_index = blf_get_char_index(last_resort, charcode); - if (glyph_index) { - *font = last_resort; - return glyph_index; - } - } - return 0; } @@ -1370,6 +1356,11 @@ GlyphBLF *blf_glyph_ensure(FontBLF *font, GlyphCacheBLF *gc, const uint charcode FontBLF *font_with_glyph = font; FT_UInt glyph_index = blf_glyph_index_from_charcode(&font_with_glyph, charcode); + if (!glyph_index) { + /* 1 = id of ICON_CHAR_NOTDEF */ + return blf_glyph_ensure_icon(gc, 1, false, nullptr); + } + if (!blf_ensure_face(font_with_glyph)) { return nullptr; } diff --git a/source/blender/blenfont/intern/blf_internal.hh b/source/blender/blenfont/intern/blf_internal.hh index f3c22d9f875..6ec8213fee8 100644 --- a/source/blender/blenfont/intern/blf_internal.hh +++ b/source/blender/blenfont/intern/blf_internal.hh @@ -202,6 +202,7 @@ GlyphBLF *blf_glyph_ensure_icon( /** * Convert a character's outlines into curves. + * \return success if the character was found and converted. */ bool blf_character_to_curves(FontBLF *font, unsigned int unicode, diff --git a/tests/files/sequence_editing/effects/reference/text_long_string.png b/tests/files/sequence_editing/effects/reference/text_long_string.png index 7d24efbcb37..42a44cbcb2d 100644 --- a/tests/files/sequence_editing/effects/reference/text_long_string.png +++ b/tests/files/sequence_editing/effects/reference/text_long_string.png @@ -1,3 +1,3 @@ version https://git-lfs.github.com/spec/v1 -oid sha256:6d6f8b3c71d2091a4d3081b010317e24f9411380d2d8291aaa35d97834fc3aa3 -size 39532 +oid sha256:d42c651ab9777c0bf83400c4021dbe1afb8f5ca87b8fad143fed3eb520cc7a81 +size 31891