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

* About teams having inactive people (Was:Re: [gentoo-dev] font.eclass add Xorg FontPath elements for non-standard paths)
  2013-07-03 23:07 [gentoo-dev] font.eclass add Xorg FontPath elements for non-standard paths Michael Weber
@ 2013-07-04  6:24 ` Pacho Ramos
  2013-07-04  9:26   ` Markos Chandras
  2013-07-04 12:10 ` Gilles Dartiguelongue
                   ` (2 subsequent siblings)
  3 siblings, 1 reply; 14+ messages in thread
From: Pacho Ramos @ 2013-07-04  6:24 UTC (permalink / raw
  To: gentoo-dev; +Cc: fonts

El jue, 04-07-2013 a las 01:07 +0200, Michael Weber escribió:
[...]
> 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.

Why fonts team doesn't elect a new lead then? Thanks for the info :)



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

* Re: About teams having inactive people (Was:Re: [gentoo-dev] font.eclass add Xorg FontPath elements for non-standard paths)
  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
  0 siblings, 1 reply; 14+ messages in thread
From: Markos Chandras @ 2013-07-04  9:26 UTC (permalink / raw
  To: gentoo-dev; +Cc: fonts

On 4 July 2013 07:24, Pacho Ramos <pacho@gentoo.org> wrote:
> El jue, 04-07-2013 a las 01:07 +0200, Michael Weber escribió:
> [...]
>> 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.
>
> Why fonts team doesn't elect a new lead then? Thanks for the info :)
>
>

I am not sure how a new leader alone would help. The team needs active
members :)

--
Regards,
Markos Chandras - Gentoo Linux Developer
http://dev.gentoo.org/~hwoarang


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

* Re: [gentoo-dev] font.eclass add Xorg FontPath elements for non-standard paths
  2013-07-04  9:26   ` Markos Chandras
@ 2013-07-04 10:09     ` Michael Weber
  0 siblings, 0 replies; 14+ messages in thread
From: Michael Weber @ 2013-07-04 10:09 UTC (permalink / raw
  To: gentoo-dev; +Cc: fonts

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

On 07/04/2013 11:26 AM, Markos Chandras wrote:
> On 4 July 2013 07:24, Pacho Ramos <pacho@gentoo.org> wrote:
>> El jue, 04-07-2013 a las 01:07 +0200, Michael Weber escribió: 
>> [...]
>>> 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.
>> 
>> Why fonts team doesn't elect a new lead then? Thanks for the info
>> :)
Non technical -> project-ml

> I am not sure how a new leader alone would help. The team needs
> active members :)
dito.

I fell it kinda hard to get an technical discussion these days.
Can we keep to point once, pls?

Like having multiple files containing FontPath doesn't work out?
Besides the fonts in the compiled-in/default paths, only the urw show up.
Is it possible to get xorg server attributes? xset only has setters.


michael@x ~ % for i in /etc/X11/xorg.conf.d/90*.conf ; do echo $i ;
cat $i ; echo ; done
/etc/X11/xorg.conf.d/90-corefonts-0.conf
Section "Files"
    FontPath "/usr/share/fonts/corefonts"
EndSection

/etc/X11/xorg.conf.d/90-dejavu-0.conf
Section "Files"
    FontPath "/usr/share/fonts/dejavu"
EndSection

/etc/X11/xorg.conf.d/90-dina-0.conf
Section "Files"
    FontPath "/usr/share/fonts/dina"
EndSection

/etc/X11/xorg.conf.d/90-droid-0.conf
Section "Files"
    FontPath "/usr/share/fonts/droid/"
EndSection

/etc/X11/xorg.conf.d/90-liberation-fonts-0.conf
Section "Files"
    FontPath "/usr/share/fonts/liberation-fonts"
EndSection

/etc/X11/xorg.conf.d/90-libertine-ttf-0.conf
Section "Files"
    FontPath "/usr/share/fonts/libertine-ttf"
EndSection

/etc/X11/xorg.conf.d/90-terminus-font-0.conf
Section "Files"
    FontPath "/usr/share/fonts/terminus"
EndSection

/etc/X11/xorg.conf.d/90-termsyn-0.conf
Section "Files"
    FontPath "/usr/share/fonts/termsyn"
EndSection

