File: fonts

package info (click to toggle)
perl-tk 1:800.025-2
  • links: PTS
  • area: main
  • in suites: sarge
  • size: 18,444 kB
  • ctags: 19,081
  • sloc: ansic: 206,740; perl: 40,187; makefile: 4,371; sh: 2,373; yacc: 762
file content (50 lines) | stat: -rw-r--r-- 980 bytes parent folder | download | duplicates (3)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
#!/usr/local/bin/perl -w
use strict;
use Tk;              
use Data::Dumper;
use Tk::Font;


my $mw = MainWindow->new;

my $b = $mw->Button(-text => 'Quit', -command => [destroy => $mw])->pack;

print 'Families : ',join(',',$b->fontFamilies),"\n";

my $f = $b->cget('-font');               

my @info = $f->actual;
print 'Actual : ',Dumper(\@info);
$f  = $mw->Font(@info);

print Dumper($f);

@info = $f->metrics;
print 'Metrics : ',Dumper(\@info);

print 'Ascent : ',$f->metrics('-ascent'),"\n";

                     
@info = $b->fontNames;
print 'Names : ',Dumper(\@info);
print 'Measure : ',join(',',$f->measure("Hugo")),"\n";

my $name;
my $size = $f->PostscriptFontName($name); 
print "$name @ $size\n";
$b->configure('-font' => $f);

print $f->Pattern,"\n";


my @f = $f->configure;
print 'FConfigure : ',Dumper(\@f);

@f = $f->configure('-family');
print 'FConfigure (arg) : ',Dumper(\@f);

@f = $b->configure('-font');
print 'Configure : ',Dumper($f,\@f);
# MainLoop;