Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Appearance settings

Commit 9b2a886

Browse filesBrowse files
committed
TST: add test for CFF / OTF files
follow up to #6714
1 parent 03775bb commit 9b2a886
Copy full SHA for 9b2a886

File tree

Expand file treeCollapse file tree

2 files changed

+16
-2
lines changed
Filter options
Expand file treeCollapse file tree

2 files changed

+16
-2
lines changed

‎.travis.yml

Copy file name to clipboardExpand all lines: .travis.yml
+1Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -24,6 +24,7 @@ addons:
2424
- texlive-xetex
2525
- graphviz
2626
- libgeos-dev
27+
- otf-freefont
2728
# - fonts-humor-sans
2829
# sources:
2930
# - debian-sid

‎lib/matplotlib/tests/test_font_manager.py

Copy file name to clipboardExpand all lines: lib/matplotlib/tests/test_font_manager.py
+15-2Lines changed: 15 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -5,8 +5,9 @@
55
import six
66

77
import os
8-
9-
from matplotlib.font_manager import (findfont, FontProperties, get_font)
8+
import os.path
9+
from matplotlib.font_manager import (findfont, FontProperties, get_font,
10+
is_opentype_cff_font, fontManager as fm)
1011
from matplotlib import rc_context
1112

1213

@@ -23,3 +24,15 @@ def test_font_priority():
2324
cmap = font.get_charmap()
2425
assert len(cmap) == 131
2526
assert cmap[8729] == 30
27+
28+
29+
def test_otf():
30+
fname = '/usr/share/fonts/opentype/freefont/FreeMono.otf'
31+
if os.path.exists(fname):
32+
assert is_opentype_cff_font(fname)
33+
34+
otf_files = [f for f in fm.ttffiles if 'otf' in f]
35+
for f in otf_files:
36+
with open(f, 'rb') as fd:
37+
res = fd.read(4) == b'OTTO'
38+
assert res == is_opentype_cff_font(f)

0 commit comments

Comments
0 (0)
Morty Proxy This is a proxified and sanitized view of the page, visit original site.