Function: font-variation-glyphs
font-variation-glyphs is a function defined in font.c.
Signature
(font-variation-glyphs FONT-OBJECT CHARACTER)
Documentation
Return a list of variation glyphs for CHARACTER in FONT-OBJECT.
Each element of the value is a cons (VARIATION-SELECTOR . GLYPH-ID),
where
VARIATION-SELECTOR is a character code of variation selector
(#xFE00..#xFE0F or #xE0100..#xE01EF).
GLYPH-ID is a glyph code of the corresponding variation glyph, an integer.
Source Code
// Defined in /usr/src/emacs/src/font.c
{
unsigned variations[256];
struct font *font;
int i, n;
Lisp_Object val;
CHECK_FONT_OBJECT (font_object);
CHECK_CHARACTER (character);
font = XFONT_OBJECT (font_object);
if (! font->driver->get_variation_glyphs)
return Qnil;
n = font->driver->get_variation_glyphs (font, XFIXNUM (character), variations);
if (! n)
return Qnil;
val = Qnil;
for (i = 0; i < 255; i++)
if (variations[i])
{
int vs = (i < 16 ? 0xFE00 + i : 0xE0100 + (i - 16));
Lisp_Object code = INT_TO_INTEGER (variations[i]);
val = Fcons (Fcons (make_fixnum (vs), code), val);
}
return val;
}