mirror of
https://git.FreeBSD.org/ports.git
synced 2024-11-01 22:05:08 +00:00
237 lines
5.2 KiB
Plaintext
237 lines
5.2 KiB
Plaintext
|
#!/usr/bin/perl
|
||
|
|
||
|
# Font setting Perl script for GIMP
|
||
|
#
|
||
|
# by MANTANI Nobutaka <nobutaka@nobutaka.com>
|
||
|
|
||
|
$progname = "gimp.setfont";
|
||
|
$version = "Version 0.1 Mar 1 1999";
|
||
|
|
||
|
# Show usage
|
||
|
sub usage() {
|
||
|
print <<EOF;
|
||
|
Usage: gimp.setfont <language>
|
||
|
|
||
|
----------------------------------------------------------------
|
||
|
[language] [fontset]
|
||
|
dutch -*-helvetica-(iso8859-1)
|
||
|
english -*-helvetica-(iso8859-1)
|
||
|
finnish -*-helvetica-(iso8859-1)
|
||
|
french -*-helvetica-(iso8859-1)
|
||
|
german -*-helvetica-(iso8859-1)
|
||
|
hungarian -*-helvetica-(iso8859-2)
|
||
|
italian -*-helvetica-(iso8859-1)
|
||
|
japanese -*-fixed-(iso8859-1,jisx0201,jisx0208)
|
||
|
korean -*-fixed-(iso8859-1)/-daewoo-gothic-(ksc5601)
|
||
|
polish -*-helvetica-(iso8859-2)
|
||
|
swedish -*-helvetica-(iso8859-1)
|
||
|
----------------------------------------------------------------
|
||
|
|
||
|
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, "${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 "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 = "-*-helvetica-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.1978-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 "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;
|
||
|
}
|
||
|
|
||
|
usage();
|
||
|
exit;
|