The following example illustrates how to specify the font to be used in Tk windows/widgets. If you
explicitly add the option font=MyFont to every widget you create (where possible),
then you only have to change MyFont in one place, if for example you wish to use a
bigger font for a presentation with a projector. You may wish to define a few different fonts -
one fixed with font, one font for headings, etc.
require(tcltk) tt <- tktoplevel() fontHeading <- tkfont.create(family="times",size=24,weight="bold",slant="italic") fontTextLabel <- tkfont.create(family="times",size=12) fontFixedWidth <- tkfont.create(family="courier",size=12) tkgrid(tklabel(tt,text="A Nice Big Font for the Heading",font=fontHeading)) tkgrid(tklabel(tt,text=" ")) tkgrid(tklabel(tt,text="A normal text label.",font=fontTextLabel)) tkgrid(tklabel(tt,text=" ")) tkgrid(tklabel(tt,text="A fixed width font.",font=fontFixedWidth,background="white")) tkgrid(tklabel(tt,text=" ")) tkfocus(tt)

Note the choice of adding blank lines explicitly rather than using absolute grid references. If you use absolute grid references (e.g. place the heading in row 0, place the text label in row 2, and place the fixed width text in row 4), then you will run into trouble if you want to insert something else in the middle of your window - all your row numbers will have to change! There is probably a better way to do this, but the method shown above works well for me at the moment. The code above would not work if you created only one tklabel for a blank line and tried to attach it (with tkgrid) several times. You must create separate tklabels for this to work.