| 4935 | | You might also try to query archie for files named with @file{hebrew}; |
|---|
| 4936 | | several ftp sites in Israel may also have the necessary files. |
|---|
| | 4936 | You might also try querying @code{archie} for files named with |
|---|
| | 4937 | @file{hebrew}; several ftp sites in Israel may also have the necessary |
|---|
| | 4938 | files. |
|---|
| | 4939 | |
|---|
| | 4940 | @node How to add fonts, , Right-to-left alphabets, Alternate character sets |
|---|
| | 4941 | @section How do I add fonts for use with Emacs? |
|---|
| | 4942 | @cindex add fonts for use with Emacs |
|---|
| | 4943 | @cindex intlfonts |
|---|
| | 4944 | |
|---|
| | 4945 | First, download and install the BDF font files and any auxiliary |
|---|
| | 4946 | packages they need. The GNU Intlfonts distribution can be found on |
|---|
| | 4947 | @uref{http://directory.fsf.org/localization/intlfonts.html, the GNU |
|---|
| | 4948 | Software Directory Web site}. |
|---|
| | 4949 | |
|---|
| | 4950 | Next, if you are on X Window system, issue the following two commands |
|---|
| | 4951 | from the shell's prompt: |
|---|
| | 4952 | |
|---|
| | 4953 | @example |
|---|
| | 4954 | xset +fp /usr/local/share/emacs/fonts |
|---|
| | 4955 | xset fp rehash |
|---|
| | 4956 | @end example |
|---|
| | 4957 | |
|---|
| | 4958 | @noindent |
|---|
| | 4959 | (Modify the first command if you installed the fonts in a directory |
|---|
| | 4960 | that is not @file{/usr/local/share/emacs/fonts}.) You also need to |
|---|
| | 4961 | arrange for these two commands to run whenever you log in, e.g., by |
|---|
| | 4962 | adding them to your window-system startup file, such as |
|---|
| | 4963 | @file{~/.xsessionrc} or @file{~/.gnomerc}. |
|---|
| | 4964 | |
|---|
| | 4965 | Now, add the following line to your @file{~/.emacs} init file: |
|---|
| | 4966 | |
|---|
| | 4967 | @lisp |
|---|
| | 4968 | (add-to-list 'bdf-directory-list "/usr/share/emacs/fonts/bdf") |
|---|
| | 4969 | @end lisp |
|---|
| | 4970 | |
|---|
| | 4971 | @noindent |
|---|
| | 4972 | (Again, modify the file name if you installed the fonts elsewhere.) |
|---|
| | 4973 | |
|---|
| | 4974 | Finally, if you wish to use the installed fonts with @code{ps-print}, |
|---|
| | 4975 | add the following line to your @file{~/.emacs}: |
|---|
| | 4976 | |
|---|
| | 4977 | @lisp |
|---|
| | 4978 | (setq ps-multibyte-buffer 'bdf-font-except-latin) |
|---|
| | 4979 | @end lisp |
|---|
| | 4980 | |
|---|
| | 4981 | A few additional steps are necessary for MS-Windows; they are listed |
|---|
| | 4982 | below. |
|---|
| | 4983 | |
|---|
| | 4984 | First, make sure @emph{all} the directories with BDF font files are |
|---|
| | 4985 | mentioned in @code{bdf-directory-list}. On Unix and GNU/Linux |
|---|
| | 4986 | systems, one normally runs @kbd{make install} to install the BDF fonts |
|---|
| | 4987 | in the same directory. By contrast, Windows users typically don't run |
|---|
| | 4988 | the Intlfonts installation command, but unpack the distribution in |
|---|
| | 4989 | some directory, which leaves the BDF fonts in its subdirectories. For |
|---|
| | 4990 | example, assume that you unpacked Intlfonts in @file{C:/Intlfonts}; |
|---|
| | 4991 | then you should set @code{bdf-directory-list} as follows: |
|---|
| | 4992 | |
|---|
| | 4993 | @lisp |
|---|
| | 4994 | (setq bdf-directory-list |
|---|
| | 4995 | '("C:/Intlfonts/Asian" |
|---|
| | 4996 | "C:/Intlfonts/Chinese" "C:/Intlfonts/Chinese.X" |
|---|
| | 4997 | "C:/Intlfonts/Chinese.BIG" "C:/Intlfonts/Ethiopic" |
|---|
| | 4998 | "C:/Intlfonts/European" "C:/Intlfonts/European.BIG" |
|---|
| | 4999 | "C:/Intlfonts/Japanese" "C:/Intlfonts/Japanese.X" |
|---|
| | 5000 | "C:/Intlfonts/Japanese.BIG" "C:/Intlfonts/Korean.X" |
|---|
| | 5001 | "C:/Intlfonts/Misc")) |
|---|
| | 5002 | @end lisp |
|---|
| | 5003 | |
|---|
| | 5004 | @cindex @code{w32-bdf-filename-alist} |
|---|
| | 5005 | @cindex @code{w32-find-bdf-fonts} |
|---|
| | 5006 | Next, you need to set up the variable @code{w32-bdf-filename-alist} to |
|---|
| | 5007 | an alist of the BDF fonts and their corresponding file names. |
|---|
| | 5008 | Assuming you have set @code{bdf-directory-list} to name all the |
|---|
| | 5009 | directories with the BDF font files, the following Lisp snippet will |
|---|
| | 5010 | set up @code{w32-bdf-filename-alist}: |
|---|
| | 5011 | |
|---|
| | 5012 | @lisp |
|---|
| | 5013 | (setq w32-bdf-filename-alist |
|---|
| | 5014 | (w32-find-bdf-fonts bdf-directory-list)) |
|---|
| | 5015 | @end lisp |
|---|
| | 5016 | |
|---|
| | 5017 | Now, create fontsets for the BDF fonts: |
|---|
| | 5018 | |
|---|
| | 5019 | @lisp |
|---|
| | 5020 | (create-fontset-from-fontset-spec |
|---|
| | 5021 | "-*-fixed-medium-r-normal-*-16-*-*-*-c-*-fontset-bdf, |
|---|
| | 5022 | japanese-jisx0208:-*-*-medium-r-normal-*-16-*-*-*-c-*-jisx0208.1983-*, |
|---|
| | 5023 | katakana-jisx0201:-*-*-medium-r-normal-*-16-*-*-*-c-*-jisx0201*-*, |
|---|
| | 5024 | latin-jisx0201:-*-*-medium-r-normal-*-16-*-*-*-c-*-jisx0201*-*, |
|---|
| | 5025 | japanese-jisx0208-1978:-*-*-medium-r-normal-*-16-*-*-*-c-*-jisx0208.1978-*, |
|---|
| | 5026 | thai-tis620:-misc-fixed-medium-r-normal--16-160-72-72-m-80-tis620.2529-1, |
|---|
| | 5027 | lao:-misc-fixed-medium-r-normal--16-160-72-72-m-80-MuleLao-1, |
|---|
| | 5028 | tibetan-1-column:-TibMdXA-fixed-medium-r-normal--16-160-72-72-m-80-MuleTibetan-1, |
|---|
| | 5029 | ethiopic:-Admas-Ethiomx16f-Medium-R-Normal--16-150-100-100-M-160-Ethiopic-Unicode, |
|---|
| | 5030 | tibetan:-TibMdXA-fixed-medium-r-normal--16-160-72-72-m-160-MuleTibetan-0") |
|---|
| | 5031 | @end lisp |
|---|
| | 5032 | |
|---|
| | 5033 | Many of the international bdf fonts from Intlfonts are type 0, and |
|---|
| | 5034 | therefore need to be added to font-encoding-alist: |
|---|
| | 5035 | |
|---|
| | 5036 | @lisp |
|---|
| | 5037 | (setq font-encoding-alist |
|---|
| | 5038 | (append '(("MuleTibetan-0" (tibetan . 0)) |
|---|
| | 5039 | ("GB2312" (chinese-gb2312 . 0)) |
|---|
| | 5040 | ("JISX0208" (japanese-jisx0208 . 0)) |
|---|
| | 5041 | ("JISX0212" (japanese-jisx0212 . 0)) |
|---|
| | 5042 | ("VISCII" (vietnamese-viscii-lower . 0)) |
|---|
| | 5043 | ("KSC5601" (korean-ksc5601 . 0)) |
|---|
| | 5044 | ("MuleArabic-0" (arabic-digit . 0)) |
|---|
| | 5045 | ("MuleArabic-1" (arabic-1-column . 0)) |
|---|
| | 5046 | ("MuleArabic-2" (arabic-2-column . 0))) |
|---|
| | 5047 | font-encoding-alist)) |
|---|
| | 5048 | @end lisp |
|---|
| | 5049 | |
|---|
| | 5050 | You can now use the Emacs font menu to select the @samp{bdf: 16-dot medium} |
|---|
| | 5051 | fontset, or you can select it by setting the default font in your |
|---|
| | 5052 | @file{~/.emacs}: |
|---|
| | 5053 | |
|---|
| | 5054 | @lisp |
|---|
| | 5055 | (set-default-font "fontset-bdf") |
|---|
| | 5056 | @end lisp |
|---|
| | 5057 | |
|---|