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