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