2 idl_pvwave comment ; NAME:
3 idl_pvwave comment ; SHOWFONT
5 idl_pvwave comment ; PURPOSE:
6 idl_pvwave comment ; Uses current graphics device to draw a map of characters
7 idl_pvwave comment ; available in the font specified in argument
9 idl_pvwave comment ; CATEGORY:
10 idl_pvwave comment ; General
12 idl_pvwave comment ; CALLING SEQUENCE:
13 idl_pvwave comment ; showfont, num, 'title' ; table of font num entitled 'title'
15 idl_pvwave comment ; KEYWORD PARAMETERS:
16 idl_pvwave comment ; /encapsulated ; ignored (just for compatibility)
17 idl_pvwave comment ; /tt_font ; ignored (just for compatibility)
18 idl_pvwave comment ; base = 16 ; number of columns in the table
19 idl_pvwave comment ; beg = 32 ; first character
20 idl_pvwave comment ; fin = num eq 3 ? 255 : 127 ; last character
22 idl_pvwave comment ; OUTPUTS:
23 idl_pvwave comment ; None.
25 idl_pvwave comment ; OPTIONAL OUTPUTS:
26 idl_pvwave comment ; None.
28 idl_pvwave comment ; COMMON BLOCKS:
29 idl_pvwave comment ; None.
31 idl_pvwave comment ; SIDE EFFECTS:
32 idl_pvwave comment ; Draws a font table on the current graphic device.
34 idl_pvwave comment ; RESTRICTIONS:
35 idl_pvwave comment ; None.
37 idl_pvwave comment ; PROCEDURE:
39 idl_pvwave comment ; EXAMPLE:
40 idl_pvwave comment ; showfont, 9, 'GDL math symbols' ; show mappings for font 9
42 idl_pvwave comment ; MODIFICATION HISTORY:
43 idl_pvwave comment ; Written by: Sylwester Arabas (2008/12/28)
45 idl_pvwave comment ; LICENCE:
46 idl_pvwave comment ; Copyright (C) 2008,
47 idl_pvwave comment ; This program is free software; you can redistribute it and/or modify
48 idl_pvwave comment ; it under the terms of the GNU General Public License as published by
49 idl_pvwave comment ; the Free Software Foundation; either version 2 of the License, or
50 idl_pvwave comment ; (at your option) any later version.
53 idl_pvwave code pro showfont, num, name, encapsulated=eps, tt_font=tt, base=base, beg=beg, fin=fin
55 idl_pvwave comment ; handling default keyword values
56 idl_pvwave code if not keyword_set(base) then base = 16
57 idl_pvwave code if not keyword_set(beg) then beg = 32
58 idl_pvwave code if not keyword_set(fin) then fin = num eq 3 ? 255 : 127
59 idl_pvwave code if not keyword_set(name) then name = ''
61 idl_pvwave comment ; constructing horizontal and vertical grid lines
62 idl_pvwave code n_hor = (fin + 1 - beg) / base + 1
63 idl_pvwave code h_x = (double(rebin(base * byte(128 * indgen(2 * (n_hor))) / 128, 4 * n_hor, /sample)))[1:4 * n_hor - 1] - .5
64 idl_pvwave code h_y = (double(rebin(beg + indgen(n_hor) * base, 4 * n_hor, /sample)))[0:4 * n_hor - 2] - base/2.
65 idl_pvwave code v_x = base - indgen(4 * base - 1) / 4 - .5
66 idl_pvwave code v_y = (double(rebin(byte(128 * indgen(2 * (base))) / 128, 4 * base, /sample)))[1:4 * base - 1] $
67 idl_pvwave code * base * ((fin + 1 - beg) / base) + beg - base / 2.
69 idl_pvwave comment ; ploting grid and title
70 idl_pvwave code plot, [h_x, v_x], [h_y, v_y], $
71 idl_pvwave code title='Font ' + strtrim(string(num), 2) + ', ' + name, $
72 idl_pvwave code xrange=[-1, base], $
73 idl_pvwave code yrange=[base * ((fin + 1) / base), beg - base], $
74 idl_pvwave code yticks=n_hor, $
75 idl_pvwave code xticks=base+1, $
76 idl_pvwave code xtitle='char mod ' + strtrim(string(base), 2), $
77 idl_pvwave code ytitle=strtrim(string(base), 2) + ' * (char / ' + strtrim(string(base), 2) + ')'
79 idl_pvwave comment ; ploting characters
80 idl_pvwave code for c = beg, fin do $
81 idl_pvwave code xyouts, (c mod base), base * (c / base), '!' + strtrim(string(num), 2) + string(byte(c))