Installing XFree86 4.x and getting TrueType, Anti-Aliased Fonts

We are going to assume that you have a functional distro installed, but dont have XFree86 installed yet (remove it if you do have it installed).

  1. Download doctools and XFree86 from their ftp site
  2. Install doctools
    • tar zxvf doctools-1.2.tgz
    • cat Makefile | sed 's/usr\/local/usr/g' > Makefile~
    • mv Makefile~ Makefile
    • make
    • make install
  3. Verify the following libs are installed:
  4. unpack XFree86
    • for i in X4*.tgz
    • do
    • tar zxvf $i
    • done
    • cd xc
  5. create config/cf/host.def and put the following into it:
    (modify the 686 to suit your CPU)
    • #define LinkGLToUsrInclude[tab]NO
    • #define LinkGLToUsrLib[tab]NO
    • #define UseFreetype2[tab]YES
    • #define HasFreetype2[tab]YES
    • #define BuildFreetype2Library[tab]NO
    • #define FreeType2Dir[tab]/usr
    • #define BuildRender[tab]YES
    • #define BuildXftLibrary[tab]YES
    • #define DefaultGcc2i386Opt[tab]-O2 -march=i686 -mcpu=i686
    • #define GccWarningOptions[tab]-Wall
    • #define TermcapLibrary[tab]-lncurses
    • #define InstallXinitConfig[tab]YES
    • #define InstallXdmConfig[tab]YES
    • #define InstallFSConfig[tab]YES
    • #define BuildSpecsDocs[tab]YES
    • #define SpecsDocDirs[tab]CTEXT GL ICCCM X11 Xext Xmu Xv i18n xterm
    • #define BuildAllSpecsDocs[tab]YES
    • #define BuildXF86DRI[tab]YES
  6. compile and install it finally
    • make World
    • make install
    • make install.man
  7. Create your truetype font dir
    • mkdir /usr/X11R6/lib/X11/fonts/truetype/
  8. configure X for your system
    • xf86config
  9. Now hack /etc/X11/XF86Config for the fonts
    • <snip>
    • Section "Module"
    • [tab]Load[tab]"dbe"
    • [tab]Load[tab]"dri"
    • [tab]Load[tab]"extmod"
    • [tab]Load[tab]"freetype"
    • [tab]Load[tab]"glx"
    • [tab]Load[tab]"GLcore"
    • [tab]Load[tab]"pex5"
    • [tab]Load[tab]"record"
    • [tab]Load[tab]"speedo"
    • [tab]Load[tab]"type1"
    • [tab]Load[tab]"xie"
    • EndSection
    • <snip>
    • Section "Files"
    • [tab]RgbPath[tab]"/usr/X11R6/lib/X11/rgb"
    • [tab]FontPath[tab]"/usr/X11R6/lib/X11/fonts/truetype/"
    • [tab]FontPath[tab]"/usr/X11R6/lib/X11/fonts/misc/:unscaled"
    • [tab]FontPath[tab]"/usr/X11R6/lib/X11/fonts/100dpi/:unscaled"
    • [tab]FontPath[tab]"/usr/X11R6/lib/X11/fonts/75dpi/:unscaled"
    • [tab]FontPath[tab]"/usr/X11R6/lib/X11/fonts/Type1/"
    • [tab]FontPath[tab]"/usr/X11R6/lib/X11/fonts/Speedo/"
    • [tab]FontPath[tab]"/usr/X11R6/lib/X11/fonts/misc/"
    • [tab]FontPath[tab]"/usr/X11R6/lib/X11/fonts/100dpi/"
    • [tab]FontPath[tab]"/usr/X11R6/lib/X11/fonts/75dpi/"
    • EndSection
  10. Now hack on /etc/X11/XftConfig
    • dir "/usr/X11R6/lib/X11/fonts/Type1"
    • dir "/usr/X11R6/lib/X11/fonts/truetype"
    • #
    • # alias 'fixed' for 'mono'
    • #
    • match any family == "fixed" edit family =+ "mono";
    • #
    • # Check users config file
    • #
    • includeif "~/.xftconfig"
    • #
    • # Substitute TrueType fonts for Type1 versions
    • #
    • match any family == "Times" edit family += "Times New Roman";
    • match any family == "Helvetica" edit family += "Verdana";
    • match any family == "Courier" edit family += "Courier New";
    • #Use Lucidux fonts for default faces
    • match any family == "serif" edit family += "Times New Roman";
    • match any family == "sans" edit family += "Verdana";
    • #match any family == "mono" edit family += "LuciduxMono";
    • #
    • # Use monotype.com (andale) face where possible
    • #
    • match
    • any family == "mono"
    • all slant == roman
    • all weight < bold
    • edit
    • family += "monotype.com";
    • #
    • # otherwise, use courier
    • #
    • match any family == "mono" edit family += "Courier New";
    • #Alias between XLFD families and font file family name, prefer local
    • #fonts
    • match any family == "charter" edit family += "bitstream charter";
    • match any family == "bitstream charter" edit family =+ "charter";
    • match any family == "Lucidux Serif" edit family += "LuciduxSerif";
    • match any family == "LuciduxSerif" edit family =+ "Lucidux Serif";
    • match any family == "Lucidux Sans" edit family += "LuciduxSans";
    • match any family == "LuciduxSans" edit family =+ "Lucidux Sans";
    • match any family == "Lucidux Mono" edit family += "LuciduxMono";
    • match any family == "LuciduxMono" edit family =+ "Lucidux Mono";
    • #
    • # TrueType font aliases
    • #
    • match any family == "Comic Sans" edit family += "Comic Sans MS";
    • match any family == "Comic Sans MS" edit family =+ "Comic Sans";
    • match any family == "Trebuchet" edit family += "Trebuchet MS";
    • match any family == "Trebuchet MS" edit family =+ "Trebuchet";
    • match any family == "Monotype" edit family =+ "Monotype.com";
    • match any family == "Andale Mono" edit family += "Monotype.com";
    • match any family == "Monotype.com" edit family =+ "Andale Mono";
    • # control anti-aliasing at certain sizes
    • match any family == "Arial" any size > 9 any size < 15 edit antialias = false;
    • match any family == "Verdana" any size > 9 any size < 15 edit antialias = false;
    • match any family == "Tahoma" any size > 9 any size < 15 edit antialias = false;
  11. install fonts from C:\WINDOWS\FONTS into /usr/X11R6/lib/X11/fonts/truetype
  12. Prepare the font dir for XFree86
    • cd /usr/X11R6/lib/X11/fonts/truetype
    • ttmkfdir -o fonts.scale
    • mkfontdir
  13. Congrats! You now have your fonts installed, and XFree86 is configured to use them!
  14. Now you just need to install/configure KDE to use TrueType Fonts and Anti-Aliasing
    •  
    • P.S. I recommend you run XFree86 in 100 DPI mode for best results.
    • You might also want to re-install Mesa and Freetype since they are probably newer than the version included with XFree86
© Douglas J. Hunley (doug at linux-sxs.org)
searchSearch Index