$VERSION = '3.023'; # $Id: //depot/Tk8/Tk/Font.pm#23 $
use overload '""' => 'as_string';
sub as_string { return ${$_[0]} }
*MainWindow = \&Tk::Widget::MainWindow;
foreach my $key (qw(actual metrics measure configure))
*{$key} = sub { shift->Tk::font
($key,@_) };
Construct Tk
::Widget
'Font';
my @xfield = qw(foundry family weight slant swidth adstyle pixel
point xres yres space avgwidth registry encoding);
my @tkfield = qw(family size weight slant underline overstrike);
my %tkfield = map { $_ => "-$_" } @tkfield;
sub _xonly
{ my $old = '*'; return $old }
my $old = $me->configure('-size');
$old = '*' if ($old > 0);
$me->configure(-size
=> -$_[0]);
my $old = 10*$me->configure('-size');
$old = '*' if ($old < 0);
$me->configure(-size
=> int($_[0]/10));
foreach my $f (@tkfield,@xfield)
*{$sub} = sub { shift->configure($key,@_) };
$me = $w->Tk::font
('create',@_);
croak
'Odd number of args' if @_ & 1;
my $t = (substr($k,0,1) eq '-') ?
$k : $tkfield{$k};
$attr{'-size'} = -int($v/10+0.5);
carp
"$k ignored" if $^W
;
$me = $w->Tk::font
('create',%attr);
$str =~ s/(?:Times\s+New\s+Roman|New York)/Times/i;
$str =~ s/(?:Courier\s+New|Monaco)/Courier/i;
$str =~ s/(?:Arial|Geneva)/Helvetica/i;
$str = 'medium' if ($str eq 'normal');
return join('-', '', @str);
return $$me if (!wantarray || ($^O
eq 'MSWin32'));
return $d->XListFonts($me->Pattern,$max);
return ref($me)->new($me,$me->actual,@_);
return shift->metrics('-ascent');
return shift->metrics('-descent');