diff options
| -rw-r--r-- | doc/emacs/cmdargs.texi | 100 |
1 files changed, 85 insertions, 15 deletions
diff --git a/doc/emacs/cmdargs.texi b/doc/emacs/cmdargs.texi index f986dfd21ea..13fbe447111 100644 --- a/doc/emacs/cmdargs.texi +++ b/doc/emacs/cmdargs.texi | |||
| @@ -818,11 +818,19 @@ resources file to take effect. @xref{Resources}. When specifying a | |||
| 818 | font in your X resources file, you should not quote it. | 818 | font in your X resources file, you should not quote it. |
| 819 | 819 | ||
| 820 | @cindex fontconfig | 820 | @cindex fontconfig |
| 821 | Emacs recognizes two types of fonts: @dfn{client-side} fonts, which | ||
| 822 | are provided by the Xft and Fontconfig libraries, and | ||
| 823 | @dfn{server-side} fonts, which are provided by the X server itself. | ||
| 824 | Most client-side fonts support advanced font features such as | ||
| 825 | antialiasing and subpixel hinting, while server-side fonts do not. | ||
| 826 | |||
| 821 | There are four different ways to express a ``font name''. The first | 827 | There are four different ways to express a ``font name''. The first |
| 822 | is to use the @dfn{Fontconfig format}, which has the following form: | 828 | format consists of @dfn{Fontconfig patterns}. Fontconfig patterns |
| 829 | match only client-side fonts provided by Xft and Fontconfig, and have | ||
| 830 | the following form: | ||
| 823 | 831 | ||
| 824 | @smallexample | 832 | @smallexample |
| 825 | @var{fontname}[-@var{fontsize}][:@var{property1}][:@var{property2}]... | 833 | @var{fontname}[-@var{fontsize}][:@var{name1}=@var{values1}][:@var{name2}=@var{values2}]... |
| 826 | @end smallexample | 834 | @end smallexample |
| 827 | 835 | ||
| 828 | @noindent | 836 | @noindent |
| @@ -830,10 +838,38 @@ Within this format, any of the elements in braces may be omitted. | |||
| 830 | Here, @var{fontname} is the ``family name'' of the font, such as | 838 | Here, @var{fontname} is the ``family name'' of the font, such as |
| 831 | @samp{Monospace} or @samp{DejaVu Serif}; @var{fontsize} is the ``point | 839 | @samp{Monospace} or @samp{DejaVu Serif}; @var{fontsize} is the ``point |
| 832 | size'' of the font (one ``printer's point'' is about 1/72 of an inch); | 840 | size'' of the font (one ``printer's point'' is about 1/72 of an inch); |
| 833 | and the @var{property} entries specify font settings such as | 841 | and the @samp{@var{name}=@var{values}} entries specify settings such |
| 834 | @samp{bold}, @samp{italic}, @samp{weight=bold}, @samp{slant=oblique}, | 842 | as the slant and weight of the font. Each @var{values} may be a |
| 835 | and so forth. Here are some examples of specifying fonts using the | 843 | single value, or a list of values separated by commas. In addition, |
| 836 | Fontconfig format: | 844 | some property values are valid with only one kind of property name, in |
| 845 | which case the @samp{@var{name}=} part may be omitted. | ||
| 846 | |||
| 847 | Here is a list of common font properties: | ||
| 848 | |||
| 849 | @table @samp | ||
| 850 | @item slant | ||
| 851 | One of @samp{italic}, @samp{oblique} or @samp{roman}. | ||
| 852 | |||
| 853 | @item weight | ||
| 854 | One of @samp{light}, @samp{medium}, @samp{demibold}, @samp{bold} or | ||
| 855 | @samp{black}. | ||
| 856 | |||
| 857 | @item style | ||
| 858 | Some fonts define special styles which are a combination of slant and | ||
| 859 | weight. For instance, the font @samp{Dejavu Sans} defines the style | ||
| 860 | @samp{book}. This property, if specified, overrides the slant and | ||
| 861 | weight properties. | ||
| 862 | |||
| 863 | @item width | ||
| 864 | One of @samp{condensed}, @samp{normal}, or @samp{expanded}. | ||
| 865 | |||
| 866 | @item spacing | ||
| 867 | One of @samp{monospace}, @samp{proportional}, @samp{dual-width}, or | ||
| 868 | @samp{charcell}. | ||
| 869 | @end table | ||
| 870 | |||
| 871 | @noindent | ||
| 872 | Here are some examples of Fontconfig patterns: | ||
| 837 | 873 | ||
| 838 | @smallexample | 874 | @smallexample |
| 839 | Monospace | 875 | Monospace |
| @@ -843,16 +879,40 @@ DejaVu Sans Mono:bold:italic | |||
| 843 | Monospace-12:weight=bold:slant=italic | 879 | Monospace-12:weight=bold:slant=italic |
| 844 | @end smallexample | 880 | @end smallexample |
| 845 | 881 | ||
| 846 | The second way to specify a font is to use the @dfn{GTK format}. | 882 | See the Fontconfig manual for a more detailed description of |
| 847 | This has the syntax | 883 | Fontconfig patterns. This manual is located in the file |
| 884 | @file{fontconfig-user.html}, which is distributed with Fontconfig. It | ||
| 885 | is also available online at | ||
| 886 | @url{http://fontconfig.org/fontconfig-user.html}. In particular, the | ||
| 887 | manual describes additional font properties that influence how the | ||
| 888 | font is hinted, antialiased, or scaled. | ||
| 889 | |||
| 890 | The second way to specify a font is to use a @dfn{GTK font | ||
| 891 | description}. Like Fontconfig patterns, GTK font descriptions match | ||
| 892 | only client-side fonts provided by Xft and Fontconfig. They have the | ||
| 893 | syntax | ||
| 848 | 894 | ||
| 849 | @smallexample | 895 | @smallexample |
| 850 | @var{fontname} [@var{properties}] [@var{fontsize}] | 896 | @var{fontname} [@var{properties}] [@var{fontsize}] |
| 851 | @end smallexample | 897 | @end smallexample |
| 852 | 898 | ||
| 899 | @noindent | ||
| 853 | where @var{fontname} is the family name, @var{properties} is a list of | 900 | where @var{fontname} is the family name, @var{properties} is a list of |
| 854 | font properties separated by spaces, and @var{fontsize} is the point | 901 | property values separated by spaces, and @var{fontsize} is the point |
| 855 | size. For example: | 902 | size. The properties that you may specify are as follows: |
| 903 | |||
| 904 | @table @samp | ||
| 905 | @item style | ||
| 906 | One of @samp{roman}, @samp{italic} or @samp{oblique}. If omitted, the | ||
| 907 | @samp{roman} style is used. | ||
| 908 | @item weight | ||
| 909 | One of @samp{medium}, @samp{ultra-light}, @samp{light}, | ||
| 910 | @samp{semi-bold}, or @samp{bold}. If omitted, @samp{medium} weight is | ||
| 911 | used. | ||
| 912 | @end table | ||
| 913 | |||
| 914 | @noindent | ||
| 915 | Here are some examples of GTK font descriptions: | ||
| 856 | 916 | ||
| 857 | @smallexample | 917 | @smallexample |
| 858 | Monospace 12 | 918 | Monospace 12 |
| @@ -944,14 +1004,24 @@ normal font specification. For instance, | |||
| 944 | @end smallexample | 1004 | @end smallexample |
| 945 | 1005 | ||
| 946 | @noindent | 1006 | @noindent |
| 947 | is equivalent to @samp{6x13}. | 1007 | is equivalent to @samp{6x13}. This is the fourth and final method of |
| 1008 | specifying a font. | ||
| 948 | 1009 | ||
| 949 | @cindex listing system fonts | 1010 | @cindex listing system fonts |
| 950 | You will probably want to use a fixed-width default font---that is, | 1011 | You will probably want to use a fixed-width default font---that is, |
| 951 | a font in which all characters have the same width. Any font with | 1012 | a font in which all characters have the same width. Here's how to use |
| 952 | @samp{m} or @samp{c} in the @var{spacing} field of the XLFD is a | 1013 | the @command{fc-list} command to list all fixed-width Xft and |
| 953 | fixed-width font. Here's how to use the @command{xlsfonts} program to | 1014 | Fontconfig fonts available on your system: |
| 954 | list all the fixed-width fonts available on your system: | 1015 | |
| 1016 | @example | ||
| 1017 | fc-list :spacing=mono | ||
| 1018 | fc-list :spacing=charcell | ||
| 1019 | @end example | ||
| 1020 | |||
| 1021 | For server-side X fonts, any font with @samp{m} or @samp{c} in the | ||
| 1022 | @var{spacing} field of the XLFD is a fixed-width font. Here's how to | ||
| 1023 | use the @command{xlsfonts} program to list all the fixed-width fonts | ||
| 1024 | available on your system: | ||
| 955 | 1025 | ||
| 956 | @example | 1026 | @example |
| 957 | xlsfonts -fn '*x*' | egrep "^[0-9]+x[0-9]+" | 1027 | xlsfonts -fn '*x*' | egrep "^[0-9]+x[0-9]+" |