- updated to 20150423:

* hide local system family preference list when user's one is
    in action

OBS-URL: https://build.opensuse.org/package/show/M17N/fonts-config?expand=0&rev=67
This commit is contained in:
Petr Gajdos 2015-04-23 12:39:45 +00:00 committed by Git OBS Bridge
parent 487c9a0028
commit b8b735cf4b
2 changed files with 37 additions and 15 deletions

View File

@ -327,7 +327,7 @@ use Env;
use strict; use strict;
my $script_start_time = time(); my $script_start_time = time();
my $version = 20150421; my $version = 20150423;
# #
# OPTIONS # OPTIONS
@ -1273,7 +1273,7 @@ sub rendering_options {
# #
sub family_preference_list { sub family_preference_list {
my ($family, $prefered_families) = @_; my ($family, $prefered_families, $user) = @_;
my $cfg; my $cfg;
my @families = split(/:/, $prefered_families); my @families = split(/:/, $prefered_families);
@ -1293,9 +1293,12 @@ sub family_preference_list {
$family =~ s/&/&/g; $family =~ s/&/&/g;
if (! $OPT_FORCE_FPL) { if (! $OPT_FORCE_FPL) {
$cfg .= " <alias>\n"; $cfg .= "\t<alias>\n";
$cfg .= " <family>$family</family>\n"; if (!$user) {
$cfg .= " <prefer>\n"; $cfg .= "\t\t<test name=\"user_preference_list\"><bool>false</bool></test>\n"
}
$cfg .= "\t\t<family>$family</family>\n";
$cfg .= "\t\t<prefer>\n";
for my $f (@families) { for my $f (@families) {
$f =~ s/&/&amp;/g; $f =~ s/&/&amp;/g;
$cfg .= " <family>$f</family>\n"; $cfg .= " <family>$f</family>\n";
@ -1303,12 +1306,12 @@ sub family_preference_list {
print "[$f] "; print "[$f] ";
} }
} }
$cfg .= " </prefer>\n"; $cfg .= "\t\t</prefer>\n";
$cfg .= " </alias>\n"; $cfg .= "\t</alias>\n";
} else { } else {
$cfg .= " <match>\n"; $cfg .= "\t<match>\n";
$cfg .= " <test name=\"family\"><string>$family</string></test>\n"; $cfg .= "\t\t<test name=\"family\"><string>$family</string></test>\n";
$cfg .= " <edit name=\"family\" mode=\"prepend_first\" binding=\"strong\">\n"; $cfg .= "\t\t<edit name=\"family\" mode=\"prepend_first\" binding=\"strong\">\n";
for my $f (@families) { for my $f (@families) {
$f =~ s/&/&amp;/g; $f =~ s/&/&amp;/g;
$cfg .= " <string>$f</string>\n"; $cfg .= " <string>$f</string>\n";
@ -1316,8 +1319,8 @@ sub family_preference_list {
print "[$f] "; print "[$f] ";
} }
} }
$cfg .= " </edit>\n"; $cfg .= "\t\t</edit>\n";
$cfg .= " </match>\n"; $cfg .= "\t</match>\n";
} }
if ($VERBOSITY >= $VERBOSITY_DEBUG) { if ($VERBOSITY >= $VERBOSITY_DEBUG) {
print "\n"; print "\n";
@ -1414,12 +1417,24 @@ sub family_preference_config {
$suse_pref .= "<fontconfig>\n"; $suse_pref .= "<fontconfig>\n";
if (!$user) { if (!$user) {
$suse_pref .= "\t<!-- Let user override here defined system setting. -->\n"; $suse_pref .= "\t<!-- Let user override here defined system setting. -->\n";
$suse_pref .= "\t<match target=\"pattern\">\n";
$suse_pref .= "\t\t<edit name=\"user_preference_list\" mode=\"assign\">\n";
$suse_pref .= "\t\t\t<bool>false</bool>\n";
$suse_pref .= "\t\t</edit>\n";
$suse_pref .= "\t</match>\n";
$suse_pref .= "\t<include ignore_missing=\"yes\" prefix=\"xdg\">fontconfig/family-prefer.conf</include>\n"; $suse_pref .= "\t<include ignore_missing=\"yes\" prefix=\"xdg\">fontconfig/family-prefer.conf</include>\n";
} }
else {
$suse_pref .= "\t<match target=\"pattern\">\n";
$suse_pref .= "\t\t<edit name=\"user_preference_list\" mode=\"assign\">\n";
$suse_pref .= "\t\t\t<bool>true</bool>\n";
$suse_pref .= "\t\t</edit>\n";
$suse_pref .= "\t</match>\n";
}
$suse_pref .= "\n"; $suse_pref .= "\n";
$suse_pref .= family_preference_list("sans-serif", $OPT_SANS_FAMILIES); $suse_pref .= family_preference_list("sans-serif", $OPT_SANS_FAMILIES, $user);
$suse_pref .= family_preference_list("serif", $OPT_SERIF_FAMILIES); $suse_pref .= family_preference_list("serif", $OPT_SERIF_FAMILIES, $user);
$suse_pref .= family_preference_list("monospace", $OPT_MONO_FAMILIES); $suse_pref .= family_preference_list("monospace", $OPT_MONO_FAMILIES, $user);
$suse_pref .= "</fontconfig>\n"; $suse_pref .= "</fontconfig>\n";
if ($VERBOSITY >= $VERBOSITY_DEBUG) { if ($VERBOSITY >= $VERBOSITY_DEBUG) {

View File

@ -1,3 +1,10 @@
-------------------------------------------------------------------
Thu Apr 23 12:02:33 UTC 2015 - pgajdos@suse.com
- updated to 20150423:
* hide local system family preference list when user's one is
in action
------------------------------------------------------------------- -------------------------------------------------------------------
Tue Apr 21 13:34:43 UTC 2015 - pgajdos@suse.com Tue Apr 21 13:34:43 UTC 2015 - pgajdos@suse.com