TextProp TCL UTILITIES USER MANUAL TextProp
SYNOPSIS
Set current text characteristics
PACKAGE
TCLGPH
NAME
TextProp
USAGE
TextProp  Size { Font } { Bold } { Italics }
INPUT DEFINITIONS
Size - The text size in points (1/72 inch).
Font - An optional input which specifies the current text font. The default value is HOLD which keeps the currently loaded font. If a requested font is not available on the system, the software will attempt to make a best match to one which is available.
Bold - An optional input which specifies if text should be output bold or not. The default value is HOLD which keeps the currently selected bold state. Set to ON for bold text and OFF for normal text.
Italics - An optional input which specifies if text should be output in italics or not. The default value is HOLD which keeps the currently selected italic state. Set to ON for italic text and OFF for normal text.
RETURN DEFINITION
NONE
DESCRIPTION
TextProp sets the text characteristics. This includes the text size, font, weight (bold/normal), and slant (roman/italics). Not all of the text properties requested may be available on the local system in which cast the internal Tk algorithms will attempt to provide a best match. Bold and italics can both be set to on and fonts which have this property will make use of them.
ERRORS
None Generated
C BACKING
No
EXAMPLE(S)
EXAMPLE 1: Show line styles and examples of filled polygons.
# INITIALIZE the default gui settings

GUIprefsRead

# SET a window size

set GphInfo(xsScrL) 600
set GphInfo(ysScrL) 500
set GphInfo(xScrL) 600
set GphInfo(yScrL) 500

# START graphics

GraphicsOn TK RainBow SWAP

# ESTABLISH a graphics window coverting the whole canvas 

GenWindow 0 0.0 0.0 0.0 1.0 1.0 1.0 -6.0 -6.0 0.0 6.0 6.0 0.0

# OUTPUT these fonts with these sizes

set FonTs [list fixed times helvetica lucidabright utopia courier]
set nF [llength $FonTs]
set Sizes [list 10 14]
set nS [llength $Sizes]

# SET up dual loops.  Outer loops over fonts and inner over sizes. Foreach
#   font and size show bold, italic, and bold italic text.

set Y 5.5
for { set J 0 } { $J < $nF } { incr J } {
   set Ft [lindex $FonTs $J]
   for { set I 0 } { $I < $nS } { incr I } {
      set Sz [lindex $Sizes $I]
      TextProp $Sz $Ft 
      TexT 0 -5.5 $Y 0.0 right "$Ft - Size $Sz" $GphInfo(White)
      puts stderr [font actual $Ft]
      TextProp $Sz HOLD ON
      TexT 0 -1.0 $Y 0.0 right Bold $GphInfo(White)
      TextProp $Sz HOLD OFF ON
      TexT 0 0.5 $Y 0.0 right Italics $GphInfo(White)
      TextProp $Sz HOLD ON ON
      TexT 0 2.5 $Y 0.0 right "Bold Italics" $GphInfo(White)
      set Y [expr $Y - 1.0]
   }
}
      
Feb 15, 2007