|
1 |
| -#!/usr/bin/env python |
2 |
| - |
3 | 1 | from __future__ import unicode_literals
|
4 | 2 |
|
5 | 3 | import os
|
6 | 4 | import sys
|
7 | 5 | import re
|
8 |
| - |
9 | 6 | import gc
|
| 7 | +import matplotlib.pyplot as plt |
| 8 | +import numpy as np |
10 | 9 |
|
11 | 10 | stests = [
|
12 |
| - r'$\mathcircled{123} \mathrm{\mathcircled{123}} \mathbf{\mathcircled{123}}$', |
13 |
| - r'$\mathsf{Sans \Omega} \mathrm{\mathsf{Sans \Omega}} \mathbf{\mathsf{Sans \Omega}}$', |
| 11 | + r'$\mathcircled{123} \mathrm{\mathcircled{123}} \ |
| 12 | + \mathbf{\mathcircled{123}}$', |
| 13 | + r'$\mathsf{Sans \Omega} \mathrm{\mathsf{Sans \Omega}} \ |
| 14 | + \mathbf{\mathsf{Sans \Omega}}$', |
14 | 15 | r'$\mathtt{Monospace}$',
|
15 | 16 | r'$\mathcal{CALLIGRAPHIC}$',
|
16 | 17 | r'$\mathbb{Blackboard \pi}$',
|
|
22 | 23 | if sys.maxunicode > 0xffff:
|
23 | 24 | s = r'Direct Unicode: $\u23ce \mathrm{\ue0f2 \U0001D538}$'
|
24 | 25 |
|
25 |
| -from pylab import * |
26 |
| - |
27 | 26 |
|
28 | 27 | def doall():
|
29 | 28 | tests = stests
|
30 | 29 |
|
31 |
| - figure(figsize=(8, (len(tests) * 1) + 2)) |
32 |
| - plot([0, 0], 'r') |
33 |
| - grid(False) |
34 |
| - axis([0, 3, -len(tests), 0]) |
35 |
| - yticks(arange(len(tests)) * -1) |
| 30 | + plt.figure(figsize=(8, (len(tests) * 1) + 2)) |
| 31 | + plt.plot([0, 0], 'r') |
| 32 | + plt.grid(False) |
| 33 | + plt.axis([0, 3, -len(tests), 0]) |
| 34 | + plt.yticks(np.arange(len(tests)) * -1) |
36 | 35 | for i, s in enumerate(tests):
|
37 |
| - #print(i, s.encode("ascii", "backslashreplace")) |
38 |
| - text(0.1, -i, s, fontsize=32) |
| 36 | + plt.text(0.1, -i, s, fontsize=32) |
| 37 | + |
| 38 | + plt.savefig('stix_fonts_example') |
| 39 | + plt.show() |
39 | 40 |
|
40 |
| - savefig('stix_fonts_example') |
41 |
| - #close('all') |
42 |
| - show() |
43 | 41 |
|
44 | 42 | if '--latex' in sys.argv:
|
45 | 43 | fd = open("stix_fonts_examples.ltx", "w")
|
|
0 commit comments