public inbox for gentoo-dev@lists.gentoo.org
 help / color / mirror / Atom feed
* [gentoo-dev] font.eclass add Xorg FontPath elements for non-standard paths
@ 2013-07-03 23:07 Michael Weber
  2013-07-04  6:24 ` About teams having inactive people (Was:Re: [gentoo-dev] font.eclass add Xorg FontPath elements for non-standard paths) Pacho Ramos
                   ` (3 more replies)
  0 siblings, 4 replies; 14+ messages in thread
From: Michael Weber @ 2013-07-03 23:07 UTC (permalink / raw
  To: gentoo development

[-- Attachment #1: Type: text/plain, Size: 1929 bytes --]

-----BEGIN PGP SIGNED MESSAGE-----
Hash: SHA256

Hello,

as Ondrej Grover pointed out on [1], the font.eclass installs font
files and indexes (font.dir, fonts.scale) into sub-dirs of
/usr/share/fonts/, e.g. /usr/share/fonts/terminus.

These directories are naturally not in the fontpath of Xorg server,
and could not be used without adding these with xset fp+.
As said on the bug, the Xserver itself should be abled to find all
fonts, and it's not the duty of the xinitrc/window-manager to collect
all these paths in the users process.

I'd like to propose a patch to font.eclass to add the newly created
paths to the Xorg server configuration via xorg.conf.d files [2].
I contacted fonts alias and, as mentioned on the bug and irc, Ben de
Groot (yngwin) does not object and says that font team lead Peter
Volkov (pva) is non-active.

Please review for technical problems (esp. for EPREFIX).

Open questions:

- - Should the (current) default xorg server paths
  /usr/share/fonts/{75dpi,100dpi,misc,TTF,OTF,TYPE1} really be excluded?
  How would the startup and font lookup perfomance degrade with
  multiple conf.d files, containing the same path multiple times?

- - How would already installed font packages see this fix?
  Revbump (and stabilize) every one of them?

- - Alternative solutions would be installing fonts in xorg-servers
  default paths or add one configuration file that gets newly
  assembled  on every font_pkg_postinst run.

Thanks

[1] https://bugs.gentoo.org/475488
[2] /etc/X11/xorg.conf.d/90-${PN}-${SLOT}.conf
- -- 
Michael Weber
Gentoo Developer
web: https://xmw.de/
mailto: Michael Weber <xmw@gentoo.org>
-----BEGIN PGP SIGNATURE-----
Version: GnuPG v2.0.20 (GNU/Linux)
Comment: Using GnuPG with Thunderbird - http://www.enigmail.net/

iF4EAREIAAYFAlHUrpsACgkQknrdDGLu8JA5rAEAgIALUkh/4qdikCnArjdsj2LP
v1MLlq9IQ8Mfv7WmWKkA/RDz6oJgDcl5k4bdSpJwFq5ORE64CWe0E82S927oVcH+
=UDJ7
-----END PGP SIGNATURE-----

[-- Attachment #2: font.eclass.patch --]
[-- Type: text/x-patch, Size: 2412 bytes --]

Index: font.eclass
===================================================================
RCS file: /var/cvsroot/gentoo-x86/eclass/font.eclass,v
retrieving revision 1.56
diff -u -B -r1.56 font.eclass
--- font.eclass	9 Jun 2013 02:08:23 -0000	1.56
+++ font.eclass	3 Jul 2013 23:02:55 -0000
@@ -9,7 +9,7 @@
 
 inherit eutils
 
-EXPORT_FUNCTIONS pkg_setup src_install pkg_postinst pkg_postrm
+EXPORT_FUNCTIONS pkg_setup src_install pkg_preinst pkg_postinst pkg_postrm
 
 # @ECLASS-VARIABLE: FONT_SUFFIX
 # @DEFAULT_UNSET
@@ -25,6 +25,13 @@
 # Working directory containing the fonts.
 FONT_S=${FONT_S:-${S}}
 
+# @ECLASS-VARIABLE: FONT_SLOT
+# @DEFAULT_UNSET
+# @REQUIRED
+# @DESCRIPTION:
+# Slot of the installed font package
+FONT_SLOT=${FONT_SLOT:-${SLOT}}
+
 # @ECLASS-VARIABLE: FONT_PN
 # @DESCRIPTION:
 # Font name (ie. last part of FONTDIR).
@@ -35,6 +42,13 @@
 # Full path to installation directory.
 FONTDIR=${FONTDIR:-/usr/share/fonts/${FONT_PN}}
 
+# @ECLASS-VARIABLE: FONT_X11_CONF
+# @DEFAULT_UNSET
+# @REQUIRED
+# @DESCRIPTION:
+# X11 config file containing the additional fontpath element.
+FONT_X11_CONF=${FONT_X11_CONF:-/etc/X11/xorg.conf.d/90-${FONT_PN}-${FONT_SLOT}.conf}
+
 # @ECLASS-VARIABLE: FONT_CONF
 # @DEFAULT_UNSET
 # @DESCRIPTION:
@@ -74,6 +88,21 @@
 		if [[ -e ${FONT_S}/fonts.alias ]] ; then
 			doins "${FONT_S}"/fonts.alias
 		fi
+		if [[ -n ${FONT_X11_CONF} ]] &&
+			[[ ${FONTDIR} != /usr/share/fonts/75dpi ]] &&
+			[[ ${FONTDIR} != /usr/share/fonts/100dpi ]] &&
+			[[ ${FONTDIR} != /usr/share/fonts/misc ]] &&
+			[[ ${FONTDIR} != /usr/share/fonts/TTF ]] &&
+			[[ ${FONTDIR} != /usr/share/fonts/OTF ]] &&
+			[[ ${FONTDIR} != /usr/share/fonts/TYPE1 ]] ; then 
+			{
+				echo "Section \"Files\""
+				echo "    FontPath \"${FONTDIR}\""
+				echo "EndSection"
+			} > ${T}/$(basename ${FONT_X11_CONF})
+			insinto /etc/X11/xorg.conf.d
+			doins ${T}/$(basename ${FONT_X11_CONF})
+		fi
 	fi
 }
 
@@ -188,6 +217,18 @@
 	done
 }
 
+# @FUNCTION: font_pkg_preinst
+# @DESCRIPTION:
+# The font pkg_preinst function.
+font_pkg_preinst() {
+	if has X ${USE} && [[ -n "${FONT_X11_CONF}" ]] &&
+		! [[ -e ${EROOT}${FONT_X11_CONF} ]] ; then
+		elog "A new path element has been added to x11 fontpath."
+		elog "Either restart your x11 sessions or run"
+		elog "xset fp+ ${FONTDIR} ; xset fp rehash"
+	fi
+}
+
 # @FUNCTION: font_pkg_postinst
 # @DESCRIPTION:
 # The font pkg_postinst function.

[-- Attachment #3: font.eclass.patch.sig --]
[-- Type: application/pgp-signature, Size: 96 bytes --]

^ permalink raw reply	[flat|nested] 14+ messages in thread

end of thread, other threads:[~2013-07-05  7:18 UTC | newest]

Thread overview: 14+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2013-07-03 23:07 [gentoo-dev] font.eclass add Xorg FontPath elements for non-standard paths Michael Weber
2013-07-04  6:24 ` About teams having inactive people (Was:Re: [gentoo-dev] font.eclass add Xorg FontPath elements for non-standard paths) Pacho Ramos
2013-07-04  9:26   ` Markos Chandras
2013-07-04 10:09     ` [gentoo-dev] font.eclass add Xorg FontPath elements for non-standard paths Michael Weber
2013-07-04 12:10 ` Gilles Dartiguelongue
2013-07-04 12:24   ` Michael Weber
2013-07-04 14:33     ` Michael Weber
2013-07-04 14:45       ` Fabian Groffen
2013-07-04 14:48   ` Michael Weber
2013-07-04 19:42   ` Michał Górny
2013-07-04 22:36 ` [gentoo-dev] " Ryan Hill
2013-07-05  5:41   ` Ben de Groot
2013-07-05  6:37 ` [gentoo-dev] " James Cloos
2013-07-05  7:18   ` Michael Weber

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox