()
| 894 | |
| 895 | |
| 896 | def test_ft2font_loading(): |
| 897 | file = fm.findfont('DejaVu Sans') |
| 898 | font = ft2font.FT2Font(file) |
| 899 | font.set_size(12, 72) |
| 900 | for glyph in [font.load_char(ord('M')), |
| 901 | font.load_glyph(font.get_char_index(ord('M')))]: |
| 902 | assert glyph is not None |
| 903 | assert glyph.width == 576 |
| 904 | assert glyph.height == 576 |
| 905 | assert glyph.horiBearingX == 0 |
| 906 | assert glyph.horiBearingY == 576 |
| 907 | assert glyph.horiAdvance == 640 |
| 908 | assert glyph.linearHoriAdvance == 678528 |
| 909 | assert glyph.vertBearingX == -384 |
| 910 | assert glyph.vertBearingY == 64 |
| 911 | assert glyph.vertAdvance == 832 |
| 912 | assert glyph.bbox == (54, 0, 574, 576) |
| 913 | assert font.get_num_glyphs() == 2 # Both count as loaded. |
| 914 | # But neither has been placed anywhere. |
| 915 | assert font.get_width_height() == (0, 0) |
| 916 | assert font.get_descent() == 0 |
| 917 | assert font.get_bitmap_offset() == (0, 0) |
| 918 | |
| 919 | |
| 920 | def test_ft2font_drawing(): |
nothing calls this directly
no test coverage detected
searching dependent graphs…