neingeist
/
arduinisten
Archived
1
0
Fork 0
You cannot select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
This repo is archived. You can view files and clone it, but cannot push or open issues/pull-requests.

27 lines
923 B
Tcl

# font.tcl - Font handling.
# Copyright (C) 1997 Cygnus Solutions.
# Written by Tom Tromey <tromey@cygnus.com>.
# This function is called whenever a font preference changes. We use
# this information to update the appropriate symbolic font.
proc FONT_track_change {symbolic prefname value} {
eval font configure [list $symbolic] $value
}
# Primary interface to font handling.
# define_font SYMBOLIC_NAME ARGS
# Define a new font, named SYMBOLIC_NAME. ARGS is the default font
# specification; it is a list of options such as those passed to `font
# create'.
proc define_font {symbolic args} {
# We do a little trick with the names here, by inserting `font' in
# the appropriate place in the name.
set split [split $symbolic /]
set name [join [linsert $split 1 font] /]
pref define $name $args
eval font create [list $symbolic] [pref get $name]
pref add_hook $name [list FONT_track_change $symbolic]
}