From 5374513266ee707dee23ef43db7eba18c7b6cb3b Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Stefan=20Br=C3=BCns?= Date: Fri, 9 Nov 2018 04:15:06 +0100 Subject: [PATCH] Drop X11 core fonts code from startkde/startplasma Summary: Qt and GTK based applications have switched to using fontconfig for fonts exclusively, so this code is mostly unused. As for the remaining legacy X11 applications: - mkfontdir only supports bitmap (e.g. PCF, BDF) fonts. For e.g. truetype fonts, a mkfontscale call would be required. Lack of complaints hints this is not used at all. - the system dirs (sys_odir, sys_fdir) use KDEDIR(S), which is deprecated. The dirs do not exist, thus the fontpath is unchanged. - system dirs are typically allready included in the XServer font path TLDR: (scalable) fonts in user dirs are not picked up due to missing mkfontscale calls, and system dirs are already included. This removes the dependency on xset and mkfontdir. The latter is important, as e.g. on openSUSE the availability of mkfontdir triggers costly, extra setup steps for X Core fonts on package installation. Reviewers: #plasma, fvogt, davidedmundson Reviewed By: #plasma, davidedmundson Subscribers: plasma-devel Tags: #plasma Differential Revision: https://phabricator.kde.org/D16530 --- startkde/startkde.cmake | 43 +------------------------------------- startkde/startplasma.cmake | 43 +------------------------------------- 2 files changed, 2 insertions(+), 84 deletions(-) diff --git a/startkde/startkde.cmake b/startkde/startkde.cmake index cf73405fa..b68f0c681 100644 --- a/startkde/startkde.cmake +++ b/startkde/startkde.cmake @@ -166,48 +166,6 @@ for prefix in `echo $scriptpath`; do done done -# Activate the kde font directories. -# -# There are 4 directories that may be used for supplying fonts for KDE. -# -# There are two system directories. These belong to the administrator. -# There are two user directories, where the user may add her own fonts. -# -# The 'override' versions are for fonts that should come first in the list, -# i.e. if you have a font in your 'override' directory, it will be used in -# preference to any other. -# -# The preference order looks like this: -# user override, system override, X, user, system -# -# Where X is the original font database that was set up before this script -# runs. - -usr_odir=$HOME/.fonts/kde-override -usr_fdir=$HOME/.fonts - -if test -n "$KDEDIRS"; then - kdedirs_first=`echo "$KDEDIRS"|sed -e 's/:.*//'` - sys_odir=$kdedirs_first/share/fonts/override - sys_fdir=$kdedirs_first/share/fonts -else - sys_odir=$KDEDIR/share/fonts/override - sys_fdir=$KDEDIR/share/fonts -fi - -# We run mkfontdir on the user's font dirs (if we have permission) to pick -# up any new fonts they may have installed. If mkfontdir fails, we still -# add the user's dirs to the font path, as they might simply have been made -# read-only by the administrator, for whatever reason. - -test -d "$sys_odir" && xset +fp "$sys_odir" -test -d "$usr_odir" && (mkfontdir "$usr_odir" ; xset +fp "$usr_odir") -test -d "$usr_fdir" && (mkfontdir "$usr_fdir" ; xset fp+ "$usr_fdir") -test -d "$sys_fdir" && xset fp+ "$sys_fdir" - -# Ask X11 to rebuild its font list. -xset fp rehash - # Set a left cursor instead of the standard X11 "X" cursor, since I've heard # from some users that they're confused and don't know what to do. This is # especially necessary on slow machines, where starting KDE takes one or two @@ -219,6 +177,7 @@ xset fp rehash xsetroot -cursor_name left_ptr # Get Ghostscript to look into user's KDE fonts dir for additional Fontmap +usr_fdir=$HOME/.fonts if test -n "$GS_LIB" ; then GS_LIB=$usr_fdir:$GS_LIB export GS_LIB diff --git a/startkde/startplasma.cmake b/startkde/startplasma.cmake index de98541c9..1fe41c59e 100644 --- a/startkde/startplasma.cmake +++ b/startkde/startplasma.cmake @@ -50,48 +50,6 @@ fi #In wayland we want Plasma to use Qt's scaling export PLASMA_USE_QT_SCALING=1 -# Activate the kde font directories. -# -# There are 4 directories that may be used for supplying fonts for KDE. -# -# There are two system directories. These belong to the administrator. -# There are two user directories, where the user may add her own fonts. -# -# The 'override' versions are for fonts that should come first in the list, -# i.e. if you have a font in your 'override' directory, it will be used in -# preference to any other. -# -# The preference order looks like this: -# user override, system override, X, user, system -# -# Where X is the original font database that was set up before this script -# runs. - -usr_odir=$HOME/.fonts/kde-override -usr_fdir=$HOME/.fonts - -if test -n "$KDEDIRS"; then - kdedirs_first=`echo "$KDEDIRS"|sed -e 's/:.*//'` - sys_odir=$kdedirs_first/share/fonts/override - sys_fdir=$kdedirs_first/share/fonts -else - sys_odir=$KDEDIR/share/fonts/override - sys_fdir=$KDEDIR/share/fonts -fi - -# We run mkfontdir on the user's font dirs (if we have permission) to pick -# up any new fonts they may have installed. If mkfontdir fails, we still -# add the user's dirs to the font path, as they might simply have been made -# read-only by the administrator, for whatever reason. - -test -d "$sys_odir" && xset +fp "$sys_odir" -test -d "$usr_odir" && (mkfontdir "$usr_odir" ; xset +fp "$usr_odir") -test -d "$usr_fdir" && (mkfontdir "$usr_fdir" ; xset fp+ "$usr_fdir") -test -d "$sys_fdir" && xset fp+ "$sys_fdir" - -# Ask X11 to rebuild its font list. -xset fp rehash - # Set a left cursor instead of the standard X11 "X" cursor, since I've heard # from some users that they're confused and don't know what to do. This is # especially necessary on slow machines, where starting KDE takes one or two @@ -103,6 +61,7 @@ xset fp rehash xsetroot -cursor_name left_ptr # Get Ghostscript to look into user's KDE fonts dir for additional Fontmap +usr_fdir=$HOME/.fonts if test -n "$GS_LIB" ; then GS_LIB=$usr_fdir:$GS_LIB export GS_LIB