1 package Font::TTF::Win32;
4 # use vars qw($HKEY_LOCAL_MACHINE);
15 my ($font_key) = 'SOFTWARE\Microsoft\Windows' . (Win32::IsWinNT() ? ' NT' : '') . '\CurrentVersion\Fonts';
16 my ($regFont, $list, $l, $font, $file);
18 # get entry from registry for a font of this name
19 $::HKEY_LOCAL_MACHINE->Open($font_key, $regFont);
20 $regFont->GetValues($list);
22 foreach $l (sort keys %{$list})
24 my ($fname) = $list->{$l}[0];
25 next unless ($fname =~ s/\(TrueType\)$//o);
26 $file = File::Spec->rel2abs($list->{$l}[2], "$ENV{'windir'}/fonts");
27 $font = Font::TTF::Font->open($file) || next;
28 &{$sub}($font, $fname);