165
166
167
168
169
170
171
172
173
174
175
176
177
178
|
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
|
+
|
}
proc createDocFonts {} {
if {[catch {font create docFont -family Helvetica -size -16}]} return
font create docFontB {*}[font configure docFont] -weight bold
set h [font metrics docFont -linespace]
# Use negative size to get pixels. Search from small to bigger
set t [expr {-$h + 4}]
font create docFontP -family Courier -size $t
for {} {$t > -20} {incr t -1} {
font configure docFontP -size $t
if {[font metrics docFontP -linespace] >= $h} break
}
}
|