/usr/share/doc/graphviz/examples/demo/entities.tcl is in graphviz-doc 2.38.0-7.
This file is owned by root:root, with mode 0o755.
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 | #!/bin/sh
# next line is a comment in tcl \
exec tclsh "$0" ${1+"$@"}
package require Gdtclft
# Create a table of all HTML 4.0 Entities in a PNG image.
#
# John Ellson <ellson@graphviz.org>
#set font symbol
set font freesans
set titlefont times
set gd [gd create 1100 850]
set white [gd color new $gd 255 255 255]
set black [gd color new $gd 0 0 0]
set red [gd color new $gd 255 0 0]
set green [gd color new $gd 0 255 0]
proc incr_rowcol {} {
upvar 1 row row col col x1 x1 x2 x2 x3 x3 y y
if {! ($row % 40)} {
set x1 [expr $col * 120 + 10]
set x2 [expr $x1 + 30]
set x3 [expr $x1 + 60]
incr col
set y 10
}
incr row
incr y 20
}
# lay down a title on the background
gd text $gd $green $titlefont 50. .7 350 500 "HTML 4.0 Entities\r\nfont = $font"
set row 0
set col 0
# first initialize names for asci characters 32-126 to themselves
for {set val 32} {$val < 127} {incr val} {
set entity($val) [format {%c} $val]
}
# get other names for html-4.0 characters from:
# http://www.w3.org/TR/REC-html40/sgml/entities.html
set f [open entities.html r]
while {! [eof $f]} {
set rec [gets $f]
if {[scan $rec {<!ENTITY %s CDATA "&#%d;" --} name val] == 2} {
set entity($val) $name
}
}
# sort and render
foreach val [lsort -integer [array names entity]] {
incr_rowcol
if {$entity($val) == "hearts" || $entity($val) == "diams"} {
# just for fun!
set fontcolor $red
} {
set fontcolor $black
}
gd text $gd $black $titlefont 8. 0. $x1 $y [format {%5d} $val]
gd text $gd $fontcolor $font 16. 0. $x2 $y [format {&#%d;} $val]
gd text $gd $black $titlefont 12. 0. $x3 $y $entity($val)
}
close $f
set f stdout
#set f [open entities.png w]
#set f [open "| xv -" w]
gd writePNG $gd $f
#close $f
|