5124750055
PR: 14572 Submitted by: MANTANI Nobutaka <nobutaka@nobutaka.com>
299 lines
6.6 KiB
Perl
299 lines
6.6 KiB
Perl
#!/usr/bin/perl
|
|
|
|
# Font setting Perl script for GIMP
|
|
#
|
|
# by MANTANI Nobutaka <nobutaka@nobutaka.com>
|
|
|
|
$progname = "gimp.setfont";
|
|
$version = "Version 0.3 Sep 22 1999";
|
|
|
|
# Show usage
|
|
sub usage() {
|
|
print <<EOF;
|
|
Usage: gimp.setfont <language>
|
|
|
|
----------------------------------------------------------------
|
|
[language] [fontset]
|
|
czech -*-fixed-(iso8859-2)
|
|
danish -*-helvetica-(iso8859-1)
|
|
dutch -*-helvetica-(iso8859-1)
|
|
english -*-helvetica-(iso8859-1)
|
|
finnish -*-helvetica-(iso8859-1)
|
|
french -*-helvetica-(iso8859-1)
|
|
german -*-helvetica-(iso8859-1)
|
|
hungarian -*-fixed-(iso8859-2)
|
|
italian -*-helvetica-(iso8859-1)
|
|
japanese -*-fixed-(iso8859-1,jisx0201,jisx0208)
|
|
korean -*-fixed-(iso8859-1),-daewoo-gothic-(ksc5601)
|
|
polish -*-fixed-(iso8859-2)
|
|
russian -*-helvetica-(koi8-r)
|
|
swedish -*-helvetica-(iso8859-1)
|
|
norwegian -*-helvetica-(iso8859-1)
|
|
----------------------------------------------------------------
|
|
|
|
If you need iso8859-2 fonts, please install etlfonts
|
|
(ports/x11-fonts/etlfonts).
|
|
|
|
EOF
|
|
}
|
|
|
|
# Write gtkrc of user's .gimp-1.1 directory
|
|
sub write_gtkrc($) {
|
|
$fontset = shift;
|
|
$path = "$ENV{'HOME'}/.gimp-1.1";
|
|
|
|
if (-d $path) {
|
|
if (-e "$path/gtkrc") {
|
|
chmod(0644, "$path/gtkrc");
|
|
print "Renaming $path/gtkrc to ${path}/gtkrc.old...\n";
|
|
rename("${path}/gtkrc", "${path}/gtkrc.old");
|
|
}
|
|
|
|
print "Writing $path/gtkrc...\n";
|
|
open(FILE, ">$path/gtkrc");
|
|
print FILE <<EOF;
|
|
\# style <name> [= <name>]
|
|
\# {
|
|
\# <option>
|
|
\# }
|
|
\#
|
|
\# widget <widget_set> style <style_name>
|
|
\# widget_class <widget_class_set> style <style_name>
|
|
|
|
style "default"
|
|
{
|
|
fontset = "$fontset"
|
|
}
|
|
|
|
widget_class "*" style "default"
|
|
EOF
|
|
close(FILE);
|
|
print "Done.\n\n";
|
|
} else {
|
|
print <<EOF;
|
|
Directory $path is not found.
|
|
Please execute "gimp" and install files into $path
|
|
directory first.
|
|
|
|
EOF
|
|
exit;
|
|
}
|
|
}
|
|
|
|
$lang = $ARGV[0];
|
|
$fontset = "";
|
|
|
|
print <<EOF;
|
|
|
|
$progname - Font setting utility for GIMP ($version)
|
|
|
|
EOF
|
|
|
|
if (@ARGV != 1) {
|
|
usage();
|
|
exit;
|
|
}
|
|
|
|
if ($lang eq "czech") {
|
|
$fontset = "-*-fixed-medium-r-normal--14-*-*-*-*-*-iso8859-2";
|
|
|
|
print "Setting for Czech language...\n\n";
|
|
|
|
write_gtkrc($fontset);
|
|
|
|
print <<EOF;
|
|
Please set "LANG" environment variable to "cs_CZ.ISO8859-2" and execute "gimp".
|
|
And please make symbolic link from lt_LN.ISO_8859-2 to cs_CZ.ISO8859-2 in
|
|
/usr/share/locale.
|
|
|
|
EOF
|
|
exit;
|
|
}
|
|
|
|
if ($lang eq "danish") {
|
|
$fontset = "-*-helvetica-medium-r-normal--14-*-*-*-*-*-iso8859-1";
|
|
|
|
print "Setting for Danish language...\n\n";
|
|
|
|
write_gtkrc($fontset);
|
|
|
|
print <<EOF;
|
|
Please set "LANG" environment variable to "da_DK.ISO_8859-1" and execute "gimp".
|
|
|
|
EOF
|
|
exit;
|
|
}
|
|
|
|
if ($lang eq "dutch") {
|
|
$fontset = "-*-helvetica-medium-r-normal--14-*-*-*-*-*-iso8859-1";
|
|
|
|
print "Setting for Dutch language...\n\n";
|
|
|
|
write_gtkrc($fontset);
|
|
|
|
print <<EOF;
|
|
Please set "LANG" environment variable to "nl_NL.ISO_8859-1" and execute "gimp".
|
|
|
|
EOF
|
|
exit;
|
|
}
|
|
|
|
if ($lang eq "english") {
|
|
$fontset = "-*-helvetica-medium-r-normal--14-*-*-*-*-*-iso8859-1";
|
|
print "Setting for English language...\n\n";
|
|
|
|
write_gtkrc($fontset);
|
|
|
|
print <<EOF;
|
|
Please set "LANG" environment variable to "C" and execute "gimp".
|
|
|
|
EOF
|
|
exit;
|
|
}
|
|
|
|
if ($lang eq "finnish") {
|
|
$fontset = "-*-helvetica-medium-r-normal--14-*-*-*-*-*-iso8859-1";
|
|
print "Setting for Finnish language...\n\n";
|
|
|
|
write_gtkrc($fontset);
|
|
|
|
print <<EOF;
|
|
Please set "LANG" environment variable to "fi_FI.ISO_8859-1" and execute "gimp".
|
|
|
|
EOF
|
|
exit;
|
|
}
|
|
|
|
if ($lang eq "french") {
|
|
$fontset = "-*-helvetica-medium-r-normal--14-*-*-*-*-*-iso8859-1";
|
|
print "Setting for French language...\n\n";
|
|
|
|
write_gtkrc($fontset);
|
|
|
|
print <<EOF;
|
|
Please set "LANG" environment variable to "fr_FR.ISO_8859-1" and execute "gimp".
|
|
|
|
EOF
|
|
exit;
|
|
}
|
|
|
|
if ($lang eq "german") {
|
|
$fontset = "-*-helvetica-medium-r-normal--14-*-*-*-*-*-iso8859-1";
|
|
print "Setting for German language...\n\n";
|
|
|
|
write_gtkrc($fontset);
|
|
|
|
print <<EOF;
|
|
Please set "LANG" environment variable to "de_DE.ISO_8859-1" and execute "gimp".
|
|
|
|
EOF
|
|
exit;
|
|
}
|
|
|
|
if ($lang eq "hungarian") {
|
|
$fontset = "-*-fixed-medium-r-normal--14-*-*-*-*-*-iso8859-2";
|
|
print "Setting for Hungarian language...\n\n";
|
|
|
|
write_gtkrc($fontset);
|
|
|
|
print <<EOF;
|
|
Please set "LANG" environment variable to "hu_HU.ISO_8859-2" and execute "gimp".
|
|
|
|
EOF
|
|
exit;
|
|
}
|
|
|
|
if ($lang eq "italian") {
|
|
$fontset = "-*-helvetica-medium-r-normal--14-*-*-*-*-*-iso8859-1";
|
|
print "Setting for Italian language...\n\n";
|
|
|
|
write_gtkrc($fontset);
|
|
|
|
print <<EOF;
|
|
Please set "LANG" environment variable to "it_IT.ISO_8859-1" and execute "gimp".
|
|
|
|
EOF
|
|
exit;
|
|
}
|
|
|
|
if ($lang eq "japanese") {
|
|
$fontset = "-*-fixed-medium-r-normal--14-*-*-*-*-*-iso8859-1,-*-fixed-medium-r-normal--14-*-*-*-*-*-jisx0201.1976-0,-*-fixed-medium-r-normal--14-*-*-*-*-*-jisx0208.1983-0";
|
|
print "Setting for Japanese language...\n\n";
|
|
|
|
write_gtkrc($fontset);
|
|
|
|
print <<EOF;
|
|
Please set "LANG" environment variable to "ja_JP.EUC" and execute "gimp".
|
|
|
|
EOF
|
|
exit;
|
|
}
|
|
|
|
if ($lang eq "korean") {
|
|
$fontset = "-*-fixed-medium-r-normal--16-*-*-*-*-*-iso8859-1,-daewoo-gothic-medium-r-normal--16-*-*-*-*-*-ksc5601.1987-0";
|
|
print "Setting for Korean language...\n\n";
|
|
|
|
write_gtkrc($fontset);
|
|
|
|
print <<EOF;
|
|
Please set "LANG" environment variable to "ko_KR.EUC" and execute "gimp".
|
|
|
|
EOF
|
|
exit;
|
|
}
|
|
|
|
if ($lang eq "polish") {
|
|
$fontset = "-*-fixed-medium-r-normal--14-*-*-*-*-*-iso8859-2";
|
|
print "Setting for Polish language...\n\n";
|
|
|
|
write_gtkrc($fontset);
|
|
|
|
print <<EOF;
|
|
Please set "LANG" environment variable to "pl_PL.ISO_8859-2" and execute "gimp".
|
|
|
|
EOF
|
|
exit;
|
|
}
|
|
|
|
if ($lang eq "russian") {
|
|
$fontset = "-*-helvetica-medium-r-normal--14-*-*-*-*-*-koi8-r";
|
|
print "Setting for Russian language...\n\n";
|
|
|
|
write_gtkrc($fontset);
|
|
|
|
print <<EOF;
|
|
Please set "LANG" environment variable to "ru_SU.KOI8-R" and execute "gimp".
|
|
|
|
EOF
|
|
exit;
|
|
}
|
|
|
|
if ($lang eq "swedish") {
|
|
$fontset = "-*-helvetica-medium-r-normal--14-*-*-*-*-*-iso8859-1";
|
|
print "Setting for Swedish language...\n\n";
|
|
|
|
write_gtkrc($fontset);
|
|
|
|
print <<EOF;
|
|
Please set "LANG" environment variable to "sv_SE.ISO_8859-1" and execute "gimp".
|
|
|
|
EOF
|
|
exit;
|
|
}
|
|
|
|
if ($lang eq "norwegian") {
|
|
$fontset = "-*-helvetica-medium-r-normal--14-*-*-*-*-*-iso8859-1";
|
|
print "Setting for Norwegian language...\n\n";
|
|
|
|
write_gtkrc($fontset);
|
|
|
|
print <<EOF;
|
|
Please set "LANG" environment variable to "no_NO.ISO_8859-1" and execute "gimp".
|
|
|
|
EOF
|
|
exit;
|
|
}
|
|
|
|
usage();
|
|
exit;
|