/* Composite sequence support.
- Copyright (C) 2001-2015 Free Software Foundation, Inc.
+ Copyright (C) 2001-2016 Free Software Foundation, Inc.
Copyright (C) 1999, 2000, 2001, 2002, 2003, 2004, 2005, 2006, 2007, 2008, 2009, 2010, 2011
National Institute of Advanced Industrial Science and Technology (AIST)
Registration Number H14PRO021
#include "lisp.h"
#include "character.h"
+#include "composite.h"
#include "buffer.h"
#include "coding.h"
#include "intervals.h"
-#include "window.h"
#include "frame.h"
#include "dispextern.h"
-#include "font.h"
#include "termhooks.h"
if (FONT_OBJECT_P (font_object))
{
struct font *font = XFONT_OBJECT (font_object);
+ int font_ascent, font_descent;
- metrics->ascent = font->ascent;
- metrics->descent = font->descent;
+ get_font_ascent_descent (font, &font_ascent, &font_descent);
+ metrics->ascent = font_ascent;
+ metrics->descent = font_descent;
}
else
{
{
Lisp_Object val;
return (c > ' '
- && (c == 0x200C || c == 0x200D
+ && (c == ZERO_WIDTH_NON_JOINER || c == ZERO_WIDTH_JOINER
|| (val = CHAR_TABLE_REF (Vunicode_category_table, c),
(INTEGERP (val) && (XINT (val) <= UNICODE_CATEGORY_So)))));
}
DEFSYM (Qcomposition, "composition");
/* Make a hash table for static composition. */
- {
- Lisp_Object args[6];
-
- args[0] = QCtest;
- args[1] = Qequal;
- args[2] = QCweakness;
- /* We used to make the hash table weak so that unreferenced
- compositions can be garbage-collected. But, usually once
- created compositions are repeatedly used in an Emacs session,
- and thus it's not worth to save memory in such a way. So, we
- make the table not weak. */
- args[3] = Qnil;
- args[4] = QCsize;
- args[5] = make_number (311);
- composition_hash_table = Fmake_hash_table (6, args);
- staticpro (&composition_hash_table);
- }
+ /* We used to make the hash table weak so that unreferenced
+ compositions can be garbage-collected. But, usually once
+ created compositions are repeatedly used in an Emacs session,
+ and thus it's not worth to save memory in such a way. So, we
+ make the table not weak. */
+ Lisp_Object args[] = {QCtest, Qequal, QCsize, make_number (311)};
+ composition_hash_table = CALLMANY (Fmake_hash_table, args);
+ staticpro (&composition_hash_table);
/* Make a hash table for glyph-string. */
- {
- Lisp_Object args[6];
- args[0] = QCtest;
- args[1] = Qequal;
- args[2] = QCweakness;
- args[3] = Qnil;
- args[4] = QCsize;
- args[5] = make_number (311);
- gstring_hash_table = Fmake_hash_table (6, args);
- staticpro (&gstring_hash_table);
- }
+ gstring_hash_table = CALLMANY (Fmake_hash_table, args);
+ staticpro (&gstring_hash_table);
staticpro (&gstring_work_headers);
gstring_work_headers = make_uninit_vector (8);
Vcompose_chars_after_function = intern_c_string ("compose-chars-after");
DEFSYM (Qauto_composed, "auto-composed");
- DEFSYM (Qauto_composition_function, "auto-composition-function");
DEFVAR_LISP ("auto-composition-mode", Vauto_composition_mode,
doc: /* Non-nil if Auto-Composition mode is enabled.