1
C $Id: x23f.fm4,v 1.3 2006/05/13 18:05:33 airwin Exp $
3
C Displays Greek letters and mathematically interesting Unicode ranges
5
C Copyright (C) 2005 Alan Irwin
6
C Copyright (C) 2005 Andrew Ross
9
C This file is part of PLplot.
11
C PLplot is free software; you can redistribute it and/or modify
12
C it under the terms of the GNU General Library Public License as published
13
C by the Free Software Foundation; either version 2 of the License, or
14
C (at your option) any later version.
16
C PLplot is distributed in the hope that it will be useful,
17
C but WITHOUT ANY WARRANTY; without even the implied warranty of
18
C MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
19
C GNU Library General Public License for more details.
21
C You should have received a copy of the GNU Library General Public License
22
C along with PLplot; if not, write to the Free Software
23
C Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
30
real*8 xmin, xmax, ymin, ymax, ycharacter_scale, yoffset
31
real*8 chardef, charht, deltax, deltay, x, y
32
integer i, j, page, length, slice
33
character*20 cmdString
36
parameter(PL_PARSE_FULL = 1)
39
C Displays Greek letters and mathematically interesting Unicode ranges
43
character*80 title(11)
50
data (greek(i) ,i=1,48) /
51
& '#gA','#gB','#gG','#gD','#gE','#gZ',
52
& '#gY','#gH','#gI','#gK','#gL','#gM',
53
& '#gN','#gC','#gO','#gP','#gR','#gS',
54
& '#gT','#gU','#gF','#gX','#gQ','#gW',
55
& '#ga','#gb','#gg','#gd','#ge','#gz',
56
& '#gy','#gh','#gi','#gk','#gl','#gm',
57
& '#gn','#gc','#go','#gp','#gr','#gs',
58
& '#gt','#gu','#gf','#gx','#gq','#gw' /
60
data (type1(i) ,i=1,75) /
61
& z'0020',z'0021',z'0023',z'0025',z'0026',
62
& z'0028',z'0029',z'002b',z'002c',z'002e',
63
& z'002f',z'0030',z'0031',z'0032',z'0033',
64
& z'0034',z'0035',z'0036',z'0037',z'0038',
65
& z'0039',z'003a',z'003b',z'003c',z'003d',
66
& z'003e',z'003f',z'005b',z'005d',z'005f',
67
& z'007b',z'007c',z'007d',z'00a9',z'00ac',
68
& z'00ae',z'00b0',z'00b1',z'00d7',z'00f7',
69
& z'0192',z'0391',z'0392',z'0393',z'0394',
70
& z'0395',z'0396',z'0397',z'0398',z'0399',
71
& z'039a',z'039b',z'039c',z'039d',z'039e',
72
& z'039f',z'03a0',z'03a1',z'03a3',z'03a4',
73
& z'03a5',z'03a6',z'03a7',z'03a8',z'03a9',
74
& z'03b1',z'03b2',z'03b3',z'03b4',z'03b5',
75
& z'03b6',z'03b7',z'03b8',z'03b9',z'03ba' /
76
data (type1(i) ,i=76,166) /
77
& z'03bb',z'03bc',z'03bd',z'03be',z'03bf',
78
& z'03c0',z'03c1',z'03c2',z'03c3',z'03c4',
79
& z'03c5',z'03c6',z'03c7',z'03c8',z'03c9',
80
& z'03d1',z'03d2',z'03d5',z'03d6',z'2022',
81
& z'2026',z'2032',z'2033',z'203e',z'2044',
82
& z'2111',z'2118',z'211c',z'2122',z'2126',
83
& z'2135',z'2190',z'2191',z'2192',z'2193',
84
& z'2194',z'21b5',z'21d0',z'21d1',z'21d2',
85
& z'21d3',z'21d4',z'2200',z'2202',z'2203',
86
& z'2205',z'2206',z'2207',z'2208',z'2209',
87
& z'220b',z'220f',z'2211',z'2212',z'2215',
88
& z'2217',z'221a',z'221d',z'221e',z'2220',
89
& z'2227',z'2228',z'2229',z'222a',z'222b',
90
& z'2234',z'223c',z'2245',z'2248',z'2260',
91
& z'2261',z'2264',z'2265',z'2282',z'2283',
92
& z'2284',z'2286',z'2287',z'2295',z'2297',
93
& z'22a5',z'22c5',z'2320',z'2321',z'2329',
94
& z'232a',z'25ca',z'2660',z'2663',z'2665',
97
data (title(i) ,i=1,11 )/
98
& "#<0x10>PLplot Example 23 - Greek Letters",
99
& "#<0x10>PLplot Example 23 - Type 1 Symbol Font Glyphs by Unicode
101
& "#<0x10>PLplot Example 23 - Type 1 Symbol Font Glyphs by Unicode
103
& "#<0x10>PLplot Example 23 - Type 1 Symbol Font Glyphs by Unicode
105
& "#<0x10>PLplot Example 23 - Number Forms Unicode Block",
106
& "#<0x10>PLplot Example 23 - Arrows Unicode Block (a)",
107
& "#<0x10>PLplot Example 23 - Arrows Unicode Block (b)",
108
& "#<0x10>PLplot Example 23 - Mathematical Operators Unicode Block
110
& "#<0x10>PLplot Example 23 - Mathematical Operators Unicode Block
112
& "#<0x10>PLplot Example 23 - Mathematical Operators Unicode Block
114
& "#<0x10>PLplot Example 23 - Mathematical Operators Unicode Block
117
data (lo(i) ,i=1,11) /
130
data (hi(i) ,i=1,11) /
143
data (nxcells(i) ,i=1,11) /
156
data (nycells(i) ,i=1,11) /
169
C non-zero values Must be consistent with nxcells and nycells. */
170
data (offset(i) ,i=1,11) /
183
call plparseopts(PL_PARSE_FULL)
190
C Set up viewport and window
192
call plvpor(0.02d0, 0.98d0, 0.02d0, 0.90d0)
193
call plwind(0.0d0, 1.0d0, 0.0d0, 1.0d0)
194
call plgspa(xmin, xmax, ymin, ymax)
195
call plschr(0.d0, 0.8d0)
196
ycharacter_scale = (1.0d0 - 0.0d0)/(ymax-ymin)
198
C Factor should be 0.5, but heuristically it turns out to be larger.
200
call plgchr(chardef, charht)
201
yoffset = 1.0d0*charht*ycharacter_scale
203
C Draw the grid using plbox
206
deltax = 1.0d0/nxcells(page)
207
deltay = 1.0d0/nycells(page)
208
call plbox("bcg", deltax, 0, "bcg", deltay, 0)
210
length=hi(page)-lo(page)
212
do 120 j=nycells(page),0,-1
214
do 110 i=1,nxcells(page)
216
if (slice .le. length) then
217
if (page .eq. 1) then
218
write(cmdString, '("#",a)') Greek(slice)
219
elseif (page .ge. 1 .and. page .le. 4) then
220
write(cmdString, '("##[0x",z4.4,"]")')
221
& type1(offset(page)+slice)
222
C Not required for command which is case insensitive,
223
C but lowercase the command simply to get same
224
C lowercase display of command as corresponding C example.
225
call lowercase23(cmdString)
226
elseif (page .ge. 5) then
227
write(cmdString, '("##[0x",z4.4,"]")')
229
C Not required for command which is case insensitive,
230
C but lowercase the command simply to get same
231
C lowercase display of command as corresponding C example.
232
call lowercase23(cmdString)
234
call plptex(x,y+yoffset,1.d0,0.d0,0.5d0,
236
call plptex(x,y-yoffset,1.d0,0.d0,0.5d0,
244
call plschr(0.d0, 1.0d0)
245
call plmtex("t", 1.5d0, 0.5d0, 0.5d0, title(page))
256
subroutine lowercase23(string)
259
integer i, len, iascii
260
do i = 1, len(string)
261
iascii = iachar(string(i:i))
262
if(65.le.iascii.and.iascii.le.90) then
263
C convert uppercase to lowercase.
264
string(i:i) = achar(iascii+32)