1 //
2 //  Unicode Pace Flag
3 //
4 //  Copyright (C) 2005 Rafael Laboissiere
5 //
6 //
7 //  This file is part of PLplot.
8 //
9 //  PLplot is free software; you can redistribute it and/or modify
10 //  it under the terms of the GNU Library General Public License as published
11 //  by the Free Software Foundation; either version 2 of the License, or
12 //  (at your option) any later version.
13 //
14 //  PLplot is distributed in the hope that it will be useful,
15 //  but WITHOUT ANY WARRANTY; without even the implied warranty of
16 //  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
17 //  GNU Library General Public License for more details.
18 //
19 //  You should have received a copy of the GNU Library General Public License
20 //  along with PLplot; if not, write to the Free Software
21 //  Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
22 //
23 //
24 // For Debian, the required font packages are the following:
25 // ttf-arphic-bkai00mp
26 // ttf-freefont
27 // ttf-devanagari-fonts
28 // ttf-unfonts
29 // ttf-bengali-fonts
30 //
31 // For the latest Ubuntu systems lohit_hi.ttf has been moved to the
32 // ttf-indic-fonts-core package instead of ttf-devanagari-fonts so you
33 // will have to use this package instead and update the font path.
34 //
35 
36 
37 #include "plcdemos.h"
38 
39 static PLINT red[] = { 240, 204, 204, 204, 0, 39, 125 };
40 static PLINT green[] = { 240, 0, 125, 204, 204, 80, 0 };
41 static PLINT blue[] = { 240, 0, 0, 0, 0, 204, 125 };
42 
43 static PLFLT px[] = { 0.0, 0.0, 1.0, 1.0 };
44 static PLFLT py[] = { 0.0, 0.25, 0.25, 0.0 };
45 
46 static PLFLT sx[] = {
47     0.16374,
48     0.15844,
49     0.15255,
50     0.17332,
51     0.50436,
52     0.51721,
53     0.49520,
54     0.48713,
55     0.83976,
56     0.81688,
57     0.82231,
58     0.82647
59 };
60 
61 static PLFLT sy[] = {
62     0.125,
63     0.375,
64     0.625,
65     0.875,
66     0.125,
67     0.375,
68     0.625,
69     0.875,
70     0.125,
71     0.375,
72     0.625,
73     0.875
74 };
75 
76 
77 // Taken from http://www.columbia.edu/~fdc/pace/
78 
79 static PLCHAR_VECTOR peace[] = {
80     // Mandarin
81     "#<0x00>和平",
82     // Hindi
83     "#<0x20>शांति",
84     // English
85     "#<0x10>Peace",
86     // Hebrew
87     "#<0x10>שלום",
88     // Russian
89     "#<0x10>Мир",
90     // German
91     "#<0x10>Friede",
92     // Korean
93     "#<0x30>평화",
94     // French
95     "#<0x10>Paix",
96     // Spanish
97     "#<0x10>Paz",
98     // Arabic
99     "#<0x10>ﺳﻼم",
100     // Turkish
101     "#<0x10>Barış",
102     // Kurdish
103     "#<0x10>Hasîtî",
104 };
105 
106 int
main(int argc,char * argv[])107 main( int argc, char *argv[] )
108 {
109     int i, j;
110 
111     plparseopts( &argc, argv, PL_PARSE_FULL );
112 
113     plinit();
114 
115     pladv( 0 );
116     plvpor( 0.0, 1.0, 0.0, 1.0 );
117     plwind( 0.0, 1.0, 0.0, 1.0 );
118     plcol0( 0 );
119     plbox( "", 1.0, 0, "", 1.0, 0 );
120 
121     plscmap0n( 7 );
122     plscmap0( red, green, blue, 7 );
123 
124     plschr( 0, 4.0 );
125     plfont( 1 );
126 
127     for ( i = 0; i < 4; i++ )
128     {
129         plcol0( i + 1 );
130         plfill( 4, px, py );
131 
132         for ( j = 0; j < 4; j++ )
133             py [j] += 1.0 / 4.0;
134     }
135 
136     plcol0( 0 );
137     for ( i = 0; i < 12; i++ )
138         plptex( sx [i], sy [i], 1.0, 0.0, 0.5, peace [i] );
139 
140 
141     plend();
142     exit( 0 );
143 }
144 
145