From 7396369ef190a049b3a779a54edd76ff118f3c28 Mon Sep 17 00:00:00 2001 From: Mystery Man Date: Fri, 21 Nov 2003 12:53:39 +0000 Subject: This commit was manufactured by cvs2svn to create tag 'MDK92-AMD64'. --- perl-install/standalone/drakfont | 24 ++++++++++++++++-------- 1 file changed, 16 insertions(+), 8 deletions(-) (limited to 'perl-install/standalone/drakfont') diff --git a/perl-install/standalone/drakfont b/perl-install/standalone/drakfont index ca7fe9a9e..3dd3010c6 100755 --- a/perl-install/standalone/drakfont +++ b/perl-install/standalone/drakfont @@ -319,10 +319,15 @@ sub convert_fonts { sub convert_ttf_fonts { my ($fonts, $o_generate_pfb) = @_; - convert_fonts($fonts, $o_generate_pfb, "TTF", $ttf2pt1); + convert_fonts($fonts, $ttf2pt1, "TTF", $o_generate_pfb); } +sub move_fonts { + my ($src_dir, $dest_dir, @extensions) = @_; + my @fonts = map { s!.*/!!; $_ } map { glob("$src_dir/*.$_") } @extensions; + system("cd $src_dir && mv @fonts $dest_dir") if @fonts; +} sub put_font_dir() { -e "/usr/share/ghostscript" or do { $gs = 0; print "ghostscript is not installed on your system...\n" }; @@ -334,8 +339,11 @@ sub put_font_dir() { } interactive_progress($pbar1, 0.01, N("done")); interactive_progress($pbar2, 0.10, N("True Type fonts installation")); - glob("$drakfont_dir/tmp/tmp/*.TTF") - and system('cd ' . $drakfont_dir . '/tmp/tmp ; for foo in *.TTF; do mv $foo `basename $foo .TTF`.ttf; done'); + foreach my $font (glob("$drakfont_dir/tmp/tmp/*.TTF")) { + my $newfont = $font; + $newfont =~ s/\.TTF$/.ttf/; + rename($font, $newfont); + } system('cd ' . $drakfont_dir . '/tmp/tmp && cp *.ttf ../../ttf; chmod 644 ../../ttf/*ttf'); interactive_progress($pbar2, 0.20, N("please wait during ttmkfdir...")); @@ -346,16 +354,16 @@ sub put_font_dir() { if ($gs) { convert_ttf_fonts([ glob("$drakfont_dir/tmp/tmp/*.ttf") ], 1); - system(join('', "cd $drakfont_dir/tmp/tmp && mv *.gsf *.pfb *.pfm", if_($so, "*.afm"), " ../Type1")); + move_fonts("$drakfont_dir/tmp/tmp", "../Type1", qw(afm gsf pfb pfm)); system("cd $drakfont_dir/tmp/Type1 && $type1inst"); interactive_progress($pbar2, 0.1, N("type1inst building")); if ($so) { -e "$drakfont_dir/tmp/Type1/Fontmap" and system("cd $drakfont_dir/tmp/Type1 && cat Fontmap >> `rpm -ql ghostscript | grep Fontmap.GS` "); - system("cd $drakfont_dir/tmp/Type1 && mv *.pfm *.gsf *.afm *.pfb ../../Type1 "); + move_fonts("$drakfont_dir/tmp/Type1", "../../Type1", qw(afm gsf pfb pfm)); } else { system("cd $drakfont_dir/tmp/Type1 && cat Fontmap >> `rpm -ql ghostscript | grep Fontmap.GS` "); - system("cd $drakfont_dir/tmp/Type1 && mv *.pfm *.afm *.gsf *.pfb ../../Type1 "); + move_fonts("$drakfont_dir/tmp/Type1", "../../Type1", qw(afm gsf pfb pfm)); } my $type1dir = $drakfont_dir . "/Type1"; system("cd $type1dir && $fccache && $type1inst"); @@ -364,8 +372,8 @@ sub put_font_dir() { } elsif ($so) { convert_ttf_fonts([ glob("$drakfont_dir/tmp/tmp/*.ttf") ]); convert_fonts([ glob("$drakfont_dir/tmp/tmp/*.pfm") ], $pfm2afm, "PFM"); - system("cd $drakfont_dir/tmp/tmp && mv *.afm ../Type1"); - system("cd $drakfont_dir/tmp/Type1 && mv *.afm ../../Type1 "); + move_fonts("$drakfont_dir/tmp/tmp", "../Type1", qw(afm)); + move_fonts("$drakfont_dir/tmp/Type1", "../../Type1", qw(afm)); my $type1dir = $drakfont_dir . "/Type1"; system("cd $type1dir && $fccache && $type1inst"); interactive_progress($pbar2, 0.14, N("type1inst building")); -- cgit v1.2.1