Gentoo Websites Logo
Go to: Gentoo Home Documentation Forums Lists Bugs Planet Store Wiki Get Gentoo!
Bug 185264 - add support for libXfont-1.3.0 catalog FPE to fonts.eclass
Summary: add support for libXfont-1.3.0 catalog FPE to fonts.eclass
Status: RESOLVED OBSOLETE
Alias: None
Product: Gentoo Linux
Classification: Unclassified
Component: [OLD] Development (show other bugs)
Hardware: All All
: High enhancement (vote)
Assignee: Gentoo Fonts Team
URL:
Whiteboard:
Keywords:
Depends on:
Blocks:
 
Reported: 2007-07-14 04:13 UTC by Ryan Hill (RETIRED)
Modified: 2021-01-15 01:36 UTC (History)
2 users (show)

See Also:
Package list:
Runtime testing required: ---


Attachments
add --with-default-font-path (xorg-server.ebuild.diff,807 bytes, patch)
2009-09-12 23:05 UTC, Ryan Hill (RETIRED)
Details | Diff
also create catalogue symlinks (xorg-server.ebuild.diff,1.05 KB, text/plain)
2009-09-13 00:06 UTC, Ryan Hill (RETIRED)
Details
font.eclass.diff (font.eclass.diff,673 bytes, patch)
2009-09-13 04:41 UTC, Ryan Hill (RETIRED)
Details | Diff
xorg-server.ebuild.diff (xorg-server.ebuild.diff,665 bytes, patch)
2009-09-13 06:58 UTC, Ryan Hill (RETIRED)
Details | Diff
font.eclass.diff (font.eclass.diff,732 bytes, text/plain)
2009-09-13 07:08 UTC, Ryan Hill (RETIRED)
Details
x-modular.eclass.diff (x-modular.eclass.diff,519 bytes, patch)
2009-09-13 07:10 UTC, Ryan Hill (RETIRED)
Details | Diff
font.eclass.with_attributes.diff (font.eclass.with_attributes.diff,957 bytes, patch)
2009-09-19 17:57 UTC, Ryan Hill (RETIRED)
Details | Diff
font.eclass.patch even more attributes (for reveiw only) (font.eclass.patch,1.33 KB, text/plain)
2009-10-11 18:47 UTC, Peter Volkov (RETIRED)
Details
font.eclass.patch (font.eclass.patch,1.75 KB, patch)
2009-10-12 18:48 UTC, Peter Volkov (RETIRED)
Details | Diff

Note You need to log in before you can comment on or make changes to this bug.
Description Ryan Hill (RETIRED) gentoo-dev 2007-07-14 04:13:41 UTC
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.
Comment 1 Ryan Hill (RETIRED) gentoo-dev 2007-09-11 02:18:15 UTC
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
Comment 2 Peter Volkov (RETIRED) gentoo-dev 2009-01-08 12:35:40 UTC
(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
Comment 3 Rémi Cardona (RETIRED) gentoo-dev 2009-08-20 14:49:13 UTC
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...
Comment 4 Ryan Hill (RETIRED) gentoo-dev 2009-09-12 23:05:17 UTC
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.
Comment 5 Ryan Hill (RETIRED) gentoo-dev 2009-09-13 00:06:02 UTC
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.
Comment 6 Ryan Hill (RETIRED) gentoo-dev 2009-09-13 04:41:21 UTC
Created attachment 203904 [details, diff]
font.eclass.diff

Quick patch, lightly tested.
Comment 7 Rémi Cardona (RETIRED) gentoo-dev 2009-09-13 06:07:02 UTC
(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
Comment 8 Ryan Hill (RETIRED) gentoo-dev 2009-09-13 06:39:52 UTC
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.
Comment 9 Ryan Hill (RETIRED) gentoo-dev 2009-09-13 06:58:11 UTC
Created attachment 203906 [details, diff]
xorg-server.ebuild.diff
Comment 10 Ryan Hill (RETIRED) gentoo-dev 2009-09-13 07:08:26 UTC
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.
Comment 11 Ryan Hill (RETIRED) gentoo-dev 2009-09-13 07:10:12 UTC
Created attachment 203908 [details, diff]
x-modular.eclass.diff
Comment 12 Ryan Hill (RETIRED) gentoo-dev 2009-09-19 17:57:25 UTC
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.
Comment 13 Peter Volkov (RETIRED) gentoo-dev 2009-10-11 18:47:02 UTC
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.
Comment 14 Rémi Cardona (RETIRED) gentoo-dev 2009-10-11 20:16:13 UTC
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
Comment 15 Ryan Hill (RETIRED) gentoo-dev 2009-10-12 08:39:32 UTC
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. ;)
Comment 16 Peter Volkov (RETIRED) gentoo-dev 2009-10-12 18:48:50 UTC
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 :)
Comment 17 Ryan Hill (RETIRED) gentoo-dev 2009-11-01 02:16:56 UTC
sounds alright to me.  what do we need to do to get this moving?
Comment 18 Rémi Cardona (RETIRED) gentoo-dev 2009-11-01 20:07:35 UTC
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
Comment 19 Ryan Hill (RETIRED) gentoo-dev 2009-11-08 01:22:45 UTC
(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
Comment 20 Ryan Hill (RETIRED) gentoo-dev 2009-11-08 01:25:27 UTC
100dpi:pri=50 -> /usr/share/fonts/100dpi
100dpi:unscaled:pri=30 -> /usr/share/fonts/100dpi

rather.
Comment 21 Ryan Hill (RETIRED) gentoo-dev 2010-02-13 22:39:26 UTC
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.