aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorChong Yidong2008-12-09 14:32:16 +0000
committerChong Yidong2008-12-09 14:32:16 +0000
commitb5b91ca6c4d3c2d9896c4eb07fd2a48fb5d5ca7e (patch)
tree4a7567f2126793ab81074fc2aa3ada5129f158b6
parenta323fa1421b92c3b3620a6672a7c0cf44077177b (diff)
downloademacs-b5b91ca6c4d3c2d9896c4eb07fd2a48fb5d5ca7e.tar.gz
emacs-b5b91ca6c4d3c2d9896c4eb07fd2a48fb5d5ca7e.zip
(Font X): Distinguish between client-side and server-side fonts. List
valid Fontconfig properties. Add reference to Fontconfig manual. List valid GTK font properties. Explain use of fc-list.
-rw-r--r--doc/emacs/cmdargs.texi100
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
818font in your X resources file, you should not quote it. 818font 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
822are provided by the Xft and Fontconfig libraries, and
823@dfn{server-side} fonts, which are provided by the X server itself.
824Most client-side fonts support advanced font features such as
825antialiasing 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
822is to use the @dfn{Fontconfig format}, which has the following form: 828format consists of @dfn{Fontconfig patterns}. Fontconfig patterns
829match only client-side fonts provided by Xft and Fontconfig, and have
830the 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.
830Here, @var{fontname} is the ``family name'' of the font, such as 838Here, @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
832size'' of the font (one ``printer's point'' is about 1/72 of an inch); 840size'' of the font (one ``printer's point'' is about 1/72 of an inch);
833and the @var{property} entries specify font settings such as 841and the @samp{@var{name}=@var{values}} entries specify settings such
834@samp{bold}, @samp{italic}, @samp{weight=bold}, @samp{slant=oblique}, 842as the slant and weight of the font. Each @var{values} may be a
835and so forth. Here are some examples of specifying fonts using the 843single value, or a list of values separated by commas. In addition,
836Fontconfig format: 844some property values are valid with only one kind of property name, in
845which case the @samp{@var{name}=} part may be omitted.
846
847Here is a list of common font properties:
848
849@table @samp
850@item slant
851One of @samp{italic}, @samp{oblique} or @samp{roman}.
852
853@item weight
854One of @samp{light}, @samp{medium}, @samp{demibold}, @samp{bold} or
855@samp{black}.
856
857@item style
858Some fonts define special styles which are a combination of slant and
859weight. For instance, the font @samp{Dejavu Sans} defines the style
860@samp{book}. This property, if specified, overrides the slant and
861weight properties.
862
863@item width
864One of @samp{condensed}, @samp{normal}, or @samp{expanded}.
865
866@item spacing
867One of @samp{monospace}, @samp{proportional}, @samp{dual-width}, or
868@samp{charcell}.
869@end table
870
871@noindent
872Here are some examples of Fontconfig patterns:
837 873
838@smallexample 874@smallexample
839Monospace 875Monospace
@@ -843,16 +879,40 @@ DejaVu Sans Mono:bold:italic
843Monospace-12:weight=bold:slant=italic 879Monospace-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}. 882See the Fontconfig manual for a more detailed description of
847This has the syntax 883Fontconfig patterns. This manual is located in the file
884@file{fontconfig-user.html}, which is distributed with Fontconfig. It
885is also available online at
886@url{http://fontconfig.org/fontconfig-user.html}. In particular, the
887manual describes additional font properties that influence how the
888font is hinted, antialiased, or scaled.
889
890 The second way to specify a font is to use a @dfn{GTK font
891description}. Like Fontconfig patterns, GTK font descriptions match
892only client-side fonts provided by Xft and Fontconfig. They have the
893syntax
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
853where @var{fontname} is the family name, @var{properties} is a list of 900where @var{fontname} is the family name, @var{properties} is a list of
854font properties separated by spaces, and @var{fontsize} is the point 901property values separated by spaces, and @var{fontsize} is the point
855size. For example: 902size. The properties that you may specify are as follows:
903
904@table @samp
905@item style
906One of @samp{roman}, @samp{italic} or @samp{oblique}. If omitted, the
907@samp{roman} style is used.
908@item weight
909One of @samp{medium}, @samp{ultra-light}, @samp{light},
910@samp{semi-bold}, or @samp{bold}. If omitted, @samp{medium} weight is
911used.
912@end table
913
914@noindent
915Here are some examples of GTK font descriptions:
856 916
857@smallexample 917@smallexample
858Monospace 12 918Monospace 12
@@ -944,14 +1004,24 @@ normal font specification. For instance,
944@end smallexample 1004@end smallexample
945 1005
946@noindent 1006@noindent
947is equivalent to @samp{6x13}. 1007is equivalent to @samp{6x13}. This is the fourth and final method of
1008specifying 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,
951a font in which all characters have the same width. Any font with 1012a 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 1013the @command{fc-list} command to list all fixed-width Xft and
953fixed-width font. Here's how to use the @command{xlsfonts} program to 1014Fontconfig fonts available on your system:
954list all the fixed-width fonts available on your system: 1015
1016@example
1017fc-list :spacing=mono
1018fc-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
1023use the @command{xlsfonts} program to list all the fixed-width fonts
1024available on your system:
955 1025
956@example 1026@example
957xlsfonts -fn '*x*' | egrep "^[0-9]+x[0-9]+" 1027xlsfonts -fn '*x*' | egrep "^[0-9]+x[0-9]+"