/etc/X11/xorg.conf.d/90-urw-fonts-0.conf
Section "Files"
    FontPath "/usr/share/fonts/urw-fonts"
EndSection


- -- 
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/

iF4EAREIAAYFAlHVSdcACgkQknrdDGLu8JAhzwEAhhQ2cjRXNjXCkSlVvHApq3LU
yDuEQUaB7d0O01GUnq8A/16YJYtP+aYPOAlgtSQZlWH555X+MFzszy3y6lXf5UDr
=2YVT
-----END PGP SIGNATURE-----


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

* Re: [gentoo-dev] font.eclass add Xorg FontPath elements for non-standard paths
  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 12:10 ` Gilles Dartiguelongue
  2013-07-04 12:24   ` Michael Weber
                     ` (2 more replies)
  2013-07-04 22:36 ` [gentoo-dev] " Ryan Hill
  2013-07-05  6:37 ` [gentoo-dev] " James Cloos
  3 siblings, 3 replies; 14+ messages in thread
From: Gilles Dartiguelongue @ 2013-07-04 12:10 UTC (permalink / raw
  To: gentoo-dev

Le jeudi 04 juillet 2013 à 01:07 +0200, Michael Weber a écrit :
> 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.

Imho, this should be handled in pkg_postinst generating one Xorg
configuration file at the end of the install, very much like
fdo .desktop or mime cache file.

This solves most of the point raised since any font bump would generate
the file for all fonts.

Also, not sure it is related but, maybe this could be linked to
configuration set by eselect fontconfig in some way ?

-- 
Gilles Dartiguelongue <eva@gentoo.org>
Gentoo



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

* Re: [gentoo-dev] font.eclass add Xorg FontPath elements for non-standard paths
  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:48   ` Michael Weber
  2013-07-04 19:42   ` Michał Górny
  2 siblings, 1 reply; 14+ messages in thread
From: Michael Weber @ 2013-07-04 12:24 UTC (permalink / raw
  To: gentoo-dev

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

On 07/04/2013 12:09 PM, Michael Weber wrote:
> Is it possible to get xorg server attributes? xset only has
> setters.
ffr, `xset q` like query values

On 07/04/2013 02:10 PM, Gilles Dartiguelongue wrote:
> Imho, this should be handled in pkg_postinst generating one Xorg 
> configuration file at the end of the install, very much like fdo
> .desktop or mime cache file. This solves most of the point raised
> since any font bump would generate the file for all fonts.
Yes, but could that file be config-protected to allow users to add
special paths of fonts installed somewhere else?
pkg_postinst is sandbox of and I don't want to re-implement
CONFIG_PROTECT.

The FontPath elements are concated inside one Section "Files", but not
accross multiple xorg.conf.d files.

Investigating the handling of FontPath values (and multiple config
files), I stumbled over a macro CONFIG_MAX_FILES set to 64 in [1].
Thus i consider adding/wasting one file per font package to expensive
and a bad design, in the face of 154 packages [2] inheriting font.eclass.

[1] xorg-server-1.14.2/hw/xfree86/parser/scan.c
[2] http://qa-reports.gentoo.org/output/eclass-usage/font.txt


- -- 
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/

iF4EAREIAAYFAlHVaYwACgkQknrdDGLu8JBoVQD/QLMGHD8FtC8MdfHDyvCa2y5p
fV6qb5Eiyou3QpIBzLUA+wZDHnPYuSGEiR0dmTW5Ga7ME31PWJNWNM6yFFL2XXis
=Reia
-----END PGP SIGNATURE-----


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

* Re: [gentoo-dev] font.eclass add Xorg FontPath elements for non-standard paths
  2013-07-04 12:24   ` Michael Weber
@ 2013-07-04 14:33     ` Michael Weber
  2013-07-04 14:45       ` Fabian Groffen
  0 siblings, 1 reply; 14+ messages in thread
