emacs-diffs
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[Emacs-diffs] emacs/doc/emacs cmdargs.texi


From: Chong Yidong
Subject: [Emacs-diffs] emacs/doc/emacs cmdargs.texi
Date: Sun, 23 Nov 2008 03:24:49 +0000

CVSROOT:        /sources/emacs
Module name:    emacs
Changes by:     Chong Yidong <cyd>      08/11/23 03:24:49

Modified files:
        doc/emacs      : cmdargs.texi 

Log message:
         (Font X): Document Fontconfig and GTK font specification formats.

CVSWeb URLs:
http://cvs.savannah.gnu.org/viewcvs/emacs/doc/emacs/cmdargs.texi?cvsroot=emacs&r1=1.7&r2=1.8

Patches:
Index: cmdargs.texi
===================================================================
RCS file: /sources/emacs/emacs/doc/emacs/cmdargs.texi,v
retrieving revision 1.7
retrieving revision 1.8
diff -u -b -r1.7 -r1.8
--- cmdargs.texi        12 Nov 2008 23:59:04 -0000      1.7
+++ cmdargs.texi        23 Nov 2008 03:24:49 -0000      1.8
@@ -779,117 +779,182 @@
 @appendixsec Font Specification Options
 @cindex font name (X Window System)
 
-  By default, Emacs displays text in a twelve point Courier font (when
-using X).  You can specify a different font on your command line
-through the option @samp{-fn @var{name}} (or @samp{--font}, which is
-an alias for @samp{-fn}).
+  By default, Emacs displays text in X using a twelve point monospace
+font.  You can specify a different font using the command line option
address@hidden @var{font}} (or @samp{--font}, which is an alias for
address@hidden).
 
 @table @samp
address@hidden -fn @var{name}
address@hidden -fn @var{font}
 @opindex -fn
address@hidden address@hidden
address@hidden address@hidden
 @opindex --font
 @cindex specify default font from the command line
-Use font @var{name} as the default font.
+Use @var{font} as the default font.
 @end table
 
