summaryrefslogtreecommitdiffstats
path: root/perl-install/lang.pm
diff options
context:
space:
mode:
authorThierry Vignaud <thierry.vignaud@gmail.com>2016-09-21 20:51:13 +0200
committerThierry Vignaud <thierry.vignaud@gmail.com>2016-09-21 20:51:13 +0200
commitf4e7daf7b77358431b82f97ebb14910ff9988751 (patch)
tree4ff75ef9d4c7801244423d19f36b0268932689c0 /perl-install/lang.pm
parent012bca800fdcddcd8aac7f65de602a45b0f70236 (diff)
downloaddrakx-f4e7daf7b77358431b82f97ebb14910ff9988751.tar
drakx-f4e7daf7b77358431b82f97ebb14910ff9988751.tar.gz
drakx-f4e7daf7b77358431b82f97ebb14910ff9988751.tar.bz2
drakx-f4e7daf7b77358431b82f97ebb14910ff9988751.tar.xz
drakx-f4e7daf7b77358431b82f97ebb14910ff9988751.zip
use new CSS syntax for font (mga#19430)
thus fixing gtk+-3.22 regression
Diffstat (limited to 'perl-install/lang.pm')
-rw-r--r--perl-install/lang.pm24
1 files changed, 24 insertions, 0 deletions
diff --git a/perl-install/lang.pm b/perl-install/lang.pm
index d6f096a57..9e2127d35 100644
--- a/perl-install/lang.pm
+++ b/perl-install/lang.pm
@@ -1239,6 +1239,20 @@ sub charset2pango_font {
$charset2pango_font{$charset} || $charset2pango_font{default};
}
+=item charset2css_font ($charset)
+
+Returns the font to use with $charset or the default one if non is set
+
+=cut
+
+sub charset2css_font {
+ my ($charset) = @_;
+
+ my $font = $charset2pango_font{$charset} || $charset2pango_font{default};
+ my ($familly, $size) = $font =~ /(.*) (\d+)$/;
+ return "font-family: $familly; font-size: ${size}pt;";
+}
+
sub l2pango_font {
my ($lang) = @_;
@@ -1249,6 +1263,16 @@ sub l2pango_font {
return $font;
}
+sub l2css_font {
+ my ($lang) = @_;
+
+ my $charset = l2charset($lang) or log::l("no charset found for lang $lang!"), return;
+ my $font = charset2css_font($charset);
+ log::l("lang:$lang charset:$charset font:$font consolefont:$charsets{$charset}[0]");
+
+ return $font;
+}
+
=back
=head1 Other functions