James Ogley <james@usr-local-bin.org> さんは書きました:
It'll then use the SuSEconfig fonts module to set them up for X.
The funny thing is that I'd installed these fonts manually, configured the fonts.scale and fonts.dir etc etc many times, but every time I ran SuSEconfig, it nuked the config, unless I did it with this script - weird no?
SuSEconfig.fonts on SuSE Linux <= 8.1 always overwrites fonts.scale. It merges the contents of all files named fonts.scale.<something> into fonts.scale. Therefore, if you want to manually edit entries for fonts, edit a file like fonts.scale.my-private-entries. This will then be merged into the generated fonts.scale file by SuSEconfig.fonts. Don't edit fonts.scale directly. The fetchmsttfonts script did the same, it used mkfontscale to generate a fonts.scale.msttfonts file which was merged into fonts.scale by SuSEconfig.fonts. I just rewrote /sbin/conf.d/SuSEconfig.fonts for SuSE Linux >= 8.2 to do some more stuff automatically. If you like you can test it, the new scripts are here: http://www.suse.de/~mfabian/misc/SuSEconfig.fonts/SuSEconfig.fonts http://www.suse.de/~mfabian/misc/SuSEconfig.fonts/fonts-config http://www.suse.de/~mfabian/misc/SuSEconfig.fonts/fonts-config.1.gz I tested them on SuSE Linux 8.1 and on the current beta, they might work for older versions as well but I haven't tried. To use the new scripts, copy the above 3 files to /sbin/conf.d/SuSEconfig.fonts /usr/sbin/fonts-config /usr/share/man/man1/fonts-config.1.gz and call /usr/sbin/fonts-config --force as root. Actually /sbin/conf.d/SuSEconfig.fonts itself does almost nothing now. I found it too difficult to extend the bash script SuSEconfig.fonts, therefore I removed almost everything from SuSEconfig.fonts and made it just call the perl-script /usr/sbin/fonts-config which does the real work. How it works is described in the man page of the new fonts-config script which I append here: FONTS-CONFIG(1) FONTS-CONFIG(1) NAME fonts-config - configures installed X11 fonts. SYNOPSIS fonts-config [OPTION]... OPTIONS -f, --force Force the update of all generated files even if it appears to be unnecessary according to the time stamps. -q, --quiet Work silently, unless an error occurs. -v, --verbose Print some progress messages to standard output. -d, --debug Print a lot of debugging messages to standard output. --no-gs-fontmap skip generation of a Fontmap for Ghostscript (to save some time when such a Fontmap is not needed). --version Display version and exit. -h, --help Display a short help message and exit. DESCRIPTION Configures installed X11 fonts. Basically it does the fol- lowing things: call fc-cache creates an index of FreeType font files in a directory for use with client side font rendering via libXft, see fc-cache(1). call cidfont-x11-config cidfont-x11-config is another little perl script which configures CID-keyed fonts for use with X11, see cid- font-x11-config(1). creates fonts.scale and fonts.dir files To find the list of directories currently used for server side fonts, /etc/X11/XF86Config is parsed and merged with a hardcoded list of directories. If the font server xfs is running, /etc/X11/fs/config is also parsed and the list of directories found there is merged as well. For each directory from this list, the time stamps of the directory, the fonts.scale file, the fonts.dir file and an extra time stamp file .fonts-config-times- tamp are checked. If not all the time stamps are equal or any of these files is missing, the fonts.scale and fonts.dir files will be updated as follows: First of all a fonts.scale file is created by calling mkfontscale. Then, the entries found in the fonts.scale file are merged with the entries from all fonts.scale.* files. fonts.scale.* files may be supplied by rpm-packages or manually added by the user to override or amend the entries created automatically by mkfontscale. Entries in a fonts.scale.* file have higher priority than entries automatically created by mkfontscale. All entries generated automatically by mkfontscale for a certain font file are discarded if any fonts.scale.* file contains an entry for the same font file. If the xtt module is configured to load in /etc/X11/XF86Config, additional entries may be created to make use of the artificial bold and italic features of xtt. The time stamp of /etc/X11/XF86Config is not checked, i.e. you have to use fonts-config --force after editing /etc/X11/XF86Config to switch between the xtt and freetype modules. After the final list of entries has been written back to fonts.scale, mkfontdir is called. Finally, the time stamps of the directory, fonts.scale, fonts.dir, and .fonts-config-timestamp are set to the time when fonts-config started. If any fonts.scale file in the directory list needed an update, a Ghostcript Fontmap is also generated for all scalable fonts in the directory list and the result is written to /usr/share/ghostscript/*/lib/Fontmap.X11-auto. Usually fonts-config is called automatically via SuSEcon- fig (SuSEconfig --module fonts), which is usually automat- ically called by YaST2. But you can also execute fonts- config directly, which is mainly useful to debug it. AUTHOR Mike FABIAN <mfabian@suse.de>, 2003. SEE ALSO fc-cache(1), cidfont-x11-config(1), mkfontdir(1), mkfontscale(1) perl v5.8.0 2003-01-27 FONTS-CONFIG(1) -- Mike Fabian <mfabian@suse.de> http://www.suse.de/~mfabian 睡眠不足はいい仕事の敵だ。