File tree 1 file changed +11
-2
lines changed
Filter options
1 file changed +11
-2
lines changed
Original file line number Diff line number Diff line change @@ -377,6 +377,10 @@ FT2Font::~FT2Font()
377
377
if (face) {
378
378
FT_Done_Face (face);
379
379
}
380
+
381
+ for (size_t i = 0 ; i < fallbacks.size (); i++) {
382
+ Py_DECREF (fallbacks[i]->get_pyfont ());
383
+ }
380
384
}
381
385
382
386
void FT2Font::clear ()
@@ -508,15 +512,20 @@ void FT2Font::set_text(
508
512
FT_BBox glyph_bbox;
509
513
FT_Pos last_advance;
510
514
511
- FT_UInt final_glyph_index;
515
+ FT_UInt final_glyph_index = 0 ;
512
516
FT_Error charcode_error, glyph_error;
513
517
FT2Font *ft_object_with_glyph = this ;
514
518
bool was_found = load_char_with_fallback (ft_object_with_glyph, final_glyph_index, glyphs,
515
519
char_to_font, glyph_to_font, codepoints[n], flags,
516
520
charcode_error, glyph_error, false );
517
521
if (!was_found) {
518
522
ft_glyph_warn ((FT_ULong)codepoints[n]);
519
- continue ;
523
+
524
+ // render tofu
525
+ // ft_object_with_glyph == this
526
+ char_to_font[codepoints[n]] = ft_object_with_glyph;
527
+ glyph_to_font[final_glyph_index] = ft_object_with_glyph;
528
+ ft_object_with_glyph->load_glyph (final_glyph_index, flags, ft_object_with_glyph, false );
520
529
}
521
530
522
531
glyph_index = final_glyph_index;
You can’t perform that action at this time.
0 commit comments