File tree 1 file changed +5
-3
lines changed 1 file changed +5
-3
lines changed Original file line number Diff line number Diff line change @@ -185,13 +185,14 @@ static FT_UInt ft_glyph_warn(FT_ULong charcode)
185
185
return 0 ;
186
186
}
187
187
188
- static FT_UInt ft_get_char_index_or_warn (FT_Face face, FT_ULong charcode)
188
+ static FT_UInt ft_get_char_index_or_warn (FT_Face face, FT_ULong charcode, bool warn = true )
189
189
{
190
190
FT_UInt glyph_index = FT_Get_Char_Index (face, charcode);
191
191
if (glyph_index) {
192
192
return glyph_index;
193
193
}
194
- return ft_glyph_warn (charcode);
194
+ if (warn) return ft_glyph_warn (charcode);
195
+ else return 0 ;
195
196
}
196
197
197
198
// ft_outline_decomposer should be passed to FT_Outline_Decompose. On the
@@ -752,7 +753,8 @@ FT_UInt FT2Font::get_char_index(FT_ULong charcode, bool fallback = false)
752
753
ft_object = this ;
753
754
}
754
755
755
- return ft_get_char_index_or_warn (ft_object->get_face (), charcode);
756
+ // historically, get_char_index never raises a warning
757
+ return ft_get_char_index_or_warn (ft_object->get_face (), charcode, false );
756
758
}
757
759
758
760
void FT2Font::get_cbox (FT_BBox &bbox)
You can’t perform that action at this time.
0 commit comments