Commit 56dd2d86 authored by Eli Zaretskii's avatar Eli Zaretskii

src/font.[ch]: Fix typos in comments and strings.

parent 58539c63
......@@ -136,7 +136,7 @@ Lisp_Object Qja, Qko;
static Lisp_Object QCuser_spec;
/* Alist of font registry symbol and the corresponding charsets
/* Alist of font registry symbols and the corresponding charset
information. The information is retrieved from
Vfont_encoding_alist on demand.
......@@ -226,9 +226,9 @@ static int num_font_drivers;
/* Return a Lispy value of a font property value at STR and LEN bytes.
If STR is "*", it returns nil.
If FORCE_SYMBOL is zero and all characters in STR are digits, it
returns an integer. Otherwise, it returns a symbol interned from
If STR is "*", return nil.
If FORCE_SYMBOL is zero and all characters in STR are digits,
return an integer. Otherwise, return a symbol interned from
STR. */
Lisp_Object
......@@ -251,7 +251,7 @@ font_intern_prop (const char *str, int len, int force_symbol)
}
/* The following code is copied from the function intern (in
lread.c), and modified to suite our purpose. */
lread.c), and modified to suit our purpose. */
obarray = Vobarray;
if (!VECTORP (obarray) || ASIZE (obarray) == 0)
obarray = check_obarray (obarray);
......@@ -305,7 +305,7 @@ font_pixel_size (FRAME_PTR f, Lisp_Object spec)
font vector. If VAL is not valid (i.e. not registered in
font_style_table), return -1 if NOERROR is zero, and return a
proper index if NOERROR is nonzero. In that case, register VAL in
font_style_table if VAL is a symbol, and return a closest index if
font_style_table if VAL is a symbol, and return the closest index if
VAL is an integer. */
int
......@@ -473,7 +473,7 @@ font_registry_charsets (Lisp_Object registry, struct charset **encoding, struct
}
/* Font property value validaters. See the comment of
/* Font property value validators. See the comment of
font_property_table for the meaning of the arguments. */
static Lisp_Object font_prop_validate (int, Lisp_Object, Lisp_Object);
......@@ -591,7 +591,7 @@ font_prop_validate_otf (Lisp_Object prop, Lisp_Object val)
return val;
}
/* Structure of known font property keys and validater of the
/* Structure of known font property keys and validator of the
values. */
static const struct
{
......@@ -742,7 +742,7 @@ enum xlfd_field_mask
};
/* Parse P pointing the pixel/point size field of the form
/* Parse P pointing to the pixel/point size field of the form
`[A B C D]' which specifies a transformation matrix:
A B 0
......@@ -775,7 +775,7 @@ parse_matrix (const char *p)
}
/* Expand a wildcard field in FIELD (the first N fields are filled) to
multiple fields to fill in all 14 XLFD fields while restring a
multiple fields to fill in all 14 XLFD fields while restricting a
field position by its contents. */
static int
......@@ -2054,14 +2054,14 @@ font_rescale_ratio (Lisp_Object font_entity)
font-spec. The score value is 32 bit (`unsigned'), and the smaller
the value is, the closer the font is to the font-spec.
The lowest 2 bits of the score is used for driver type. The font
The lowest 2 bits of the score are used for driver type. The font
available by the most preferred font driver is 0.
Each 7-bit in the higher 28 bits are used for numeric properties
The 4 7-bit fields in the higher 28 bits are used for numeric properties
WEIGHT, SLANT, WIDTH, and SIZE. */
/* How many bits to shift to store the difference value of each font
property in a score. Note that flots for FONT_TYPE_INDEX and
property in a score. Note that floats for FONT_TYPE_INDEX and
FONT_REGISTRY_INDEX are not used. */
static int sort_shift_bits[FONT_SIZE_INDEX + 1];
......@@ -2598,7 +2598,7 @@ font_clear_cache (FRAME_PTR f, Lisp_Object cache, struct font_driver *driver)
static Lisp_Object scratch_font_spec, scratch_font_prefer;
/* Check each font-entity in VEC, and return a list of font-entities
that satisfy this condition:
that satisfy these conditions:
(1) matches with SPEC and SIZE if SPEC is not nil, and
(2) doesn't match with any regexps in Vface_ignored_fonts (if non-nil).
*/
......@@ -3018,8 +3018,8 @@ font_clear_prop (Lisp_Object *attrs, enum font_property_index prop)
attrs[LFACE_FONT_INDEX] = font;
}
/* Selecte a font from ENTITIES (list of font-entity vectors) that
supports C and matches best with ATTRS and PIXEL_SIZE. */
/* Select a font from ENTITIES (list of font-entity vectors) that
supports C and is the best match for ATTRS and PIXEL_SIZE. */
static Lisp_Object
font_select_entity (Lisp_Object frame, Lisp_Object entities, Lisp_Object *attrs, int pixel_size, int c)
......@@ -3062,8 +3062,8 @@ font_select_entity (Lisp_Object frame, Lisp_Object entities, Lisp_Object *attrs,
return font_sort_entities (entities, prefer, frame, c);
}
/* Return a font-entity satisfying SPEC and best matching with face's
font related attributes in ATTRS. C, if not negative, is a
/* Return a font-entity that satisfies SPEC and is the best match for
face's font related attributes in ATTRS. C, if not negative, is a
character that the entity must support. */
Lisp_Object
......@@ -3254,8 +3254,8 @@ font_open_for_lface (FRAME_PTR f, Lisp_Object entity, Lisp_Object *attrs, Lisp_O
}
/* Find a font satisfying SPEC and best matching with face's
attributes in ATTRS on FRAME, and return the opened
/* Find a font that satisfies SPEC and is the best match for
face's attributes in ATTRS on FRAME, and return the opened
font-object. */
Lisp_Object
......@@ -3267,8 +3267,7 @@ font_load_for_lface (FRAME_PTR f, Lisp_Object *attrs, Lisp_Object spec)
if (NILP (entity))
{
/* No font is listed for SPEC, but each font-backend may have
the different criteria about "font matching". So, try
it. */
different criteria about "font matching". So, try it. */
entity = font_matching_entity (f, attrs, spec);
if (NILP (entity))
return Qnil;
......@@ -3307,7 +3306,7 @@ font_done_for_face (FRAME_PTR f, struct face *face)
}
/* Open a font matching with font-spec SPEC on frame F. If no proper
/* Open a font that is a match for font-spec SPEC on frame F. If no proper
font is found, return Qnil. */
Lisp_Object
......@@ -3331,7 +3330,7 @@ font_open_by_spec (FRAME_PTR f, Lisp_Object spec)
}
/* Open a font matching with NAME on frame F. If no proper font is
/* Open a font that matches NAME on frame F. If no proper font is
found, return Qnil. */
Lisp_Object
......@@ -3355,7 +3354,7 @@ font_open_by_name (FRAME_PTR f, const char *name)
/* Register font-driver DRIVER. This function is used in two ways.
The first is with frame F non-NULL. In this case, make DRIVER
available (but not yet activated) on F. All frame creaters
available (but not yet activated) on F. All frame creators
(e.g. Fx_create_frame) must call this function at least once with
an available font-driver.
......@@ -3682,7 +3681,7 @@ font_at (int c, EMACS_INT pos, struct face *face, struct window *w,
#ifdef HAVE_WINDOW_SYSTEM
/* Check how many characters after POS (at most to *LIMIT) can be
displayed by the same font on the window W. FACE, if non-NULL, is
displayed by the same font in the window W. FACE, if non-NULL, is
the face selected for the character at POS. If STRING is not nil,
it is the string to check instead of the current buffer. In that
case, FACE must be not NULL.
......@@ -3826,7 +3825,7 @@ GSUB and GPOS may contain `nil' element. In such a case, the font
must not have any of the remaining elements.
For instance, if the VALUE is `(thai nil nil (mark))', the font must
be an OpenType font, and whose GPOS table of `thai' script's default
be an OpenType font whose GPOS table of `thai' script's default
language system must contain `mark' feature.
usage: (font-spec ARGS...) */)
......@@ -4189,7 +4188,7 @@ DEFUN ("font-xlfd-name", Ffont_xlfd_name, Sfont_xlfd_name, 1, 2, 0,
FONT is a font-spec, font-entity, or font-object.
If the name is too long for XLFD (maximum 255 chars), return nil.
If the 2nd optional arg FOLD-WILDCARDS is non-nil,
the consecutive wildcards are folded to one. */)
the consecutive wildcards are folded into one. */)
(Lisp_Object font, Lisp_Object fold_wildcards)
{
char name[256];
......@@ -4436,7 +4435,7 @@ the value is 0.
If GSTRING-OUT is too short to hold produced glyphs, no glyphs are
produced in GSTRING-OUT, and the value is nil.
See the documentation of `font-make-gstring' for the format of
See the documentation of `composition-get-gstring' for the format of
glyph-string. */)
(Lisp_Object otf_features, Lisp_Object gstring_in, Lisp_Object from, Lisp_Object to, Lisp_Object gstring_out, Lisp_Object index)
{
......@@ -4571,10 +4570,10 @@ The value is a vector:
[ NAME FILENAME PIXEL-SIZE SIZE ASCENT DESCENT SPACE-WIDTH AVERAGE-WIDTH
CAPABILITY ]
NAME is a string of the font name (or nil if the font backend doesn't
NAME is the font name, a string (or nil if the font backend doesn't
provide a name).
FILENAME is a string of the font file (or nil if the font backend
FILENAME is the font file name, a string (or nil if the font backend
doesn't provide a file name).
PIXEL-SIZE is a pixel size by which the font is opened.
......
......@@ -36,22 +36,22 @@ along with GNU Emacs. If not, see <http://www.gnu.org/licenses/>. */
FONT-ENTITY
Pseudo vector (length FONT_ENTITY_MAX) of fully instanciated
Pseudo vector (length FONT_ENTITY_MAX) of fully instantiated
font properties that a font-driver returns upon a request of
FONT-SPEC.
Note: Only the method `list' and `match' of a font-driver can
create this object, and should never be modified by Lisp.
create this object, and it should never be modified by Lisp.
FONT-OBJECT
Pseudo vector (length FONT_OBJECT_MAX) of a opend font.
Pseudo vector (length FONT_OBJECT_MAX) of an opened font.
Lisp object encapsulating "struct font". This corresponds to
an opened font.
Note: Only the method `open' of a font-driver can create this
object, and should never be modified by Lisp. */
object, and it should never be modified by Lisp. */
extern Lisp_Object Qfont_spec, Qfont_entity, Qfont_object;
......@@ -68,7 +68,7 @@ struct glyph_string;
enum font_property_index
{
/* FONT-TYPE is a symbol indicating a font backend; currently `x',
`xft', `ftx' are available on X, `uniscribe' and `gdi' on
`xft', and `ftx' are available on X, `uniscribe' and `gdi' on
Windows, and `ns' under Cocoa / GNUstep. */
FONT_TYPE_INDEX,
......@@ -86,26 +86,26 @@ enum font_property_index
FONT_REGISTRY_INDEX,
/* FONT-WEIGHT is a numeric value of weight (e.g. medium, bold) of
the font. The lowest 8-bit is an index determining the
the font. The lowest 8 bits is an index determining the
symbolic name, and the higher bits is the actual numeric value
defined in `font-weight-table'. */
FONT_WEIGHT_INDEX,
/* FONT-SLANT is a numeric value of slant (e.g. r, i, o) of the
font. The lowest 8-bit is an index determining the symbolic
font. The lowest 8 bits is an index determining the symbolic
name, and the higher bits is the actual numeric value defined
in `font-slant-table'. */
FONT_SLANT_INDEX,
/* FONT-WIDTH is a numeric value of setwidth (e.g. normal) of the
font. The lowest 8-bit is an index determining the symbolic
font. The lowest 8 bits is an index determining the symbolic
name, and the higher bits is the actual numeric value defined
`font-width-table'. */
FONT_WIDTH_INDEX,
/* FONT-SIZE is a size of the font. If integer, it is a pixel
size. For a font-spec, the value can be float specifying a
point size. The value zero means that the font is
size. For a font-spec, the value can be a float specifying
the point size. The value zero means that the font is
scalable. */
FONT_SIZE_INDEX,
......@@ -129,18 +129,18 @@ enum font_property_index
/* FONT-STYLE is a 24-bit integer containing indices for
style-related properties WEIGHT, SLANT, and WIDTH. The lowest
8-bit is an indice to the weight table AREF (font_style_table,
0), the next 8-bit is an indice to the slant table AREF
(font_style_table, 1), the highest 8-bit is an indice to the
slant table AREF (font_style_table, 2). The indice 0 indicates
8 bits is an index to the weight table AREF (font_style_table,
0), the next 8 bits is an index to the slant table AREF
(font_style_table, 1), the highest 8 bits is an index to the
slant table AREF (font_style_table, 2). The index 0 indicates
that the corresponding style is not specified. This way, we
can represent at most 255 different names for each style, which
is surely sufficient. */
FONT_STYLE_INDEX,
/* FONT-METRICS is a 27-bit integer containing metrics-related
properties DPI, AVGWIDTH, SPACING. The lowest 12-bit is for
DPI, the next 12-bit is for AVGWIDTH, the highest 3-bit is for
properties DPI, AVGWIDTH, SPACING. The lowest 12 bits is for
DPI, the next 12 bits is for AVGWIDTH, the highest 3 bits is for
SPACING. In each bit field, the highest bit indicates that the
corresponding value is set or not. This way, we can represent
DPI by 11-bit (0 to 2047), AVGWIDTH by 11-bit (0 to 2047),
......@@ -176,7 +176,7 @@ enum font_property_index
FONT_NAME_INDEX = FONT_ENTITY_MAX,
/* Full name of the font (string). It is the name extracted from
the opend font, and may be different from the above. It may be
the opened font, and may be different from the above. It may be
nil if the opened font doesn't give a name. */
FONT_FULLNAME_INDEX,
......@@ -300,7 +300,7 @@ struct font
int space_width;
/* Average width of glyphs in the font. If the font itself doesn't
have that information but has glyphs of ASCII character, the
have that information but has glyphs of ASCII characters, the
value is the average with of those glyphs. Otherwise, the value
is 0. */
int average_width;
......@@ -321,7 +321,7 @@ struct font
int underline_position;
/* 1 if `vertical-centering-font-regexp' matches this font name.
In this case, we render characters at vartical center positions
In this case, we render characters at vertical center positions
of lines. */
int vertical_centering;
......@@ -335,27 +335,27 @@ struct font
unsigned char encoding_type;
/* The baseline position of a font is normally `ascent' value of the
font. However, there exists many fonts which don't set `ascent'
font. However, there exist many fonts which don't set `ascent' to
an appropriate value to be used as baseline position. This is
typical in such ASCII fonts which are designed to be used with
Chinese, Japanese, Korean characters. When we use mixture of
such fonts and normal fonts (having correct `ascent' value), a
display line gets very ugly. Since we have no way to fix it
automatically, it is users responsibility to supply well designed
automatically, it is user's responsibility to supply well designed
fonts or correct `ascent' value of fonts. But, the latter
requires heavy work (modifying all bitmap data in BDF files).
So, Emacs accepts a private font property
`_MULE_BASELINE_OFFSET'. If a font has this property, we
calculate the baseline position by subtracting the value from
`ascent'. In other words, the value indicates how many bits
higher we should draw a character of the font than normal ASCII
text for a better looking.
`ascent'. In other words, the value indicates how many pixels
higher than normal ASCII text we should draw a character of the
font for better appearance.
We also have to consider the fact that the concept of `baseline'
differs among scripts to which each character belongs. For
instance, baseline should be at the bottom most position of all
instance, baseline should be at the bottom-most position of all
glyphs for Chinese, Japanese, and Korean. But, many of existing
fonts for those characters doesn't have correct `ascent' values
fonts for those characters don't have correct `ascent' values
because they are designed to be used with ASCII fonts. To
display characters of different language on the same line, the
best way will be to arrange them in the middle of the line. So,
......@@ -365,20 +365,20 @@ struct font
of a line. */
int baseline_offset;
/* Non zero means a character should be composed at a position
/* Non-zero means a character should be composed at a position
relative to the height (or depth) of previous glyphs in the
following cases:
(1) The bottom of the character is higher than this value. In
this case, the character is drawn above the previous glyphs.
(2) The top of the character is lower than 0 (i.e. baseline
height). In this case, the character is drawn beneath the
height). In this case, the character is drawn below the
previous glyphs.
This value is taken from a private font property
`_MULE_RELATIVE_COMPOSE' which is introduced by Emacs. */
int relative_compose;
/* Non zero means an ascent value to be used for a character
/* Non-zero means an ascent value to be used for a character
registered in char-table `use-default-ascent'. */
int default_ascent;
......@@ -398,8 +398,8 @@ struct font
determine it. */
int repertory_charset;
/* There will be more to this structure, but they are private to a
font-driver. */
/* There are more members in this structure, but they are private
to the font-driver. */
};
enum font_spacing
......@@ -484,8 +484,8 @@ struct font_bitmap
#define POINT_TO_PIXEL(POINT, DPI) ((POINT) * (DPI) / PT_PER_INCH + 0.5)
/* Return a point size corresponding to POINT size (integer)
on resolution DPI. Note that though point size is a double, we expect
it to be rounded to an int, so we add 0.5 here. If the desired value
on resolution DPI. Note that though point size is a double, we expect
it to be rounded to an int, so we add 0.5 here. If the desired value
is tenths of points (as in xfld specs), then the pixel size should
be multiplied BEFORE the conversion to avoid magnifying the error. */
#define PIXEL_TO_POINT(PIXEL, DPI) ((PIXEL) * PT_PER_INCH / (DPI) + 0.5)
......@@ -582,7 +582,7 @@ struct font_driver
If FONT doesn't have such a glyph, return FONT_INVALID_CODE. */
unsigned (*encode_char) (struct font *font, int c);
/* Computate the total metrics of the NGLYPHS glyphs specified by
/* Compute the total metrics of the NGLYPHS glyphs specified by
the font FONT and the sequence of glyph codes CODE, and store the
result in METRICS. */
int (*text_extents) (struct font *font,
......@@ -635,7 +635,7 @@ struct font_driver
FEATURES specifies which OTF features to apply in this format:
(SCRIPT LANGSYS GSUB-FEATURE GPOS-FEATURE)
See the documentation of `font-drive-otf' for the detail.
See the documentation of `font-drive-otf' for the details.
This method applies the specified features to the codes in the
elements of GSTRING-IN (between FROMth and TOth). The output
......@@ -710,7 +710,7 @@ struct font_driver
struct font_driver_list
{
/* 1 iff this driver is currently used. It is igonred in the global
/* 1 iff this driver is currently used. It is ignored in the global
font driver list.*/
int on;
/* Pointer to the font driver. */
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment