| 1 |
#!/usr/local/bin/perl -w |
| 2 |
|
| 3 |
# XXX Dumps core!!! |
| 4 |
|
| 5 |
use strict; |
| 6 |
use Tk; |
| 7 |
use Data::Dumper; |
| 8 |
use Tk::Font; |
| 9 |
|
| 10 |
|
| 11 |
my $mw = MainWindow->new; |
| 12 |
|
| 13 |
my $b = $mw->Button(-text => 'Quit', -command => [destroy => $mw])->pack; |
| 14 |
|
| 15 |
print 'Families : ',join(',',$b->fontFamilies),"\n"; |
| 16 |
|
| 17 |
my $f = $b->cget('-font'); |
| 18 |
|
| 19 |
my @info = $f->actual; |
| 20 |
print 'Actual : ',Dumper(\@info); |
| 21 |
$f = $mw->Font(@info); |
| 22 |
|
| 23 |
print Dumper($f); |
| 24 |
|
| 25 |
@info = $f->metrics; |
| 26 |
print 'Metrics : ',Dumper(\@info); |
| 27 |
|
| 28 |
print 'Ascent : ',$f->metrics('-ascent'),"\n"; |
| 29 |
|
| 30 |
|
| 31 |
@info = $b->fontNames; |
| 32 |
print 'Names : ',Dumper(\@info); |
| 33 |
print 'Measure : ',join(',',$f->measure("Hugo")),"\n"; |
| 34 |
|
| 35 |
my $name; |
| 36 |
my $size = $f->PostscriptFontName($name); |
| 37 |
print "$name @ $size\n"; |
| 38 |
$b->configure('-font' => $f); |
| 39 |
|
| 40 |
print $f->Pattern,"\n"; |
| 41 |
|
| 42 |
|
| 43 |
my @f = $f->configure; |
| 44 |
print 'FConfigure : ',Dumper(\@f); |
| 45 |
|
| 46 |
@f = $f->configure('-family'); |
| 47 |
print 'FConfigure (arg) : ',Dumper(\@f); |
| 48 |
|
| 49 |
@f = $b->configure('-font'); |
| 50 |
print 'Configure : ',Dumper($f,\@f); |
| 51 |
# MainLoop; |
| 52 |
|
| 53 |
|