summaryrefslogtreecommitdiffstats
path: root/perl-install/standalone/drakfont
diff options
context:
space:
mode:
authorMystery Man <unknown@mandriva.org>2003-11-21 12:53:39 +0000
committerMystery Man <unknown@mandriva.org>2003-11-21 12:53:39 +0000
commit7396369ef190a049b3a779a54edd76ff118f3c28 (patch)
tree20c2a6d7fcd96433d0d91b1460b5604a6d7267ce /perl-install/standalone/drakfont
parente41742b093fdb26bcae87e9d5b30d4d7bca93ea9 (diff)
downloaddrakx-backup-do-not-use-7396369ef190a049b3a779a54edd76ff118f3c28.tar
drakx-backup-do-not-use-7396369ef190a049b3a779a54edd76ff118f3c28.tar.gz
drakx-backup-do-not-use-7396369ef190a049b3a779a54edd76ff118f3c28.tar.bz2
drakx-backup-do-not-use-7396369ef190a049b3a779a54edd76ff118f3c28.tar.xz
drakx-backup-do-not-use-7396369ef190a049b3a779a54edd76ff118f3c28.zip
This commit was manufactured by cvs2svn to create tag 'MDK92-AMD64'.MDK92-AMD64
Diffstat (limited to 'perl-install/standalone/drakfont')
-rwxr-xr-xperl-install/standalone/drakfont24
1 files changed, 16 insertions, 8 deletions
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"));