Skip to content

Commit 14fe569

Browse files
committed
Added new test for text as object feature
1 parent 0b2065a commit 14fe569

File tree

2 files changed

+28
-0
lines changed

2 files changed

+28
-0
lines changed

testing/vcs/CMakeLists.txt

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -385,6 +385,10 @@ cdat_add_test(test_vcs_geometry
385385
"${PYTHON_EXECUTABLE}"
386386
${cdat_SOURCE_DIR}/testing/vcs/test_vcs_geometry.py
387387
)
388+
cdat_add_test(test_vcs_text_object
389+
"${PYTHON_EXECUTABLE}"
390+
${cdat_SOURCE_DIR}/testing/vcs/test_vcs_text_object.py
391+
)
388392
##############################################################################
389393
#
390394
# These tests perform plotting and need sample data
Lines changed: 24 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,24 @@
1+
import cdms2, vcs, tempfile
2+
3+
txt = x.createtext()
4+
txt.x = [.0000005,.00000005,.5,.99999,.999999]
5+
txt.y = [0.05,.9,.5,.9,0.05]
6+
txt.string = ["SAMPLE TEXT A","SAMPLE TEXT B","SAMPLE TEXT C","SAMPLE TEXT D","SAMPLE TEXT E"]
7+
txt.halign = "center"
8+
txt.valign = "base"
9+
txt.height = 10
10+
x.plot(txt)
11+
tmpfile = tempfile.mkstemp(suffix='.ps', prefix='tmpTextAsObjectFalse')
12+
x.postscript(tmpfile[1], textAsObject=False)
13+
tmpfile = tempfile.mkstemp(suffix='.ps', prefix='tmpTextAsObjectTrue')
14+
x.postscript(tmpfile[1], textAsObject=True)
15+
16+
tmpfile = tempfile.mkstemp(suffix='.pdf', prefix='tmpTextAsObjectFalse')
17+
x.pdf(tmpfile[1], textAsObject=False)
18+
tmpfile = tempfile.mkstemp(suffix='.pdf', prefix='tmpTextAsObjectTrue')
19+
x.pdf(tmpfile[1], textAsObject=True)
20+
21+
tmpfile = tempfile.mkstemp(suffix='.svg', prefix='tmpTextAsObjectFalse')
22+
x.pdf(tmpfile[1], textAsObject=False)
23+
tmpfile = tempfile.mkstemp(suffix='.svg', prefix='tmpTextAsObjectTrue')
24+
x.pdf(tmpfile[1], textAsObject=True)

0 commit comments

Comments
 (0)