Function: fontp

fontp is a function defined in font.c.

Signature

(fontp OBJECT &optional EXTRA-TYPE)

Documentation

Return t if OBJECT is a font-spec, font-entity, or font-object.

Return nil otherwise. Optional 2nd argument EXTRA-TYPE, if non-nil, specifies to check which kind of font it is. It must be one of font-spec, font-entity, font-object.

View in manual

Probably introduced at or before Emacs version 23.1.

Source Code

// Defined in /usr/src/emacs/src/font.c
{
  if (NILP (extra_type))
    return (FONTP (object) ? Qt : Qnil);
  if (EQ (extra_type, Qfont_spec))
    return (FONT_SPEC_P (object) ? Qt : Qnil);
  if (EQ (extra_type, Qfont_entity))
    return (FONT_ENTITY_P (object) ? Qt : Qnil);
  if (EQ (extra_type, Qfont_object))
    return (FONT_OBJECT_P (object) ? Qt : Qnil);
  wrong_type_argument (Qfont_extra_type, extra_type); ;
}