C.2. Font Methods
The following methods are available only with the newest version of Perl/Tk, which contains Tk8.0.
C.2.1. Create
The fontCreatemethod creates a new font.
$name = $widget->fontCreate();
$name = $widget->fontCreate(fontname);
You can either specify a font name or one will be generated in the format "fontX" where X is a number. You can specify options for the font:
$name = $widget->fontCreate(-size => 12);
$name = $widget->fontCreate(fontname, -size => 12);
The options you can use to create a font are as follows:
-family =>name
The family name can be "courier", "times", or "helvetica". If you specify one of these, the closest match on your system will be used. You can also specify the name of a font that is specific to your machine (for example, "Moon Runes"), but it might not show up on other systems.
-size =>amount
The amount specified for the font size indicates how big you want the font to be. If the amount is positive, the font will be sized in points. If the amount is negative, the font will be sized by using the absolute value of the amount in pixels.
-weight => "normal" | "bold"
The -weight option determines the thickness of the font.
-slant => "roman" | "italic"
The slant of the font is how far it tips over to one side. By default, "roman"means that the font is upright. Specifying "italic" as the value for -slant will tilt the font to the right slightly.
-underline => 0 | 1
If you want the characters to be underlined, specify 1 for the -underlineoption. ...