-  Under X, each font has a long name which consists of fourteen words
-or numbers, separated by dashes.  Some fonts also have shorter
-nicknames.  For instance, @samp{9x15} is such a nickname.  This font
-makes each character nine pixels wide and fifteen pixels high.  You
-can use either kind of name.  Case is insignificant in both kinds.
-You can use wildcard patterns for the font name; then Emacs lets X
-choose one of the fonts that match the pattern.  The wildcard
-character @samp{*} matches any sequence of characters (including none)
-and @samp{?} matches any single character.  However, matching is
-implementation-dependent, and can be inaccurate when wildcards match
-dashes in a long name.  For reliable results, supply all 14 dashes and
-use wildcards only within a field.  Here is an example, which happens
-to specify the font whose nickname is @samp{6x13}:
address@hidden X defaults file
address@hidden X resources file
+
+  You can also specify the font using your X resources file (usually a
+file named @file{.Xdefaults} or @file{.Xresources} in your home
+directory), by adding a line like this:
+
address@hidden
+emacs.font: @samp{font}
address@hidden smallexample
+
address@hidden
+You must restart X, or use the @command{xrdb} command, for the X
+resources file to take effect.  @xref{Resources}.
+
address@hidden fontconfig
+  There are four different ways to express a ``font name''.  The first
+is to use the @dfn{Fontconfig format}, which has the following form:
+
address@hidden
address@hidden@var{fontsize}][:@var{property1}][:@var{property2}]...
address@hidden smallexample
+
address@hidden
+Within this format, any of the elements in braces may be omitted.
+Here, @var{fontname} is the ``family name'' of the font, such as
address@hidden or @samp{DejaVu Serif}; @var{fontsize} is the ``point
+size'' of the font (one ``printer's point'' is about 1/72 of an inch);
+and the @var{property} entries specify font settings such as
address@hidden, @samp{italic}, @samp{weight=bold}, @samp{slant=oblique},
+and so forth.  Here are some examples of specifying fonts using the
+Fontconfig format:
 
 @smallexample
-emacs -fn \
-  "-misc-fixed-medium-r-semicondensed--13-*-*-*-c-60-iso8859-1" &
+Monospace
+Monospace-12
+Monospace-12:bold
+DejaVu Sans Mono:bold:italic
+Monospace-12:weight=bold:slant=italic
 @end smallexample
 
 @noindent
-You can also specify the font in your @file{.Xdefaults} file:
+When passing a font specification to Emacs on the command line, you
+may need to ``quote'' it, by enclosing it in quotation marks, if it
+contains characters that the shell treats specially (e.g. spaces).
+For example:
 
 @smallexample
-emacs.font: -misc-fixed-medium-r-semicondensed--13-*-*-*-c-60-iso8859-1
+emacs -fn "DejaVu Sans Mono-12"
 @end smallexample
 
-  Note that if you use a wildcard pattern on the command line, you
-need to enclose it in single or double quotes, to prevent the shell
-from accidentally expanding it into a list of file names.  On the
-other hand, you should not quote the name in the @file{.Xdefaults}
-file.
address@hidden
+When specifying a font in your X resources file, you should not quote
+it.
 
-The default font used by Emacs (under X) is:
+  The second way to specify a font is to use the @dfn{GTK format}.
+This has the syntax
 
 @smallexample
--adobe-courier-medium-r-*-*-*-120-*-*-*-*-iso8859-1
address@hidden address@hidden address@hidden
 @end smallexample
 
-  A long font name has the following form:
+where @var{fontname} is the family name, @var{properties} is a list of
+font properties separated by spaces, and @var{fontsize} is the point
+size.  For example:
+
address@hidden
+Monospace 12
+Monospace Bold Italic 12
address@hidden smallexample
+
address@hidden XLFD
address@hidden X Logical Font Description
+  The third way to specify a font is to use an @dfn{XLFD} (@dfn{X
+Logical Font Description}), which is the traditional method for
+specifying fonts under X.  Each XLFD consists of fourteen words or
+numbers, separated by dashes, like this:
+
address@hidden
+-misc-fixed-medium-r-semicondensed--13-*-*-*-c-60-iso8859-1
address@hidden smallexample
+
address@hidden
+A wildcard character (@samp{*}) in an XLFD matches any sequence of
+characters (including none), and @samp{?} matches any single
+character.  However, matching is implementation-dependent, and can be
+inaccurate when wildcards match dashes in a long name.  For reliable
+results, supply all 14 dashes and use wildcards only within a field.
+Case is insignificant in an XLFD.  The syntax for an XLFD is as
+follows:
 
 @smallexample
 address@hidden@address@hidden@address@hidden@address@hidden
 @address@hidden@address@hidden@address@hidden@address@hidden@var{encoding}
 @end smallexample
 
address@hidden
+The entries have the following meanings:
+
 @table @var
 @item maker
-This is the name of the font manufacturer.
+The name of the font manufacturer.
 @item family
-This is the name of the font family---for example, @samp{courier}.
+The name of the font family (e.g. @samp{courier}).
 @item weight
-This is normally @samp{bold}, @samp{medium} or @samp{light}.  Other
-words may appear here in some font names.
+The font weight---normally either @samp{bold}, @samp{medium} or
address@hidden  Some font names support other values.
 @item slant
-This is @samp{r} (roman), @samp{i} (italic), @samp{o} (oblique),
address@hidden (reverse italic), or @samp{ot} (other).
+The font slant---normally @samp{r} (roman), @samp{i} (italic),
address@hidden (oblique), @samp{ri} (reverse italic), or @samp{ot} (other).
+Some font names support other values.
 @item widthtype
-This is normally @samp{condensed}, @samp{extended}, @samp{semicondensed}
-or @samp{normal}.  Other words may appear here in some font names.
+The font width---normally @samp{condensed}, @samp{extended},
address@hidden or @samp{normal} (some font names support other
+values).
 @item style
-This is an optional additional style name.  Usually it is empty---most
-long font names have two hyphens in a row at this point.
+An optional additional style name.  Usually it is empty---most long
+font names have two hyphens in a row at this point.
 @item pixels
-This is the font height, in pixels.
+The font height, in pixels.
 @item height
-This is the font height on the screen, measured in tenths of a printer's
-point---approximately 1/720 of an inch.  In other words, it is the point
-size of the font, times ten.  For a given vertical resolution,
address@hidden and @var{pixels} are proportional; therefore, it is common
-to specify just one of them and use @samp{*} for the other.
+The font height on the screen, measured in tenths of a printer's
+point.  This is the point size of the font, times ten.  For a given
+vertical resolution, @var{height} and @var{pixels} are proportional;
+therefore, it is common to specify just one of them and use @samp{*}
+for the other.
 @item horiz
-This is the horizontal resolution, in pixels per inch, of the screen for
-which the font is intended.
+The horizontal resolution, in pixels per inch, of the screen for which
+the font is intended.
 @item vert
-This is the vertical resolution, in pixels per inch, of the screen for
-which the font is intended.  Normally the resolution of the fonts on
-your system is the right value for your screen; therefore, you normally
+The vertical resolution, in pixels per inch, of the screen for which
+the font is intended.  Normally the resolution of the fonts on your
+system is the right value for your screen; therefore, you normally
 specify @samp{*} for this and @var{horiz}.
 @item spacing
 This is @samp{m} (monospace), @samp{p} (proportional) or @samp{c}
 (character cell).
 @item width
-This is the average character width, in pixels, multiplied by ten.
+The average character width, in pixels, multiplied by ten.
 @item registry
 @itemx encoding
-These together make up the X font character set that the font depicts.
-(X font character sets are not the same as Emacs charsets, but they
-are solutions for the same problem.)  You can use the
address@hidden program to check which choices you have.  However,
-normally you should use @samp{iso8859} for @var{registry} and @samp{1}
-for @var{encoding}.
+The X font character set that the font depicts.  (X font character
+sets are not the same as Emacs character sets, but they are similar.)
+You can use the @command{xfontsel} program to check which choices you
+have.  Normally you should use @samp{iso8859} for @var{registry} and
address@hidden for @var{encoding}.
 @end table
 
+  Some fonts have shorter nicknames, which you can use instead of a
+normal font specification.  For instance,
+
address@hidden
+-misc-fixed-medium-r-semicondensed--13-*-*-*-c-60-iso8859-1
address@hidden smallexample
+
address@hidden
+is equivalent to @samp{6x13}.
+
 @cindex listing system fonts
   You will probably want to use a fixed-width default font---that is,
 a font in which all characters have the same width.  Any font with
address@hidden or @samp{c} in the @var{spacing} field of the long name is a
address@hidden or @samp{c} in the @var{spacing} field of the XLFD is a
 fixed-width font.  Here's how to use the @command{xlsfonts} program to
 list all the fixed-width fonts available on your system:
 
@@ -910,9 +975,8 @@
 @noindent
 displays the entire font @samp{6x13}.
 
-  While running Emacs, you can set the font of the current frame
-(@pxref{Frame Parameters}) or for a specific kind of text
-(@pxref{Faces}).
+  While running Emacs, you can set the font of a specific kind of text
+(@pxref{Faces}), or of a particular frame (@pxref{Frame Parameters}).
 
 @node Colors
 @appendixsec Window Color Options




reply via email to

[Prev in Thread] Current Thread [Next in Thread]