@@ -162,19 +162,9 @@ FT2Image::draw_rect_filled(unsigned long x0, unsigned long y0, unsigned long x1,
162
162
163
163
inline double conv (long v)
164
164
{
165
- return v / 64 .;
165
+ return double (v) / 64.0 ;
166
166
}
167
167
168
- FT_UInt ft_get_char_index_or_warn (FT_Face face, FT_ULong charcode)
169
- {
170
- FT_UInt glyph_index = FT_Get_Char_Index (face, charcode);
171
- if (charcode && !glyph_index) {
172
- PyErr_WarnEx (NULL , " Required glyph missing from current font." , 1 );
173
- }
174
- return glyph_index;
175
- }
176
-
177
-
178
168
int FT2Font::get_path_count ()
179
169
{
180
170
// get the glyph as a path, a list of (COMMAND, *args) as described in matplotlib.path
@@ -621,7 +611,7 @@ void FT2Font::set_text(
621
611
FT_BBox glyph_bbox;
622
612
FT_Pos last_advance;
623
613
624
- glyph_index = ft_get_char_index_or_warn (face, codepoints[n]);
614
+ glyph_index = FT_Get_Char_Index (face, codepoints[n]);
625
615
626
616
// retrieve kerning distance and move pen position
627
617
if (use_kerning && previous && glyph_index) {
@@ -674,8 +664,7 @@ void FT2Font::set_text(
674
664
675
665
void FT2Font::load_char (long charcode, FT_Int32 flags)
676
666
{
677
- FT_UInt glyph_index = ft_get_char_index_or_warn (face, (FT_ULong)charcode);
678
- int error = FT_Load_Glyph (face, glyph_index, flags);
667
+ int error = FT_Load_Char (face, (unsigned long )charcode, flags);
679
668
680
669
if (error) {
681
670
throw std::runtime_error (" Could not load charcode" );
0 commit comments