From: Michael Weber @ 2013-07-04 14:33 UTC (permalink / raw
  To: gentoo-dev

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

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

New approch,

since Xorg server only accepts FontPath from the last loaded
xorg.conf.d file, this would be 90-font.conf.
It's created/updated during pkg_postinst and pkg_postrm, so outside
the scope of CONFIG_PROTECT.

To allow users/admins to add out-of-portage fonts dir permanently,
(/usr/local et al), a file 90-font.conf.in is sourced if present.

Explanation is moved to 90-font.conf, no explicit warning to restart
Xserver or `xset fp+` is given on the portage output.

Better/Fine/Feedback/Any?

- -- 
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/

iF4EAREIAAYFAlHVh84ACgkQknrdDGLu8JBKWwD/aRjT/oKeL9uyKqMWLxObmRyG
+VidocTtQ0JqERWyD4QA/jb89tV3rAbiOwaXHS/zBxA9qvh43GtU5Hjt38paQeOb
=E1Xp
-----END PGP SIGNATURE-----

[-- Attachment #2: font.eclass.patch --]
[-- Type: text/x-patch, Size: 2038 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	4 Jul 2013 14:28:33 -0000
@@ -35,6 +35,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 elements.
+FONT_X11_CONF=${FONT_X11_CONF:-${EROOT}etc/X11/xorg.conf.d/90-font.conf}
+
 # @ECLASS-VARIABLE: FONT_CONF
 # @DEFAULT_UNSET
 # @DESCRIPTION:
@@ -188,6 +195,38 @@
 	done
 }
 
+# @FUNCTION: font_update_x11_conf
+# @DESCRIPTION:
+# Update the FontPath lines in FONT_X11_CONF file
+# Do this regardless of USE=X on a particular font package
+font_update_x11_conf() {
+	if [ -z "${FONT_X11_CONF}" ] ; then
+		einfo "FONT_X11_CONF is empty"
+		return
+	fi
+	ebegin "collecting X11 FontPath elements for ${FONT_X11_CONF}."
+	mkdir -p "$(basename ${FONT_X11_CONF})"
+	{
+		echo "# Changes to this file need Xserver restart or"
+		echo "# xset fp default ; xset fp rehash."
+		echo "# Add custom paths to ${FONT_X11_CONF}.in."
+		echo "# See font.eclass/font_update_x11_conf for implementation."
+		echo "Section \"Files\""
+		# installed directories 
+		local cand
+		for cand in $(find "${EROOT}usr/share/fonts" -name fonts.dir | sort)
+		do
+			echo "    FontPath \"$(dirname "${cand}")\""
+		done
+		# user supplied lines
+		echo "# begin of ${FONT_X11_CONF}.in"
+		[ -r "${FONT_X11_CONF}.in" ] && cat "${FONT_X11_CONF}.in"
+		echo "# end of ${FONT_X11_CONF}.in"
+		echo "EndSection"
+	} > "${FONT_X11_CONF}"
+	eend
+}
+
 # @FUNCTION: font_pkg_postinst
 # @DESCRIPTION:
 # The font pkg_postinst function.
@@ -216,6 +255,8 @@
 		fc-cache -fs
 		eend $?
 	fi
+	
+	font_update_x11_conf
 }
 
 # @FUNCTION: font_pkg_postrm
@@ -233,4 +274,6 @@
 		fc-cache -fs
 		eend $?
 	fi
+	
+	font_update_x11_conf
 }

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

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

* Re: [gentoo-dev] font.eclass add Xorg FontPath elements for non-standard paths
  2013-07-04 14:33     ` Michael Weber
@ 2013-07-04 14:45       ` Fabian Groffen
  0 siblings, 0 replies; 14+ messages in thread
