diff options
author | Miles Bader <[email protected]> | 2000-08-28 14:42:49 +0000 |
---|---|---|
committer | Miles Bader <[email protected]> | 2000-08-28 14:42:49 +0000 |
commit | 871882002ae8ec8d2e2c465cf228dc915420fb51 (patch) | |
tree | 1e30133ff6a3626daa6792cebe13f50432a64f5e /src | |
parent | 82a452c8569260a94594452b29ed0b42a4c1f1ae (diff) |
(merge_face_vectors):
Clear TO's :font attribute if made inconsistent by a font-related attribute in FROM.
(merge_face_inheritance):
Add function comment.
Diffstat (limited to 'src')
-rw-r--r-- | src/ChangeLog | 6 | ||||
-rw-r--r-- | src/xfaces.c | 19 |
2 files changed, 25 insertions, 0 deletions
diff --git a/src/ChangeLog b/src/ChangeLog index 69be13105d..7a82c85e0e 100644 --- a/src/ChangeLog +++ b/src/ChangeLog @@ -1,3 +1,9 @@ +2000-08-28 Miles Bader <[email protected]> + + * xfaces.c (merge_face_vectors): Clear TO's :font attribute if + made inconsistent by a font-related attribute in FROM. + (merge_face_inheritance): Add function comment. + 2000-08-28 Kenichi Handa <[email protected]> * keyboard.c (read_char_minibuf_menu_prompt): Call read_char with diff --git a/src/xfaces.c b/src/xfaces.c index 17f9c5928b..c75534b30e 100644 --- a/src/xfaces.c +++ b/src/xfaces.c @@ -3150,6 +3150,18 @@ merge_face_vectors (f, from, to, cycle_check) && !NILP (from[LFACE_INHERIT_INDEX])) merge_face_inheritance (f, from[LFACE_INHERIT_INDEX], to, cycle_check); + /* If TO specifies a :font attribute, and FROM specifies some + font-related attribute, we need to clear TO's :font attribute + (because it will be inconsistent with whatever FROM specifies, and + FROM takes precedence). */ + if (!NILP (to[LFACE_FONT_INDEX]) + && (!UNSPECIFIEDP (from[LFACE_FAMILY_INDEX]) + || !UNSPECIFIEDP (from[LFACE_HEIGHT_INDEX]) + || !UNSPECIFIEDP (from[LFACE_WEIGHT_INDEX]) + || !UNSPECIFIEDP (from[LFACE_SLANT_INDEX]) + || !UNSPECIFIEDP (from[LFACE_SWIDTH_INDEX]))) + to[LFACE_FONT_INDEX] = Qnil; + for (i = 1; i < LFACE_VECTOR_SIZE; ++i) if (!UNSPECIFIEDP (from[i])) if (i == LFACE_HEIGHT_INDEX && !INTEGERP (from[i])) @@ -3187,6 +3199,13 @@ merge_face_vectors (f, from, to, cycle_check) ? Qnil \ : Fcons ((el), (check))) + +/* Merge face attributes from the face on frame F whose name is + INHERITS, into the vector of face attributes TO; INHERITS may also be + a list of face names, in which case they are applied in order. + CYCLE_CHECK is used to detect loops in face inheritance. + Returns true if any of the inherited attributes are `font-related'. */ + static void merge_face_inheritance (f, inherit, to, cycle_check) struct frame *f; |