FontInstallation

From IndLinux
Jump to: navigation, search

Installing Fonts under X/Xorg/XFree86

The quick way
Most current distributions & desktops use font config. Just copy the fonts under a directory in /usr/share/fonts

eg. for a system-wide installation
# mkdir /usr/share/fonts/myfonts
# cp wheremyfontsare/*.ttf /usr/share/fonts/myfonts/
# fc-cache -f
for local install in home dir
$ mkdir ~/.fonts
$ cp fonts.ttf ~/.fonts
Then just restart your app.

The older way
Older way of font installation usually involved the following steps

  • Creating a directory & copying the fonts in it.
  • Generating fonts.dir database
  • Setting the fontpath
  • Restarting Font server or X server

But most recent distributions allow font installation by just copying the fonts in a particular directory.

Depending upon the distribution or version of X server you are using the steps can vary slightly.

  • Create a directory and copy the fonts into it. If fonts are to be acessible by all users better put them under /usr/share/fonts/
eg  # mkdir /usr/share/fonts/myfonts
    # cp wheremyfontsare/*.ttf /usr/share/fonts/myfonts/
or  # cp wheremyfontsare/*.bdf /usr/share/fonts/myfonts/
  • Generating the fonts.dir file (Right now steps only for core X & TTF fonts)
If BDF fonts, then just run
    # cd /usr/share/fonts/myfonts/
    # mkfontdir
If TTF fonts, then run
    # cd /usr/share/fonts/myfonts/
    # ttmkfdir > fonts.scale
    # mkfontdir
  • Adding the fontpath
On Redhat distributions add the font path by
    # chkfontpath --add /usr/share/fonts/myfonts
On other distributions if chkfontpath is not available (eg Debian), 
you have to directly add the path in /etc/X11/XF86Config file. in following way
Section "Files"
      RgbPath      "/usr/X11R6/lib/X11/rgb"
      ModulePath   "/usr/X11R6/lib/modules"
      FontPath     "/usr/X11R6/lib/X11/fonts/misc/"
      ...
      FontPath     "/usr/share/fonts/myfonts/"
EndSection

Distro specifics

Debian/Ubuntu
For any debian based system to get Indic fonts working. Just do the following

# apt-get install ttf-indic-fonts
or ttf-bengali-fonts, ttf-devanagari-fonts, ttf-tamil-fonts etc to get fonts for particular script only.

ttf-indic-fonts does not have fonts for all languages (it definitely has fonts for Telugu). So you might have to install the language specific package (ttf-<yourlanguage>-fonts).

You can use Synaptic to see which all language-specific ttf fonts are available. (Ubuntu: System -> Administration -> Synaptic Package Manager, Search for 'ttf')

Ubuntu

Ubuntu (Hoary, Breezy) incorrectly handles unicode fonts (character reordering is not done). To fix this, uninstall ttf-freefont (Ubuntu: System -> Administration -> Synaptic Package Manager, Search for ttf-freefont, Right-click, Mark for Removal, Apply). The ttf-indic-fonts or ttf-<yourlanguage>-fonts package still needs to be installed as said above.

To selectively add/remove fonts:

# sudo nautilus fonts://
delete fonts for removing and drag-drop required font files into the window for adding

Fedora
Install Lohit series of fonts , the packages fonts-bengali, fonts-hindi, fonts-gujarati, fonts-punjabi, fonts-tamil etc.

For anymore fonts follow first method.

Desktop specific
Some desktops have GUI font installers for installing fonts via a GUI dialog. TODO