Next: , Previous: Multilingual fonts, Up: Fonts and text translation

5.4 How do I use bdf fonts with Emacs?

To use bdf fonts with Emacs, you need to tell Emacs where the fonts are located, create fontsets for them, and then use them. We'll use the 16 dot international fonts from as an example put together by Jason Rumney.

Download 16dots.tar.gz and unpack it; I'll assume that they are in c:\intlfonts. Then set w32-bdf-filename-alist to the list of fonts returned by using w32-find-bdf-fonts to enumerate all of the font files. It is a good idea to set the variable bdf-directory-list at the same time so ps-print knows where to find the fonts:

     (setq bdf-directory-list
           '("c:/intlfonts/Asian" "c:/intlfonts/Chinese"
             "c:/intlfonts/Chinese-X" "c:/intlfonts/Ethiopic"
     	"c:/intlfonts/European" "c:/intlfonts/Japanese"
             "c:/intlfonts/Japanese-X" "c:/intlfonts/Korean-X"
     (setq w32-bdf-filename-alist (w32-find-bdf-fonts bdf-directory-list))

Then create fontsets for the BDF fonts:


Many of the international bdf fonts from are type 0, and therefore need to be added to font-encoding-alist:

     ;; Need to add some fonts to font-encoding-alist since the bdf fonts
     ;; are type 0 not the default type 1.
     (setq font-encoding-alist
           (append '(("MuleTibetan-0" (tibetan . 0))
                     ("GB2312"        (chinese-gb2312 . 0))
                     ("JISX0208"      (japanese-jisx0208 . 0))
                     ("JISX0212"      (japanese-jisx0212 . 0))
                     ("VISCII"        (vietnamese-viscii-lower . 0))
                     ("KSC5601"       (korean-ksc5601 . 0))
                     ("MuleArabic-0"  (arabic-digit . 0))
                     ("MuleArabic-1"  (arabic-1-column . 0))
                     ("MuleArabic-2"  (arabic-2-column . 0))) font-encoding-alist))

You can now use the Emacs font menu (see How can I have Emacs use a font menu like on X?) to select the bdf: 16-dot medium fontset, or you can select it by setting the default font:

         (set-frame-font "fontset-bdf")

Try loading the file etc/HELLO, and you should be able to see the various international fonts displayed (except for Hindi, which is not included in the 16-dot font distribution).