@@ -201,19 +201,6 @@ static void ft_glyph_warn(FT_ULong charcode, FT_String *family_name)
201
201
}
202
202
}
203
203
204
- static FT_UInt
205
- ft_get_char_index_or_warn (FT_Face face, FT_ULong charcode, bool warn = true )
206
- {
207
- FT_UInt glyph_index = FT_Get_Char_Index (face, charcode);
208
- if (glyph_index) {
209
- return glyph_index;
210
- }
211
- if (warn) {
212
- ft_glyph_warn (charcode, face->family_name );
213
- }
214
- return 0 ;
215
- }
216
-
217
204
// ft_outline_decomposer should be passed to FT_Outline_Decompose. On the
218
205
// first pass, vertices and codes are set to NULL, and index is simply
219
206
// incremented for each vertex that should be inserted, so that it is set, at
@@ -592,8 +579,7 @@ void FT2Font::load_char(long charcode, FT_Int32 flags, FT2Font *&ft_object, bool
592
579
ft_object = ft_object_with_glyph;
593
580
} else {
594
581
ft_object = this ;
595
- FT_UInt glyph_index = ft_get_char_index_or_warn (face, (FT_ULong)charcode);
596
-
582
+ FT_UInt glyph_index = FT_Get_Char_Index (face, (FT_ULong) charcode);
597
583
if (FT_Error error = FT_Load_Glyph (face, glyph_index, flags)) {
598
584
throw_ft_error (" Could not load charcode" , error);
599
585
}
@@ -608,8 +594,7 @@ void FT2Font::load_char(long charcode, FT_Int32 flags, FT2Font *&ft_object, bool
608
594
609
595
bool FT2Font::get_char_fallback_index (FT_ULong charcode, int & index ) const
610
596
{
611
- /* * can segfault if set to true*/
612
- FT_UInt glyph_index = ft_get_char_index_or_warn (face, charcode, false );
597
+ FT_UInt glyph_index = FT_Get_Char_Index (face, charcode);
613
598
if (glyph_index) {
614
599
// -1 means the host has the char and we do not need to fallback
615
600
index = -1 ;
@@ -642,7 +627,7 @@ bool FT2Font::load_char_with_fallback(FT2Font *&ft_object_with_glyph,
642
627
FT_Error &glyph_error,
643
628
bool override = false )
644
629
{
645
- FT_UInt glyph_index = ft_get_char_index_or_warn (face, charcode, false );
630
+ FT_UInt glyph_index = FT_Get_Char_Index (face, charcode);
646
631
family_names.push_back (face->family_name );
647
632
if (glyph_index || override ) {
648
633
if ((charcode_error=FT_Load_Glyph (face, glyph_index, flags))) {
@@ -721,8 +706,7 @@ FT_UInt FT2Font::get_char_index(FT_ULong charcode, bool fallback = false)
721
706
ft_object = this ;
722
707
}
723
708
724
- // historically, get_char_index never raises a warning
725
- return ft_get_char_index_or_warn (ft_object->get_face (), charcode, false );
709
+ return FT_Get_Char_Index (ft_object->get_face (), charcode);
726
710
}
727
711
728
712
void FT2Font::get_width_height (long *width, long *height)
0 commit comments