From: Fabian Groffen @ 2013-07-04 14:45 UTC (permalink / raw
  To: gentoo-dev

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

On 04-07-2013 16:33:50 +0200, Michael Weber wrote:
> +		local cand
> +		for cand in $(find "${EROOT}usr/share/fonts" -name fonts.dir | sort)
> +		do
> +			echo "    FontPath \"$(dirname "${cand}")\""

I think you want "${cand#${ROOT}}" here, don't you?



-- 
Fabian Groffen
Gentoo on a different level

[-- Attachment #2: Digital signature --]
[-- Type: application/pgp-signature, Size: 194 bytes --]

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

* Re: [gentoo-dev] font.eclass add Xorg FontPath elements for non-standard paths
  2013-07-04 12:10 ` Gilles Dartiguelongue
  2013-07-04 12:24   ` Michael Weber
@ 2013-07-04 14:48   ` Michael Weber
  2013-07-04 19:42   ` Michał Górny
  2 siblings, 0 replies; 14+ messages in thread
From: Michael Weber @ 2013-07-04 14:48 UTC (permalink / raw
  To: gentoo-dev

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

On 07/04/2013 02:10 PM, Gilles Dartiguelongue wrote:
> Also, not sure it is related but, maybe this could be linked to 
> configuration set by eselect fontconfig in some way ?

I cannot answer your question, if `eselect fontconfig`-state
should/could be mapped to Xorg FontPath.
There are font packages without fontconfig (media-fonts/urw-fonts) and
with 3 files (media-fonts/droid).

- -- 
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/

iF4EAREIAAYFAlHViyUACgkQknrdDGLu8JBspwEAlUfLGHy/pcIdBwTO6mdHVL23
ZKczD3QWf85Z0tQfSYcA/2ve9mb/J0HnaMjHltA5+dy+DYW+H2dXXEAdAdeNTN4O
=w10c
-----END PGP SIGNATURE-----


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

* Re: [gentoo-dev] font.eclass add Xorg FontPath elements for non-standard paths
  2013-07-04 12:10 ` Gilles Dartiguelongue
  2013-07-04 12:24   ` Michael Weber
  2013-07-04 14:48   ` Michael Weber
@ 2013-07-04 19:42   ` Michał Górny
  2 siblings, 0 replies; 14+ messages in thread
From: Michał Górny @ 2013-07-04 19:42 UTC (permalink / raw
  To: gentoo-dev; +Cc: eva

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

Dnia 2013-07-04, o godz. 14:10:59
Gilles Dartiguelongue <eva@gentoo.org> napisał(a):

> Imho, this should be handled in pkg_postinst generating one Xorg
> configuration file at the end of the install, very much like
> fdo .desktop or mime cache file.
> 
> This solves most of the point raised since any font bump would generate
> the file for all fonts.

Although AFAICS avoiding this is not really possible, please don't
encourage people to repeat things which are simply done wrong. Any kind
of pkg_postinst() doesn't handle file ownerships properly.

-- 
Best regards,
Michał Górny

[-- Attachment #2: signature.asc --]
[-- Type: application/pgp-signature, Size: 966 bytes --]

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

* [gentoo-dev] Re: font.eclass add Xorg FontPath elements for non-standard paths
  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 12:10 ` Gilles Dartiguelongue
@ 2013-07-04 22:36 ` Ryan Hill
  2013-07-05  5:41   ` Ben de Groot
  2013-07-05  6:37 ` [gentoo-dev] " James Cloos
  3 siblings, 1 reply; 14+ messages in thread
From: Ryan Hill @ 2013-07-04 22:36 UTC (permalink / raw
  To: gentoo-dev

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

On Thu, 04 Jul 2013 01:07:08 +0200
Michael Weber <xmw@gentoo.org> wrote:

> -----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.

Font directories and caching are controlled by fontconfig on modern systems.
You don't need to modify fontpath.  If you have ancient programs that don't use
fontconfig then you can add your own config and not slow down loading of X for
everybody else for absolutely no reason.

> 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.

What you want is the font path element catalog and /etc/X11/fontpath.d (bug
#185264) which I abandoned when I realized that no one actually uses fontpath
anymore, that it caused the startup time to drastically increase with the
number of installed fonts, and that adding your own fontpath entries is both
trivial and documented everywhere.


-- 
Ryan Hill                        psn: dirtyepic_sk
   gcc-porting/toolchain/wxwidgets @ gentoo.org

47C3 6D62 4864 0E49 8E9E  7F92 ED38 BD49 957A 8463

[-- Attachment #2: signature.asc --]
[-- Type: application/pgp-signature, Size: 490 bytes --]

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

* Re: [gentoo-dev] Re: font.eclass add Xorg FontPath elements for non-standard paths
  2013-07-04 22:36 ` [gentoo-dev] " Ryan Hill
@ 2013-07-05  5:41   ` Ben de Groot
  0 siblings, 0 replies; 14+ messages in thread
From: Ben de Groot @ 2013-07-05  5:41 UTC (permalink / raw
  To: gentoo-dev

On 5 July 2013 06:36, Ryan Hill <dirtyepic@gentoo.org> wrote:
>
> What you want is the font path element catalog and /etc/X11/fontpath.d (bug
> #185264) which I abandoned when I realized that no one actually uses fontpath
> anymore, that it caused the startup time to drastically increase with the
> number of installed fonts, and that adding your own fontpath entries is both
> trivial and documented everywhere.
>

We should probably add this to our documentation, and link to that
from a post-install message (using readme.gentoo.eclass).

--
Cheers,

Ben | yngwin
Gentoo developer


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

* Re: [gentoo-dev] font.eclass add Xorg FontPath elements for non-standard paths
  2013-07-03 23:07 [gentoo-dev] font.eclass add Xorg FontPath elements for non-standard paths Michael Weber
                   ` (2 preceding siblings ...)
  2013-07-04 22:36 ` [gentoo-dev] " Ryan Hill
@ 2013-07-05  6:37 ` James Cloos
  2013-07-05  7:18   ` Michael Weber
  3 siblings, 1 reply; 14+ messages in thread
From: James Cloos @ 2013-07-05  6:37 UTC (permalink / raw
  To: Michael Weber; +Cc: gentoo development

While making it easier for those who want all of their fonts included in
the x11 server-side font list is not an unreasonable goal, forcing them
to be is unreasonable.

As someone who has run X11 regularly for over 20 years now, I absolutely
do not want any type1 or SFNT fonts in my x server font path.  Any app I
use these days with such fonts supports client-side fonts.  For the apps
which require server-side fonts, the bfd fonts suit best.

Putting all of /usr/share/fonts into the fontpath will only slow the X11
startup.

I'd suggest either an eselect(1) driven applet to let one choose which
directories to add to a single .d conf file, or perhaps a non-gentoo-
specific gui app to do so.  Either of those would provide exactly the
right sort of configuation assistance for users who are not comfortable
editing their configs in text editors.

Or, if you are feeling ambitious, write an X-Font-Server which uses
libfontconfig to find fonts, generates and keeps a cache of fc-pattern
to/from xlfd mappings, and serves said fonts to X servers.

-JimC
-- 
James Cloos <cloos@jhcloos.com>         OpenPGP: 1024D/ED7DAEA6


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

* Re: [gentoo-dev] font.eclass add Xorg FontPath elements for non-standard paths
  2013-07-05  6:37 ` [gentoo-dev] " James Cloos
@ 2013-07-05  7:18   ` Michael Weber
  0 siblings, 0 replies; 14+ messages in thread
From: Michael Weber @ 2013-07-05  7:18 UTC (permalink / raw
  To: gentoo-dev

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

On 07/05/2013 08:37 AM, James Cloos wrote:
> While making it easier for those who want all of their fonts
> included in the x11 server-side font list is not an unreasonable
> goal, forcing them to be is unreasonable.
> 
> As someone who has run X11 regularly for over 20 years now, I
> absolutely do not want any type1 or SFNT fonts in my x server font
> path.  Any app I use these days with such fonts supports
> client-side fonts.  For the apps which require server-side fonts,
> the bfd fonts suit best.
Ok, so optional enabled (opt-in) it will be.

> Putting all of /usr/share/fonts into the fontpath will only slow
> the X11 startup.
By which amount?

> I'd suggest either an eselect(1) driven applet to let one choose
> which directories to add to a single .d conf file, or perhaps a
> non-gentoo- specific gui app to do so.  Either of those would
> provide exactly the right sort of configuation assistance for users
> who are not comfortable editing their configs in text editors.
It's not the editing of config files that concerns me, it's the need
to do so after every font installation, and keep it in sync with
installation.

What do you and Ryan think about naming the suggested file
xorg.conf.d/90-font.conf.${suffix}, add :pri=50 to every line,
so users who want it can symlink it to .conf to be loaded.
With suffix:=all or gentoo-all-fonts

User edits in .conf.in could set other priorities.

Would that be ok?

- -- 
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/

iF4EAREIAAYFAlHWc0oACgkQknrdDGLu8JAtpQD9GUS2c01M55OvRS2gi8p2r3vs
rPs1MR9XhB8+Jgj5vl0A+gLsbDKPv/nrvS2x2z35fzwonP5DM5ESPYBdaKPaICSw
=eU0D
-----END PGP SIGNATURE-----


^ 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