------------------------------------------------------------------------------- GENERAL INFO All fonts on X11 window system after revision 4 (before this font name were purly file names on the X Display Servers machine) fall into two categories. Font names and Font aliases to those names. Names consist of a string with the following format :- -fndry-fmly-wght-slant-sWdth-addstyle -pxlsize-ptsize-resx-resy-spc-avgWdth-registray-encoding IE: 14 feilds of information! Thus the need for * in the naming. Example: The font used by default for most applications is -misc-fixed-medium-r-normal--13-120-75-75-c-0-iso8859-1 This in most cases is too complicated for commonly used fonts so they invented simple font aliases for commonly used fonts. IE the above font is know as "6x13", in otherwords a each character fits in a 6 pixel by 13 pixel box. NOTE when using * in font names the first font that matches the pattern is used. Thus you only need enough to match the font you want. EG: *-fixed-medium-r-*--*-120-* or the first fixed the server has that is :- a width font of medium weight in roman (not slanted) block at 12.0pt This is enough to match the 6x13 font. If I specify anything more I just ensure the explicit font I want I get. Like maybe insuring 75dpi resolution instead of 100dpi which may also be available. X commands which deal with fonts are ;- xfd -fn font display a particular font in an array xlsfonts -fn font list all matching fonts xprop -font font alias to full font name xfontsel interactively select a font using the full font naming scheme. xset +fp dir seting font paths (within the server) xfep a simplified editor for fonts (could be better) xrdb for seting application font resources ttmkfdir generate "fonts.scale" file (do before mkfontdir) mkfontdir generate the "font.dir" file in a font directory Under linux you may also need to set SELinux access permissions chcon -R -h -t fonts_t . What font is being used, use "fc-match" For example fc-match monospace DejaVuSansMono.ttf: "DejaVu Sans Mono" "Book" For specific information about a font use xprop -font fixed ... FONT = -Misc-Fixed-Medium-R-SemiCondensed--13-120-75-75-C-60-ISO8859-1 ... What fonts are currently in use xlsatoms | egrep "[\008]-" How do you determine what application is using a specific font? ------------------------------------------------------------------------------- X Toolkit and Athena Widget Fonts The X Toolkit will figure out the font to use by the following steps 1/ The appropriate resources for the widget using the font. 2/ The global Resource xtDefaultFont 3/ The global Resource XtDefaultFont 4/ If it has still not found an appropriate font it will use "-*-*-*-R-*-*-*-120-*-*-*-*-ISO8859-1" to load the a font for the widget. This is MUST available for all Xservers. ------------------------------------------------------------------------------- Resources to use a larger default font Only works if misc fonts are scalable font_w=8; font_h=15 FONT="-misc-fixed-medium-r-*-*-${font_h}-0-0-0-*-${font_w}0-*-1" BFONT="-misc-fixed-bold-r-*-*-${font_h}-0-0-0-*-${font_w}0-*-1" # The encoding is iso10646 for Unicode OR iso8859 for old BDF source fonts xrdb -DFONT="$FONT" -DBFONT="$BFONT" -merge - <<'EOF' XTerm*font: FONT XTerm*boldFont: BFONT EOF NOTE: the above fails with some XF86 release, SuSE 6.4 and Fedora 2 See Fonts.XF86v4_problem NOTE: if you implement truetype fonts (using xfstt fontserver), this scaling will only work for the font height, and then is one pixel too high. The width request seems to be ignored completely, if the height or point size is defined. ------------------------------------------------------------------------------- Generating a specific scaled font from a Font Server (OLD) Problem: As I move to Fedora 2 I cound that the misc fonts were no longer scalable. These fonts never did scale well, but I did like to use a unusual 8x15 scaled font... -misc-fixed-medium-r-normal--15-0-75-75-c-80-iso8859-1 -misc-fixed-bold-r-normal--15-0-75-75-c-80-iso8859-1 This was scaled by the fontserver from the standard 9x15 "large" font. But that font was just a little too large for what I wanted on my display. My solution was to go back to an older server and extract and save a pre-scaled 8x15 font from the fontserver for my personal use. Grab the font fstobdf -server unix/:7100 > 8x15.bdf \ -fn -misc-fixed-medium-r-normal--15-0-75-75-c-80-iso8859-1 fstobdf -server unix/:7100 > 8x15B.bdf \ -fn -misc-fixed-bold-r-normal--15-0-75-75-c-80-iso8859-1 Convert to pcf format bdftopcf -o 8x15.pcf 8x15.bdf bdftopcf -o 8x15B.pcf 8x15B.bdf rm 8x15.bdf 8x15B.bdf Save in my personal font dir and update it mv 8x15.pcf 8x15B.pcf /home/anthony/lib/fonts/pcf/ mkfontdir /home/anthony/lib/fonts/pcf/ vi /home/anthony/lib/fonts/pcf/fonts.alias Add 8x15 and 8x15bold aliases for the fonts. ------------------------------------------------------------------------------- Generating a 8x15 fixed width unicode font *** from the specific 8x13 bitmap font *** This is done by scaling the font using the X windows font server. However without some heavy trickery you can't tell the "xfs" program exactly which font it should use to scale from! Not only that but the program selected fonts for re-scaling very very badly. Check that a iso10646-1 misc 8x15 font is not available in font server and will not be scaled from some other font (eg a font path in "xfs" that is not flaged as being ":unscaled". fslsfonts -server unix/:7100 \ -fn -misc-fixed-medium-r-normal--15-0-75-75-c-80-iso10646-1 If it is, then you need to some how stop it. Now copy the unicode fonts 8x13.bdf 8x13O.bdf and 8x13B.bdf from the unicoded "Misc Fixed" font sets... http://www.cl.cam.ac.uk/~mgk25/ucs-fonts.html Or the unicode font provided by linux locate 8x13 * Save the 8x13* fonts in your font directory. * Run "mkfontdir" to update the "fonts.dir" file. * Set the access rights chmod 644 * * Edit "/etc/X11/fs/config" and add the font directory to its path list. * Hup the "xfs" font server to re-read its config. * Check that you can now get a scaled version of the font. fslsfonts -server unix/:7100 \ -fn -misc-fixed-medium-r-normal--15-0-75-75-c-80-iso10646-1 NOTE: This does not mean the font itself is accessable. As only one font was added to the system, it must be scaling from the right source. Check it can be accessed, scaled, and looks ok. xset fp rehash xlsfonts -fn '-misc-fixed-*-*-normal--15-0-75-75-c-80-iso10646-1' env LANG=en_AU.UTF-8 \ xterm -fn -misc-fixed-medium-r-normal--15-0-75-75-c-80-iso10646-1 \ -fb -misc-fixed-bold-r-normal--15-0-75-75-c-80-iso10646-1 Now extract the font... fstobdf -server unix/:7100 > u8x15.bdf \ -fn -misc-fixed-medium-r-normal--15-0-75-75-c-80-iso10646-1 fstobdf -server unix/:7100 > u8x15B.bdf \ -fn -misc-fixed-bold-r-normal--15-0-75-75-c-80-iso10646-1 fstobdf -server unix/:7100 > u8x15O.bdf \ -fn -misc-fixed-medium-o-normal--15-0-75-75-c-80-iso10646-1 Remove the 8x13 fonts, added above Remove directory from /etc/X11/fs/config, (hup the xfs again) Convert bdftopcf -o u8x15.pcf u8x15.bdf bdftopcf -o u8x15B.pcf u8x15B.bdf bdftopcf -o u8x15O.pcf u8x15O.bdf rm u8x15.bdf u8x15B.bdf u8x15O.bdf Finish Up gzip *.pcf mkfontdir vi fonts.alias # fix any aliases that you are using chmod 644 * chcon -R -h -t fonts_t . ------------------------------------------------------------------------------- Failure of "xset fp+ fontdir" X Error of failed request: BadValue Major opcode of failed request: 51 (X_SetFontPath) Posible causes... + Directory is not setup right (IE: "mkfontdir") + Directory is not accessable to the XServer. IE: must be available on the machine running the X server not on the client. EG: font is NOT in /tftpboot sub-directory for xterminals + Files are not readable to everyone (in particular the user "nobody") + The wrong font type is used R4 server :- bdf, snf, snf.Z R5 server :- bdf, pcf, pcf.Z (note pcf = snf big-enden) Big-enden (Sun) or Little-enden (Labtam) (Labtam will use both) wrong compression style (unix compression 16 bit vs 12 bit) IE: ncd's NCD Terminals support the following font types DEC window fonts `.dwf' Big-enden snf fonts (Sun R4 snf) Portiable pcf format fonts compressed files at 12 bits only (NOT full compression) Labtam Xterminals Understand snf and compressed snf or either big or little enden style they do NOT understand bdf format fonts. ------------------------------------------------------------------------------- Font Conversion Problem Warning: Cannot convert string "-*-helvetica-bold-r-*-12-*" to type FontStruct This fontList string isn't specific enough about the various fields of XLFD to allow a server which does font scaling to be able to sort out what the user wants to do. Try filling in all the fileds of the XLFD description -*-helvetica-bold-r-normal--12-*-*-*-p-*-iso8859-1 The other string means Helvetica bold upright, but for which field the 12 is in can't be discovered. oj@world.std.com (Oliver Jones) ------------------------------------------------------------------------------- The following font aliases are required to make some clients work. For some Open Window clients Add to fonts/75dpi/fonts.alias -b&h-lucida-medium-r-normal-sans-9-90-75-75-p-0-iso8859-1 -b&h-lucida-medium-r-normal-sans-10-100-75-75-p-58-iso8859-1 -b&h-lucida-bold-r-normal-sans-9-90-75-75-p-0-iso8859-1 -b&h-lucida-bold-r-normal-sans-10-100-75-75-p-66-iso8859-1 screen.r.9 -b&h-lucida-medium-r-normal-sans-12-120-75-75-p-71-iso8859-1 0 -b&h-lucida-medium-r-normal-sans-12-120-75-75-p-71-iso8859-1 Doug Becker -- doug@nmri.ge.com More font aliases recommended by NCD for OpenWindows calander manager -b&h-lucida-medium-r----80------ -b&h-lucida-medium-r-normal-sans-8-80-75-75-p-45-iso8859-1 -b&h-lucida-bold-r----80------ -b&h-lucida-bold-r-normal-sans-8-80-75-75-p-50-iso8859-1 -b&h-lucida-medium-r----100------ -b&h-lucida-medium-r-normal-sans-10-100-75-75-p-58-iso8859-1 -b&h-lucida-bold-r----100------ -b&h-lucida-bold-r-normal-sans-10-100-75-75-p-66-iso8859-1 -b&h-lucida-medium-r----120------ -b&h-lucida-medium-r-normal-sans-12-120-75-75-p-71-iso8859-1 -b&h-lucida-bold-r----120------ -b&h-lucida-bold-r-normal-sans-12-120-75-75-p-79-iso8859-1 -b&h-lucida-bold-r----140------ -b&h-lucida-bold-r-normal-sans-14-140-75-75-p-92-iso8859-1 -b&h-lucidatypewriter-medium-r----120------ -b&h-lucidatypewriter-medium-r-normal-sans-12-120-75-75-m-70-iso8859-1 -b&h-lucidatypewriter-bold-r----120------ -b&h-lucidatypewriter-bold-r-normal-sans-12-120-75-75-m-70-iso8859-1 For the Wings program needs the following alias d12lucid -b&h-lucida-medium-r-normal-sans-12-120-75-75-p-71-iso8859-1 keith -- ksp@swri.edu -------------------------------------------------------------------------------