|
From: <ai...@us...> - 2012-04-26 23:23:00
|
Revision: 12191
http://plplot.svn.sourceforge.net/plplot/?rev=12191&view=rev
Author: airwin
Date: 2012-04-26 23:22:53 +0000 (Thu, 26 Apr 2012)
Log Message:
-----------
Add simple test example that demonstrates what happens for line breaks
mixed in with unicode text.
Modified Paths:
--------------
trunk/examples/python/CMakeLists.txt
Added Paths:
-----------
trunk/examples/python/test_linebreak.py
Modified: trunk/examples/python/CMakeLists.txt
===================================================================
--- trunk/examples/python/CMakeLists.txt 2012-04-20 23:12:46 UTC (rev 12190)
+++ trunk/examples/python/CMakeLists.txt 2012-04-26 23:22:53 UTC (rev 12191)
@@ -90,6 +90,7 @@
test_type1.py
test_hebrew_diacritic.py
test_style.py
+ test_linebreak.py
)
if(ENABLE_tk)
Added: trunk/examples/python/test_linebreak.py
===================================================================
--- trunk/examples/python/test_linebreak.py (rev 0)
+++ trunk/examples/python/test_linebreak.py 2012-04-26 23:22:53 UTC (rev 12191)
@@ -0,0 +1,43 @@
+#!/usr/bin/env python
+# -*- coding: utf-8; -*-
+# Test whether line breaks work for utf8 "Peace" strings.
+# Append to effective python path so that can find plplot modules.
+from plplot_python_start import *
+
+import sys
+from plplot import *
+from numpy import *
+
+# Taken from http://www.columbia.edu/~fdc/pace/
+
+peace = [
+ "(Mandarin) 和平",
+ "(Hindi) शांति",
+ "(English) Peace",
+ "(Hebrew) שלום",
+ "(Russian) Мир",
+ "(German) Friede",
+ "(Korean) 평화",
+ "(French) Paix",
+ "(Spanish) Paz",
+ "(Arabic) ﺳﻼم",
+ "(Turkish) Barış",
+ "(Kurdish) Hasîtî",
+ ]
+
+# Parse and process command line arguments
+plparseopts(sys.argv, PL_PARSE_FULL)
+
+# Initialize plplot
+plinit()
+plcol0(2)
+pladv(0)
+plvpor(0.1, 0.9, 0.1, 0.9)
+plwind(0., 1., 0., 1.)
+# Just to show edges of viewport
+plbox("bc", 0., 0, "bc", 0., 0)
+plcol0(1)
+plschr(0., 1.5)
+for i in arange(6):
+ plptex(0.05, 0.95 - 0.166*i, 1., 0., 0., peace[2*i] + "\n" + peace[2*i+1])
+plend()
Property changes on: trunk/examples/python/test_linebreak.py
___________________________________________________________________
Added: svn:executable
+ *
Added: svn:keywords
+ Author Date Id Revision
Added: svn:eol-style
+ native
This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site.
|