Thanks to visit codestin.com
Credit goes to github.com

Skip to content

Commit 95f4f47

Browse files
committed
Don't use fancy Unicode on a narrow Python build.
svn path=/trunk/matplotlib/; revision=5936
1 parent 071d1b8 commit 95f4f47

1 file changed

Lines changed: 7 additions & 4 deletions

File tree

examples/pylab_examples/stix_fonts_demo.py

Lines changed: 7 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -13,9 +13,12 @@
1313
r'$\mathrm{\mathbb{Blackboard \pi}}$',
1414
r'$\mathbf{\mathbb{Blackboard \pi}}$',
1515
r'$\mathfrak{Fraktur} \mathbf{\mathfrak{Fraktur}}$',
16-
r'$\mathscr{Script}$',
17-
# ur'Direct Unicode: $\u23ce \mathrm{\ue0f2 \U0001D538}$'
18-
]
16+
r'$\mathscr{Script}$']
17+
18+
if sys.maxunicode > 0xffff:
19+
stests.append(
20+
ur'Direct Unicode: $\u23ce \mathrm{\ue0f2 \U0001D538}$'
21+
)
1922

2023
from pylab import *
2124

@@ -28,7 +31,7 @@ def doall():
2831
axis([0, 3, -len(tests), 0])
2932
yticks(arange(len(tests)) * -1)
3033
for i, s in enumerate(tests):
31-
print (i, s)
34+
print (i, s.encode("ascii", "backslashreplace"))
3235
text(0.1, -i, s, fontsize=32)
3336

3437
savefig('stix_fonts_example')

0 commit comments

Comments
 (0)