|
From: <ai...@us...> - 2014-04-01 20:04:51
|
Revision: 13092
http://sourceforge.net/p/plplot/code/13092
Author: airwin
Date: 2014-04-01 20:04:46 +0000 (Tue, 01 Apr 2014)
Log Message:
-----------
Rewrite this important test case demonstrating the vertical offset of
glyphs using many more UTF-8 glyphs.
Modified Paths:
--------------
trunk/examples/python/test_circle.py
Modified: trunk/examples/python/test_circle.py
===================================================================
--- trunk/examples/python/test_circle.py 2014-04-01 19:53:12 UTC (rev 13091)
+++ trunk/examples/python/test_circle.py 2014-04-01 20:04:46 UTC (rev 13092)
@@ -1,4 +1,5 @@
#!/usr/bin/env python
+# -*- coding: utf-8; -*-
# Append to effective python path so that can find plplot modules.
from plplot_python_start import *
@@ -9,16 +10,31 @@
x = [0.5]
y = [0.5]
+
title = [
"Large Circle + Light Diagonal Cross with plptex",
- "Ascii Asterisk with plptex",
- "Plplot Encoded Unicode Indexed Asterisk with plptex",
- "Plplot Encoded Hershey Indexed Asterisk with plptex",
- "Asterisk with plsym",
- "Asterisk with plpoin",
- "Plplot Encoded Hershey Indexed Asterisk with plstring",
+ "UTF-8 plus",
+ "UTF-8 squared plus",
+ "UTF-8 heavy plus",
+ "UTF-8 minus",
+ "UTF-8 squared minus",
+ "UTF-8 heavy minus",
+ "UTF-8 times",
+ "UTF-8 squared times",
+ "UTF-8 heavy multiplication x",
+ "UTF-8 number sign",
+ "UTF-8 full-width number sign",
+ "UTF-8 asterisk",
+ "UTF-8 four teardrop-spoked asterisk",
+ "UTF-8 8-spoked asterisk",
+ "UTF-8 asterisk operator",
+ "UTF-8 Asterisk operator with plptex",
+ "Plplot Encoded Unicode Indexed Asterisk operator with plptex",
+ "Plplot Encoded Hershey Indexed Asterisk operator with plptex",
+ "Hershey Asterisk operator with plsym",
+ "Hershey Asterisk operator with plpoin",
+ "Plplot Encoded Hershey Indexed Asterisk operator with plstring",
]
-
ifunicode = True
# Parse and process command line arguments
@@ -26,7 +42,7 @@
# Initialize plplot
plinit()
-for kind in range(7):
+for kind in range(len(title)):
pladv(0)
plvpor(0.1, 0.9, 0.1, 0.9)
plwind(0., 1., 0., 1.)
@@ -51,31 +67,94 @@
plptex(0.5, 0.5, 1., 0., 0.5, "#[0x2573]")
else:
plschr(0., 4.*size)
+ # Large circle via Hershey fonts.
plptex(0.5, 0.5, 1., 0., 0.5, "#(907)")
elif kind ==1:
- # Print an ascii asterisk using plptex
- plschr(0., 8.*size)
- plptex(0.5, 0.5, 1., 0., 0.5, "*")
+ # Print a utf-8 plus
+ plschr(0., 16.*size)
+ plstring(x, y, "+")
elif kind ==2:
- # Print a (PLplot encoded) unicode indexed asterisk using plptex
- plschr(0., 8.*size)
- plptex(0.5, 0.5, 1., 0., 0.5, "#[0x002a]")
+ # Print a utf-8 squared plus
+ plschr(0., 16.*size)
+ plstring(x, y, "⊞")
elif kind ==3:
- # Print a (PLplot encoded) Hershey indexed asterisk using plptex
- plschr(0., 8.*size)
+ # Print a utf-8 heavy plus
+ plschr(0., 16.*size)
+ plstring(x, y, "➕")
+ elif kind ==4:
+ # Print a utf-8 minus
+ plschr(0., 16.*size)
+ plstring(x, y, "-")
+ elif kind ==5:
+ # Print a utf-8 squared minus
+ plschr(0., 16.*size)
+ plstring(x, y, "⊟")
+ elif kind ==6:
+ # Print a utf-8 heay minus
+ plschr(0., 16.*size)
+ plstring(x, y, "➖")
+ elif kind ==7:
+ # Print a utf-8 times
+ plschr(0., 16.*size)
+ plstring(x, y, "×")
+ elif kind ==8:
+ # Print a utf-8 squared times
+ plschr(0., 16.*size)
+ plstring(x, y, "⊠")
+ elif kind ==9:
+ # Print a utf-8 heavy multiplication x
+ plschr(0., 16.*size)
+ plstring(x, y, "✖")
+ elif kind ==10:
+ # Print a utf-8 number sign
+ plschr(0., 16.*size)
+ plstring(x, y, "##")
+ elif kind ==11:
+ # Print a utf-8 full-width number sign
+ plschr(0., 16.*size)
+ plstring(x, y, "#")
+ elif kind ==12:
+ # Print a utf-8 asterisk
+ plschr(0., 16.*size)
+ plstring(x, y, "*")
+ elif kind ==13:
+ # Print a utf-8 four teardrop-spoked asterisk
+ plschr(0., 16.*size)
+ plstring(x, y, "✢" )
+ elif kind ==14:
+ # Print a utf-8 8-spoked asterisk
+ plschr(0., 16.*size)
+ plstring(x, y, "✳")
+ elif kind ==15:
+ # Print a utf-8 asterisk operator
+ plschr(0., 16.*size)
+ plstring(x, y, "∗")
+ elif kind ==16:
+ # Print a utf-8 asterisk operator using plptex
+ plschr(0., 16.*size)
+ plptex(0.5, 0.5, 1., 0., 0.5, "∗")
+ elif kind ==17:
+ # Print a (PLplot encoded) unicode indexed asterisk operator using plptex
+ plschr(0., 16.*size)
+ plptex(0.5, 0.5, 1., 0., 0.5, "#[0x2217]")
+ elif kind ==18:
+ # Print a (PLplot encoded) Hershey indexed asterisk operator using plptex
+ plschr(0., 16.*size)
plptex(0.5, 0.5, 1., 0., 0.5, "#(728)")
- elif kind ==4:
- # Print an asterisk using plsym
- plssym(0., 8.*size)
+ elif kind ==19:
+ # Print an asterisk operator using plsym
+ plssym(0., 16.*size)
plsym(x, y, 728)
- elif kind ==5:
- # Print an asterisk using plpoin
- plssym(0., 8.*size)
+ elif kind ==20:
+ # Print an asterisk operator using plpoin
+ plssym(0., 16.*size)
plpoin(x, y, 3)
- elif kind ==6:
- # Print a (PLplot encoded) Hershey indexed asterisk using plstring
- plschr(0., 8.*size)
+ elif kind ==21:
+ # Print a (PLplot encoded) Hershey indexed asterisk operator using plstring
+ plschr(0., 16.*size)
plstring(x, y, "#(728)")
+ else:
+ print("missing kind value: bad code")
# Terminate plplot
plend()
This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site.
|