initial fonts feature
This includes an updated version of 50-fontconfig script which actually works (the preliminary one attached to #28612 didn't); thanks zerg@ and cow@ for providing the incentive to introduce it. Based on m-p-d and installer-feature-kdesktop-fontconfig.
This commit is contained in:
parent
e03f103169
commit
5f44404182
11
features.in/fonts/config.mk
Normal file
11
features.in/fonts/config.mk
Normal file
@ -0,0 +1,11 @@
|
||||
use/fonts:
|
||||
@$(call add_feature)
|
||||
@$(call xport,FONT_FEATURES_ENABLE)
|
||||
@$(call xport,FONT_FEATURES_DISABLE)
|
||||
|
||||
# just stating that kernels and font habits are pretty individual
|
||||
use/fonts/zerg: use/fonts
|
||||
@$(call set,FONT_FEATURES_ENABLE,antialias lcdfilter-default \
|
||||
hinting style-full sub-pixel-rgb)
|
||||
@$(call set,FONT_FEATURES_DISABLE,no-antialias lcdfilter-none \
|
||||
unhinted no-sub-pixel)
|
33
features.in/fonts/stage2/image-scripts.d/50-fontconfig
Executable file
33
features.in/fonts/stage2/image-scripts.d/50-fontconfig
Executable file
@ -0,0 +1,33 @@
|
||||
#!/bin/sh
|
||||
# fontconfig-config-config
|
||||
|
||||
verbose="${GLOBAL_VERBOSE:+-v}"
|
||||
verbose() { [ -z "$GLOBAL_VERBOSE" ] || echo "HOOK: 50-fontconfig: $@"; }
|
||||
verbose "has started"
|
||||
|
||||
CONF_DIR="/etc/fonts/conf.d"
|
||||
AVAIL_DIR="/etc/fonts/conf.avail"
|
||||
|
||||
list() { ls "$1"/??-"$2".conf 2>/dev/null; }
|
||||
|
||||
enable() {
|
||||
for i in "$@"; do
|
||||
if ! list "$CONF_DIR" "$i"; then
|
||||
AVAIL="$(list "$AVAIL_DIR" "$i" | head -1)"
|
||||
if [ -n "$AVAIL" ]; then
|
||||
ln -s $verbose "$AVAIL" "$CONF_DIR/$CONF_ADD"
|
||||
fi
|
||||
fi
|
||||
done
|
||||
}
|
||||
|
||||
disable() {
|
||||
for i in "$@"; do
|
||||
$(list "$CONF_DIR" "$i") | xargs -r rm -f $verbose --
|
||||
done
|
||||
}
|
||||
|
||||
disable $GLOBAL_FONT_FEATURES_DISABLE
|
||||
enable $GLOBAL_FONT_FEATURES_ENABLE
|
||||
|
||||
:
|
Loading…
Reference in New Issue
Block a user