|
33 | 33 | see license/LICENSE_TTFQUERY.
|
34 | 34 | """
|
35 | 35 |
|
36 |
| -import os, sys, glob, warnings, shutil |
| 36 | +import os, sys, glob, shutil |
37 | 37 | import matplotlib
|
38 | 38 | from matplotlib import afm
|
39 | 39 | from matplotlib import ft2font
|
@@ -445,17 +445,17 @@ def createFontDict(fontfiles, fontext='ttf'):
|
445 | 445 | try:
|
446 | 446 | font = afm.AFM(file(fpath))
|
447 | 447 | except RuntimeError:
|
448 |
| - warnings.warn("Could not open font file %s"%fpath) |
| 448 | + verbose.report("Could not open font file %s"%fpath) |
449 | 449 | continue
|
450 | 450 | prop = afmFontProperty(font)
|
451 | 451 | else:
|
452 | 452 | try:
|
453 | 453 | font = ft2font.FT2Font(str(fpath))
|
454 | 454 | except RuntimeError:
|
455 |
| - warnings.warn("Could not open font file %s"%fpath) |
| 455 | + verbose.report("Could not open font file %s"%fpath) |
456 | 456 | continue
|
457 | 457 | except UnicodeError:
|
458 |
| - warnings.warn("Cannot handle unicode filenames") |
| 458 | + verbose.report("Cannot handle unicode filenames") |
459 | 459 | #print >> sys.stderr, 'Bad file is', fpath
|
460 | 460 | continue
|
461 | 461 | try: prop = ttfFontProperty(font)
|
@@ -690,7 +690,7 @@ def set_name(self, names):
|
690 | 690 | # Remove family names from list of font names.
|
691 | 691 | for name in names[:]:
|
692 | 692 | if name.lower() in font_family:
|
693 |
| - warnings.warn( msg % name) |
| 693 | + verbose.report( msg % name) |
694 | 694 | while name in names:
|
695 | 695 | names.remove(name.lower())
|
696 | 696 |
|
@@ -986,7 +986,7 @@ def findfont(self, prop, fontext='ttf'):
|
986 | 986 |
|
987 | 987 | fontkey = FontKey(name, style, variant, weight, stretch, size)
|
988 | 988 | add_filename(fontdict, fontkey, self.defaultFont)
|
989 |
| - warnings.warn('Could not match %s, %s, %s. Returning %s' % (name, style, variant, self.defaultFont)) |
| 989 | + verbose.report('Could not match %s, %s, %s. Returning %s' % (name, style, variant, self.defaultFont)) |
990 | 990 |
|
991 | 991 | return self.defaultFont
|
992 | 992 |
|
|
0 commit comments