diff options
| author | Chong Yidong | 2008-11-23 03:24:49 +0000 |
|---|---|---|
| committer | Chong Yidong | 2008-11-23 03:24:49 +0000 |
| commit | 0e3f4049b6f560fefd47ba0b090178789f6243ca (patch) | |
| tree | 4631e9ef481558df38de85a6f039c6723f907247 | |
| parent | e85103ec31743faaf05c5868576056146906a49a (diff) | |
| download | emacs-0e3f4049b6f560fefd47ba0b090178789f6243ca.tar.gz emacs-0e3f4049b6f560fefd47ba0b090178789f6243ca.zip | |
(Font X): Document Fontconfig and GTK font specification formats.
| -rw-r--r-- | doc/emacs/cmdargs.texi | 192 |
1 files changed, 128 insertions, 64 deletions
diff --git a/doc/emacs/cmdargs.texi b/doc/emacs/cmdargs.texi index 2c5f3aabda4..f5b5e811186 100644 --- a/doc/emacs/cmdargs.texi +++ b/doc/emacs/cmdargs.texi | |||
| @@ -779,117 +779,182 @@ remote machine. | |||
| 779 | @appendixsec Font Specification Options | 779 | @appendixsec Font Specification Options |
| 780 | @cindex font name (X Window System) | 780 | @cindex font name (X Window System) |
| 781 | 781 | ||
| 782 | By default, Emacs displays text in a twelve point Courier font (when | 782 | By default, Emacs displays text in X using a twelve point monospace |
| 783 | using X). You can specify a different font on your command line | 783 | font. You can specify a different font using the command line option |
| 784 | through the option @samp{-fn @var{name}} (or @samp{--font}, which is | 784 | @samp{-fn @var{font}} (or @samp{--font}, which is an alias for |
| 785 | an alias for @samp{-fn}). | 785 | @samp{-fn}). |
| 786 | 786 | ||
| 787 | @table @samp | 787 | @table @samp |
| 788 | @item -fn @var{name} | 788 | @item -fn @var{font} |
| 789 | @opindex -fn | 789 | @opindex -fn |
| 790 | @itemx --font=@var{name} | 790 | @itemx --font=@var{font} |
| 791 | @opindex --font | 791 | @opindex --font |
| 792 | @cindex specify default font from the command line | 792 | @cindex specify default font from the command line |
| 793 | Use font @var{name} as the default font. | 793 | Use @var{font} as the default font. |
| 794 | @end table | 794 | @end table |
| 795 | 795 | ||
| 796 | Under X, each font has a long name which consists of fourteen words | 796 | @cindex X defaults file |
| 797 | or numbers, separated by dashes. Some fonts also have shorter | 797 | @cindex X resources file |
| 798 | nicknames. For instance, @samp{9x15} is such a nickname. This font | 798 | |
| 799 | makes each character nine pixels wide and fifteen pixels high. You | 799 | You can also specify the font using your X resources file (usually a |
| 800 | can use either kind of name. Case is insignificant in both kinds. | 800 | file named @file{.Xdefaults} or @file{.Xresources} in your home |
| 801 | You can use wildcard patterns for the font name; then Emacs lets X | 801 | directory), by adding a line like this: |
| 802 | choose one of the fonts that match the pattern. The wildcard | 802 | |
| 803 | character @samp{*} matches any sequence of characters (including none) | 803 | @smallexample |
| 804 | and @samp{?} matches any single character. However, matching is | 804 | emacs.font: @samp{font} |
| 805 | implementation-dependent, and can be inaccurate when wildcards match | 805 | @end smallexample |
| 806 | dashes in a long name. For reliable results, supply all 14 dashes and | 806 | |
| 807 | use wildcards only within a field. Here is an example, which happens | 807 | @noindent |
| 808 | to specify the font whose nickname is @samp{6x13}: | 808 | You must restart X, or use the @command{xrdb} command, for the X |
| 809 | resources file to take effect. @xref{Resources}. | ||
| 810 | |||
| 811 | @cindex fontconfig | ||
| 812 | There are four different ways to express a ``font name''. The first | ||
| 813 | is to use the @dfn{Fontconfig format}, which has the following form: | ||
| 814 | |||
| 815 | @smallexample | ||
| 816 | @var{fontname}[-@var{fontsize}][:@var{property1}][:@var{property2}]... | ||
| 817 | @end smallexample | ||
| 818 | |||
| 819 | @noindent | ||
| 820 | Within this format, any of the elements in braces may be omitted. | ||
| 821 | Here, @var{fontname} is the ``family name'' of the font, such as | ||
| 822 | @samp{Monospace} or @samp{DejaVu Serif}; @var{fontsize} is the ``point | ||
| 823 | size'' of the font (one ``printer's point'' is about 1/72 of an inch); | ||
| 824 | and the @var{property} entries specify font settings such as | ||
| 825 | @samp{bold}, @samp{italic}, @samp{weight=bold}, @samp{slant=oblique}, | ||
| 826 | and so forth. Here are some examples of specifying fonts using the | ||
| 827 | Fontconfig format: | ||
| 809 | 828 | ||
| 810 | @smallexample | 829 | @smallexample |
| 811 | emacs -fn \ | 830 | Monospace |
| 812 | "-misc-fixed-medium-r-semicondensed--13-*-*-*-c-60-iso8859-1" & | 831 | Monospace-12 |
| 832 | Monospace-12:bold | ||
| 833 | DejaVu Sans Mono:bold:italic | ||
| 834 | Monospace-12:weight=bold:slant=italic | ||
| 813 | @end smallexample | 835 | @end smallexample |
| 814 | 836 | ||
| 815 | @noindent | 837 | @noindent |
| 816 | You can also specify the font in your @file{.Xdefaults} file: | 838 | When passing a font specification to Emacs on the command line, you |
| 839 | may need to ``quote'' it, by enclosing it in quotation marks, if it | ||
| 840 | contains characters that the shell treats specially (e.g. spaces). | ||
| 841 | For example: | ||
| 817 | 842 | ||
| 818 | @smallexample | 843 | @smallexample |
| 819 | emacs.font: -misc-fixed-medium-r-semicondensed--13-*-*-*-c-60-iso8859-1 | 844 | emacs -fn "DejaVu Sans Mono-12" |
| 820 | @end smallexample | 845 | @end smallexample |
| 821 | 846 | ||
| 822 | Note that if you use a wildcard pattern on the command line, you | 847 | @noindent |
| 823 | need to enclose it in single or double quotes, to prevent the shell | 848 | When specifying a font in your X resources file, you should not quote |
| 824 | from accidentally expanding it into a list of file names. On the | 849 | it. |
| 825 | other hand, you should not quote the name in the @file{.Xdefaults} | ||
| 826 | file. | ||
| 827 | 850 | ||
| 828 | The default font used by Emacs (under X) is: | 851 | The second way to specify a font is to use the @dfn{GTK format}. |
| 852 | This has the syntax | ||
| 829 | 853 | ||
| 830 | @smallexample | 854 | @smallexample |
| 831 | -adobe-courier-medium-r-*-*-*-120-*-*-*-*-iso8859-1 | 855 | @var{fontname} [@var{properties}] [@var{fontsize}] |
| 832 | @end smallexample | 856 | @end smallexample |
| 833 | 857 | ||
| 834 | A long font name has the following form: | 858 | where @var{fontname} is the family name, @var{properties} is a list of |
| 859 | font properties separated by spaces, and @var{fontsize} is the point | ||
| 860 | size. For example: | ||
| 861 | |||
| 862 | @smallexample | ||
| 863 | Monospace 12 | ||
| 864 | Monospace Bold Italic 12 | ||
| 865 | @end smallexample | ||
| 866 | |||
| 867 | @cindex XLFD | ||
| 868 | @cindex X Logical Font Description | ||
| 869 | The third way to specify a font is to use an @dfn{XLFD} (@dfn{X | ||
| 870 | Logical Font Description}), which is the traditional method for | ||
| 871 | specifying fonts under X. Each XLFD consists of fourteen words or | ||
| 872 | numbers, separated by dashes, like this: | ||
| 873 | |||
| 874 | @smallexample | ||
| 875 | -misc-fixed-medium-r-semicondensed--13-*-*-*-c-60-iso8859-1 | ||
| 876 | @end smallexample | ||
| 877 | |||
| 878 | @noindent | ||
| 879 | A wildcard character (@samp{*}) in an XLFD matches any sequence of | ||
| 880 | characters (including none), and @samp{?} matches any single | ||
| 881 | character. However, matching is implementation-dependent, and can be | ||
| 882 | inaccurate when wildcards match dashes in a long name. For reliable | ||
| 883 | results, supply all 14 dashes and use wildcards only within a field. | ||
| 884 | Case is insignificant in an XLFD. The syntax for an XLFD is as | ||
| 885 | follows: | ||
| 835 | 886 | ||
| 836 | @smallexample | 887 | @smallexample |
| 837 | -@var{maker}-@var{family}-@var{weight}-@var{slant}-@var{widthtype}-@var{style}@dots{} | 888 | -@var{maker}-@var{family}-@var{weight}-@var{slant}-@var{widthtype}-@var{style}@dots{} |
| 838 | @dots{}-@var{pixels}-@var{height}-@var{horiz}-@var{vert}-@var{spacing}-@var{width}-@var{registry}-@var{encoding} | 889 | @dots{}-@var{pixels}-@var{height}-@var{horiz}-@var{vert}-@var{spacing}-@var{width}-@var{registry}-@var{encoding} |
| 839 | @end smallexample | 890 | @end smallexample |
| 840 | 891 | ||
| 892 | @noindent | ||
| 893 | The entries have the following meanings: | ||
| 894 | |||
| 841 | @table @var | 895 | @table @var |
| 842 | @item maker | 896 | @item maker |
| 843 | This is the name of the font manufacturer. | 897 | The name of the font manufacturer. |
| 844 | @item family | 898 | @item family |
| 845 | This is the name of the font family---for example, @samp{courier}. | 899 | The name of the font family (e.g. @samp{courier}). |
| 846 | @item weight | 900 | @item weight |
| 847 | This is normally @samp{bold}, @samp{medium} or @samp{light}. Other | 901 | The font weight---normally either @samp{bold}, @samp{medium} or |
| 848 | words may appear here in some font names. | 902 | @samp{light}. Some font names support other values. |
| 849 | @item slant | 903 | @item slant |
| 850 | This is @samp{r} (roman), @samp{i} (italic), @samp{o} (oblique), | 904 | The font slant---normally @samp{r} (roman), @samp{i} (italic), |
| 851 | @samp{ri} (reverse italic), or @samp{ot} (other). | 905 | @samp{o} (oblique), @samp{ri} (reverse italic), or @samp{ot} (other). |
| 906 | Some font names support other values. | ||
| 852 | @item widthtype | 907 | @item widthtype |
| 853 | This is normally @samp{condensed}, @samp{extended}, @samp{semicondensed} | 908 | The font width---normally @samp{condensed}, @samp{extended}, |
| 854 | or @samp{normal}. Other words may appear here in some font names. | 909 | @samp{semicondensed} or @samp{normal} (some font names support other |
| 910 | values). | ||
| 855 | @item style | 911 | @item style |
| 856 | This is an optional additional style name. Usually it is empty---most | 912 | An optional additional style name. Usually it is empty---most long |
| 857 | long font names have two hyphens in a row at this point. | 913 | font names have two hyphens in a row at this point. |
| 858 | @item pixels | 914 | @item pixels |
| 859 | This is the font height, in pixels. | 915 | The font height, in pixels. |
| 860 | @item height | 916 | @item height |
| 861 | This is the font height on the screen, measured in tenths of a printer's | 917 | The font height on the screen, measured in tenths of a printer's |
| 862 | point---approximately 1/720 of an inch. In other words, it is the point | 918 | point. This is the point size of the font, times ten. For a given |
| 863 | size of the font, times ten. For a given vertical resolution, | 919 | vertical resolution, @var{height} and @var{pixels} are proportional; |
| 864 | @var{height} and @var{pixels} are proportional; therefore, it is common | 920 | therefore, it is common to specify just one of them and use @samp{*} |
| 865 | to specify just one of them and use @samp{*} for the other. | 921 | for the other. |
| 866 | @item horiz | 922 | @item horiz |
| 867 | This is the horizontal resolution, in pixels per inch, of the screen for | 923 | The horizontal resolution, in pixels per inch, of the screen for which |
| 868 | which the font is intended. | 924 | the font is intended. |
| 869 | @item vert | 925 | @item vert |
| 870 | This is the vertical resolution, in pixels per inch, of the screen for | 926 | The vertical resolution, in pixels per inch, of the screen for which |
| 871 | which the font is intended. Normally the resolution of the fonts on | 927 | the font is intended. Normally the resolution of the fonts on your |
| 872 | your system is the right value for your screen; therefore, you normally | 928 | system is the right value for your screen; therefore, you normally |
| 873 | specify @samp{*} for this and @var{horiz}. | 929 | specify @samp{*} for this and @var{horiz}. |
| 874 | @item spacing | 930 | @item spacing |
| 875 | This is @samp{m} (monospace), @samp{p} (proportional) or @samp{c} | 931 | This is @samp{m} (monospace), @samp{p} (proportional) or @samp{c} |
| 876 | (character cell). | 932 | (character cell). |
| 877 | @item width | 933 | @item width |
| 878 | This is the average character width, in pixels, multiplied by ten. | 934 | The average character width, in pixels, multiplied by ten. |
| 879 | @item registry | 935 | @item registry |
| 880 | @itemx encoding | 936 | @itemx encoding |
| 881 | These together make up the X font character set that the font depicts. | 937 | The X font character set that the font depicts. (X font character |
| 882 | (X font character sets are not the same as Emacs charsets, but they | 938 | sets are not the same as Emacs character sets, but they are similar.) |
| 883 | are solutions for the same problem.) You can use the | 939 | You can use the @command{xfontsel} program to check which choices you |
| 884 | @command{xfontsel} program to check which choices you have. However, | 940 | have. Normally you should use @samp{iso8859} for @var{registry} and |
| 885 | normally you should use @samp{iso8859} for @var{registry} and @samp{1} | 941 | @samp{1} for @var{encoding}. |
| 886 | for @var{encoding}. | ||
| 887 | @end table | 942 | @end table |
| 888 | 943 | ||
| 944 | Some fonts have shorter nicknames, which you can use instead of a | ||
| 945 | normal font specification. For instance, | ||
| 946 | |||
| 947 | @smallexample | ||
| 948 | -misc-fixed-medium-r-semicondensed--13-*-*-*-c-60-iso8859-1 | ||
| 949 | @end smallexample | ||
| 950 | |||
| 951 | @noindent | ||
| 952 | is equivalent to @samp{6x13}. | ||
| 953 | |||
| 889 | @cindex listing system fonts | 954 | @cindex listing system fonts |
| 890 | You will probably want to use a fixed-width default font---that is, | 955 | You will probably want to use a fixed-width default font---that is, |
| 891 | a font in which all characters have the same width. Any font with | 956 | a font in which all characters have the same width. Any font with |
| 892 | @samp{m} or @samp{c} in the @var{spacing} field of the long name is a | 957 | @samp{m} or @samp{c} in the @var{spacing} field of the XLFD is a |
| 893 | fixed-width font. Here's how to use the @command{xlsfonts} program to | 958 | fixed-width font. Here's how to use the @command{xlsfonts} program to |
| 894 | list all the fixed-width fonts available on your system: | 959 | list all the fixed-width fonts available on your system: |
| 895 | 960 | ||
| @@ -910,9 +975,8 @@ xfd -fn 6x13 | |||
| 910 | @noindent | 975 | @noindent |
| 911 | displays the entire font @samp{6x13}. | 976 | displays the entire font @samp{6x13}. |
| 912 | 977 | ||
| 913 | While running Emacs, you can set the font of the current frame | 978 | While running Emacs, you can set the font of a specific kind of text |
| 914 | (@pxref{Frame Parameters}) or for a specific kind of text | 979 | (@pxref{Faces}), or of a particular frame (@pxref{Frame Parameters}). |
| 915 | (@pxref{Faces}). | ||
| 916 | 980 | ||
| 917 | @node Colors | 981 | @node Colors |
| 918 | @appendixsec Window Color Options | 982 | @appendixsec Window Color Options |