# HG changeset patch # User Miles Bader # Date 967473715 0 # Node ID 5bd6bdf3d3cfca3dc60f14190fd28ae8d7601589 # Parent e947c5224fc0f254e76d33c260f004cb36ac9bc9 (merge_face_vectors): Clear TO's :font attribute if made inconsistent by a font-related attribute in FROM. (merge_face_inheritance): Add function comment. diff -r e947c5224fc0 -r 5bd6bdf3d3cf src/xfaces.c --- a/src/xfaces.c Mon Aug 28 12:29:42 2000 +0000 +++ b/src/xfaces.c Mon Aug 28 14:41:55 2000 +0000 @@ -3150,6 +3150,18 @@ && !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 @@ ? 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;