libXfont-1.3.0 adds a feature where one can point the xorg config files at a directory containing symlinks to font directories. this allows fonts to be installed and removed from the system without having to edit the configs. [2151] < dberkholz> | dirtyepic: basically we would make an /etc/X11/fontpath.d/ and each font package would install a symlink to it this would probably just need a quick edit to font_src_install and some documenting.
Donnie, I may not get to this for a bit. If you (or someone) would like to do up a patch to the eclass I could apply it. I think this is a good idea but I have some questions. The symlinks in /etc/X11/fontpath.d can have attribute suffixes that set things like ':unscaled' for bitmaps and ':pri=n' for setting font priority. Do we want to use these features? How do we specify these from font to font? For instance, something like font-misc-misc should have a high priority for sure, but the load order of most other fonts are up to user preference. The order of 75dpi and 100dpi is a good example. I personally think :unscaled should always be used for bitmap fonts but others might disagree. Maybe we could come up with a sane default for the core font packages (ie. those pulled in by x11-base/xorg-x11) and install everything else without extra attributes (except maybe unscaled for bitmaps)? Or maybe I'm over-analyzing this. ;D
(In reply to comment #1) > The symlinks in /etc/X11/fontpath.d can have attribute suffixes that set > things like ':unscaled' for bitmaps and ':pri=n' for setting font priority. Probably all bitmap fonts should be unscaled (btw, can we detect this based on type of font?), but priority... Probably we should set some defaults but allow users to update that using eselect. > Do we want to use these features? How do we specify these from font to font? I think it not required but good idea to have... > For instance, something like font-misc-misc should have a high priority for > sure, but the load order of most other fonts are up to user preference. The > order of 75dpi and 100dpi is a good example. I personally think :unscaled > should always be used for bitmap fonts but others might disagree. Personally I agree. > Maybe we could come up with a sane default for the core font packages (ie. > those pulled in by x11-base/xorg-x11) and install everything else without > extra attributes (except maybe unscaled for bitmaps)? Currently I don't have answers, but this comment sounds related: https://bugs.gentoo.org/show_bug.cgi?id=129117#c16
I think it'd be a great idea to implement this, as it would make configuration much easier for users. *And* it also means with could build xorg-server with --default-font-path="catalogue:/etc/X11/fontpath.d,built-ins" (this is what Fedora does BTW). +1 from me. As for the :unscaled stuff, I have no idea how that works...
Created attachment 203893 [details, diff] add --with-default-font-path this is a diff against xorg-server1.6.3.901-r1.ebuild which adds that option and unexpectedly fixes an issue i was having with xfontsel hanging. this can go in now and we'll add the symlink mechanism after some further testing.
Created attachment 203894 [details] also create catalogue symlinks Fedora creates these symlinks in /etc/X11/fontpath.d when installing the xorg fonts: misc:unscaled:pri=10 75dpi:unscaled:pri=20 100dpi:unscaled:pri=30 Type1 TTF OTF cyrillic I think the best way to do this is to create these paths and symlinks in the xorg-server ebuild itself. Then it works out of the box, no futzing with the eclass needed. I'll add a function to the eclass for other fonts to use but as far as the xorg fonts are concerned this should be all we need.
Created attachment 203904 [details, diff] font.eclass.diff Quick patch, lightly tested.
(In reply to comment #5) > I think the best way to do this is to create these paths and symlinks in the > xorg-server ebuild itself. Then it works out of the box, no futzing with the > eclass needed. I'll add a function to the eclass for other fonts to use but as > far as the xorg fonts are concerned this should be all we need. I'd rather add those symlinks to the x-modular eclass, in the various fonts handling sections. Since xorg-server now works fine without any fonts, I'd like to keep its ebuild clean and move the code to fonts instead. Actually, why are those special dirs even needed? We've never put anything like that in the FontPath. Let's start with just the first hunk of the ebuild patch + the eclass patch. We can always add more later :) Thanks
Priority used to be determined by the order of the FontPath entries in xorg.conf. With a directory of symlinks we lose that ability. I don't have strong feelings one way or the other, I'm just mirroring what Fedora does. ;) FontPath has always supported appending :unscaled to the pathnames though. The xorg.conf man page even says: The recommended font path contains the following font path elements: /usr/lib/X11/fonts/local/ /usr/lib/X11/fonts/misc/ /usr/lib/X11/fonts/75dpi/:unscaled /usr/lib/X11/fonts/100dpi/:unscaled /usr/lib/X11/fonts/Type1/ /usr/lib/X11/fonts/75dpi/ /usr/lib/X11/fonts/100dpi/ I think you're right about not doing this in the ebuild though. I've found a couple other problems with that approach.
Created attachment 203906 [details, diff] xorg-server.ebuild.diff
Created attachment 203907 [details] font.eclass.diff this is without any attributes for the link names. if we decide we want them we'll have to figure out a way to specify what they should be.
Created attachment 203908 [details, diff] x-modular.eclass.diff
Created attachment 204630 [details, diff] font.eclass.with_attributes.diff this is what i've been using the last week or so. it works quite well.
Created attachment 206801 [details] font.eclass.patch even more attributes (for reveiw only) Ryan cool and works here. In xorg.conf absent X11-era this is really useful. BTW, I think we need ability to set attributes from ebuilds. Attached is _not tested_ patch that uses FONTDIR_ATTRIBUTES for this. But before we move this direction what do you think: Do we allow users to modify this symlinks? If so what should happen on update? Do we need eselect module for this (first idea is like fontconfig: /etc/X11/fontpath.avail/ and then copy symlinks from fontpath.avail to fontpath.d)? If needed I can write eselect module but first I'd like to hear other opinions on this issue.
Great patches, both of you :) Now 2 things come to mind: 1) if we do a static symlink which users shouldn't change (no eselect module), then we should just go with Ryan's patch (attachment #204630 [details, diff]). 2) if we do an eselect module, then I think the font_do_fontpath() call should indeed create symlinks in another dir. Then we can either setup a default symlink in pkg_postinst() or tell users to "enable" the font with the eselect module. Either way is 100% fine with me as I see very little value in old bitmap fonts, but that's just me :) Again, thanks to the both of you for those patches and feel free to commit which ever one you feel is better for users. Cheers
my thought was that if users need to set their own attributes, they can use xorg.conf as they have been up until now. however, i haven't had any need for bitmap fonts for years now, so i might be biased. ;) maybe add it without and see who complains? the ability to set attributes per-ebuild is a good thing though. i say we commit yours for now and if you want to add eselect stuff then i'll leave it up to you. ;)
Created attachment 206865 [details, diff] font.eclass.patch (In reply to comment #15) > however, i haven't had any need for bitmap fonts for years now, so i might be > biased. ;) This is not only about bitmap fonts. X may use ttf/type1/speedo fonts as well, and those who use pure X applications (without gtk/qt, e.g. xterm or fontforge applications) need to define some fonts for X to use. With this feature we allow our users to define X font paths without xorg.conf - IMO very useful :) And about font.eclass. Tonight I've thought about alternative to eclass... I think most users will install fonts they'll want to use with pure-X-applications too. So in general users do not need to redefine FONTDIRS_ATTRIBUTE since it's possible to set some good default attributes(*). But still to avoid cries about "Gentoo all about choices" what do you think if we make two variables: FONTDIRS_ATTRIBUTE to be defined in eclass (value none - not to create symlink) ${PN//[-+]/_}_FONTDIRS_ATTRIBUTE - per-package variable users may define in make.conf or anywhere else in environment that will override FONTDIRS_ATTRIBUTE Since fonts are really cheap to build I think such "configuration" is not a problem, and definitely looks much easier then eclass. Also naming convention will be familiar to those who use git.eclass (similar solution is used there to define branch for checkout). If we go with this solution I'd like to put some README at /etc/X11/fontpath.d/ and probable it should be put there together with xorg-server installation. (*) about default font attributes. I think we must set 'pri=10' and 'unscaled' font attributes for all bitmap fonts (Ryan covered most bitmap fonts, and others could be found with `egrep -r 'FONT_SUFFIX.*(pcf|bdf)' /usr/portage/media-fonts`). This makes all scaled fonts on to of stack. This patch does all of this and was tested by me :)
sounds alright to me. what do we need to do to get this moving?
I've put both eclasses in the overlay. I'll start bumping the latest font releases in the overlay as well. Both of you have carte blanche to commit your changes in the overlay. (ask git.overlays.g.o maintainers for overlay access and point them here if they want an ACK from us). Thanks
(In reply to comment #16) > FONTDIRS_ATTRIBUTE to be defined in eclass (value none - not to create symlink) > > ${PN//[-+]/_}_FONTDIRS_ATTRIBUTE - per-package variable users may define in > make.conf or anywhere else in environment that will override FONTDIRS_ATTRIBUTE This doesn't work for xorg fonts, because multiple fonts install in the same directory. For example, add font_adobe_100dpi="pri=50" to make.conf. Emerge font-adobe-100dpi and font-bitstream-100dpi. $ ll /etc/X11/fontpath.d/100* lrwxrwxrwx 1 root root 23 2009-11-07 19:18 /etc/X11/fontpath.d/100dpi:pri:40 -> /usr/share/fonts/100dpi lrwxrwxrwx 1 root root 23 2009-11-07 19:10 /etc/X11/fontpath.d/100dpi:unscaled:pri=30 -> /usr/share/fonts/100dpi
100dpi:pri=50 -> /usr/share/fonts/100dpi 100dpi:unscaled:pri=30 -> /usr/share/fonts/100dpi rather.
if someone wants to finish this off, be my guest. i won't have time for a few months at least. i think it will work if we use FONT_DIR rather than PN.