summaryrefslogtreecommitdiffstats
path: root/perl-install/lang.pm
diff options
context:
space:
mode:
authorPablo Saratxaga <pablo@mandriva.com>2002-02-22 16:07:27 +0000
committerPablo Saratxaga <pablo@mandriva.com>2002-02-22 16:07:27 +0000
commit594a4b500045cb5bbc0ad4014f8e84ad537c02b8 (patch)
tree52f93896fe14e73f18421773e1f14b56790f1992 /perl-install/lang.pm
parentc4110f9cf07c60fd3305f33bc2f62df9f2dd44ef (diff)
downloaddrakx-594a4b500045cb5bbc0ad4014f8e84ad537c02b8.tar
drakx-594a4b500045cb5bbc0ad4014f8e84ad537c02b8.tar.gz
drakx-594a4b500045cb5bbc0ad4014f8e84ad537c02b8.tar.bz2
drakx-594a4b500045cb5bbc0ad4014f8e84ad537c02b8.tar.xz
drakx-594a4b500045cb5bbc0ad4014f8e84ad537c02b8.zip
start of support of kde fonts
Diffstat (limited to 'perl-install/lang.pm')
-rw-r--r--perl-install/lang.pm70
1 files changed, 70 insertions, 0 deletions
diff --git a/perl-install/lang.pm b/perl-install/lang.pm
index ba7283e79..f77cc2b3a 100644
--- a/perl-install/lang.pm
+++ b/perl-install/lang.pm
@@ -409,12 +409,26 @@ my %charset2kde_charset = (
#- for special cases not handled magically
my %lang2country = (
+ af => 'za',
+ be => 'by',
+ br => 'fr',
+ bs => 'bh',
cs => 'cz',
+ cy => 'gb',
da => 'dk',
el => 'gr',
et => 'ee',
+ he => 'il',
+ ja => 'jp',
+ ko => 'kr',
mi => 'nz',
+ ms => 'my',
+ nn => 'no',
sl => 'si',
+ sp => 'yu',
+ sr => 'yu',
+ sv => 'se',
+ wa => 'be',
);
#-######################################################################################
@@ -533,6 +547,41 @@ sub charset2kde_charset {
$r || $default || 'iso10646-1';
}
+#- font+size for different charsets; the field [0] is the default,
+#- others are overrridens for fixed(1), toolbar(2), menu(3) and taskbar(4)
+my %kdefonts = (
+'iso-8859-1' => [ "adobe-helvetica,12", "courier,10", "adobe-helvetica,11"
+'iso-8859-2' => [ "adobe-helvetica,12", "courier,10", "adobe-helvetica,11"
+'iso-8859-9' => [ "adobe-helvetica,12", "courier,10", "adobe-helvetica,11"
+'iso-8859-15' => [ "adobe-helvetica,12", "courier,10", "adobe-helvetica,11"
+'gb2312' => [ "default-ming,16" ],
+'euc-jp' => [ "misc-fixed,14", "wadalab-gothic,13" ],
+'euc-kr' => [ "daewoo-gothic,16" ],
+'Big5' => [ "taipei-fixed,16" ],
+'utf_hy' => [ "clearlyu,17" ],
+'utf_ka' => [ "clearlyu,17" ],
+'utf_vi' => [ "misc-fixed,13", "misc-fixed,13", "misc-fixed,10", ],
+'def' => [ "misc-fixed,13", "misc-fixed,13", "misc-fixed,10", ],
+);
+
+sub kdefont {
+ my ($lang, $type) = @_;
+ my $charset = lang2charset($lang);
+ my $kdecharset = charset2kde_charset(lang2charset($lang));
+
+ my $r;
+ $r ||= ($kdefonts{$charset})->[$type || 0];
+ $r ||= ($kdefonts{$charset})->[0];
+ $r ||= ($kdefonts{'def'})->[$type || 0];
+ $r ||= ($kdefonts{'def'})->[0];
+
+#- the format is "font-name,size,5,kdecharset,0,0" I have no idea of the
+#- meaning of that "5"...
+ $r = $r . ",5," . $kdecharset . ",0,0";
+
+ $r;
+}
+
sub set {
my ($lang, $translate_for_console) = @_;
@@ -696,6 +745,27 @@ sub write {
Country => lang2country($lang, $prefix),
Language => lang2kde_lang($lang),
));
+#- The following calls to update_gnomekderc() should be done only if the
+#- user switched to a different charset encoding
+ update_gnomekderc($prefix . ($user_only ? "$ENV{HOME}/.kde" : '/usr') . '/share/config/kdeglobals',
+ WM => (
+ activeFont => kdefont($lang,0),
+ ),
+ General => (
+ fixed => kdefont($lang, 1),
+ font => kdefont($lang, 0),
+ menuFont => kdefont($lang, 3),
+ taskbarFont => kdefont($lang, 4),
+ toolBarFont => kdefont($lang, 2),
+ ));
+ update_gnomekderc($prefix . ($user_only ? "$ENV{HOME}/.kde" : '/usr') . '/share/config/konquerorrc',
+ FMSettings => (
+ StandardFont => kdefont($lang, 0),
+ ));
+ update_gnomekderc($prefix . ($user_only ? "$ENV{HOME}/.kde" : '/usr') . '/share/config/kdesktoprc',
+ FMSettings => (
+ StandardFont => kdefont($lang, 0),
+ ));
};
}