File tree Expand file tree Collapse file tree 2 files changed +14
-2
lines changed Expand file tree Collapse file tree 2 files changed +14
-2
lines changed Original file line number Diff line number Diff line change @@ -184,3 +184,11 @@ def test_mathtext_font_stixsans():
184
184
fig .savefig ('mathtext_font_stixsans' )
185
185
186
186
matplotlib .rcParams ['mathtext.fontset' ] = 'cm'
187
+
188
+ def test_fontinfo ():
189
+ import matplotlib .font_manager as font_manager
190
+ import matplotlib .ft2font as ft2font
191
+ fontpath = font_manager .findfont ("Bitstream Vera Sans" )
192
+ font = ft2font .FT2Font (fontpath )
193
+ table = font .get_sfnt_table ("head" )
194
+ assert table ['version' ] == (1 , 0 )
Original file line number Diff line number Diff line change 4
4
5
5
#include " numpy/arrayobject.h"
6
6
7
- #define FIXED_MAJOR (val ) (*((short *) &val+1 ))
8
- #define FIXED_MINOR (val ) (*((short *) &val+0 ))
7
+ /*
8
+ By definition, FT_FIXED as 2 16bit values stored in a single long.
9
+ We cast to long to ensure the correct Py::Int convertor is called
10
+ */
11
+ #define FIXED_MAJOR (val ) (long ) ((val & 0xffff000 ) >> 16 )
12
+ #define FIXED_MINOR (val ) (long ) (val & 0xffff )
9
13
10
14
/* *
11
15
To improve the hinting of the fonts, this code uses a hack
You can’t perform that action at this time.
0 commit comments