aboutsummaryrefslogtreecommitdiffstats
path: root/src
diff options
context:
space:
mode:
authorKenichi Handa2006-06-06 03:49:53 +0000
committerKenichi Handa2006-06-06 03:49:53 +0000
commitf30d8d94fe5fba1ed2f3ecc6d728f83831b0ae66 (patch)
tree54f9e06580eb2d9fdff89ab43504b86a732515d9 /src
parent028b54a0b3ed3681ee922e520084d7fdbff9a9f9 (diff)
downloademacs-f30d8d94fe5fba1ed2f3ecc6d728f83831b0ae66.tar.gz
emacs-f30d8d94fe5fba1ed2f3ecc6d728f83831b0ae66.zip
(get_composition_id) [USE_FONT_BACKEND]: If
enable_font_backend is nonzero, accept the composition method COMPOSITION_WITH_GLYPH_STRING.
Diffstat (limited to 'src')
-rw-r--r--src/composite.c34
1 files changed, 33 insertions, 1 deletions
diff --git a/src/composite.c b/src/composite.c
index a17a52bd15e..b688c4bbde1 100644
--- a/src/composite.c
+++ b/src/composite.c
@@ -4,7 +4,7 @@
4 Copyright (C) 1999 4 Copyright (C) 1999
5 National Institute of Advanced Industrial Science and Technology (AIST) 5 National Institute of Advanced Industrial Science and Technology (AIST)
6 Registration Number H14PRO021 6 Registration Number H14PRO021
7 Copyright (C) 2003 7 Copyright (C) 2003, 2006
8 National Institute of Advanced Industrial Science and Technology (AIST) 8 National Institute of Advanced Industrial Science and Technology (AIST)
9 Registration Number H13PRO009 9 Registration Number H13PRO009
10 10
@@ -158,6 +158,8 @@ EXFUN (Fremove_list_of_text_properties, 4);
158 158
159/* Temporary variable used in macros COMPOSITION_XXX. */ 159/* Temporary variable used in macros COMPOSITION_XXX. */
160Lisp_Object composition_temp; 160Lisp_Object composition_temp;
161
162extern int enable_font_backend;
161 163
162/* Return COMPOSITION-ID of a composition at buffer position 164/* Return COMPOSITION-ID of a composition at buffer position
163 CHARPOS/BYTEPOS and length NCHARS. The `composition' property of 165 CHARPOS/BYTEPOS and length NCHARS. The `composition' property of
@@ -273,6 +275,22 @@ get_composition_id (charpos, bytepos, nchars, prop, string)
273 /* Check if the contents of COMPONENTS are valid if COMPONENTS is a 275 /* Check if the contents of COMPONENTS are valid if COMPONENTS is a
274 vector or a list. It should be a sequence of: 276 vector or a list. It should be a sequence of:
275 char1 rule1 char2 rule2 char3 ... ruleN charN+1 */ 277 char1 rule1 char2 rule2 char3 ... ruleN charN+1 */
278
279#ifdef USE_FONT_BACKEND
280 if (enable_font_backend
281 && VECTORP (components)
282 && ASIZE (components) >= 2
283 && VECTORP (AREF (components, 0)))
284 {
285 /* COMPONENTS is a glyph-string. */
286 int len = ASIZE (key);
287
288 for (i = 1; i < len; i++)
289 if (! VECTORP (AREF (key, i)))
290 goto invalid_composition;
291 }
292 else
293#endif /* USE_FONT_BACKEND */
276 if (VECTORP (components) || CONSP (components)) 294 if (VECTORP (components) || CONSP (components))
277 { 295 {
278 int len = XVECTOR (key)->size; 296 int len = XVECTOR (key)->size;
@@ -306,6 +324,12 @@ get_composition_id (charpos, bytepos, nchars, prop, string)
306 : ((INTEGERP (components) || STRINGP (components)) 324 : ((INTEGERP (components) || STRINGP (components))
307 ? COMPOSITION_WITH_ALTCHARS 325 ? COMPOSITION_WITH_ALTCHARS
308 : COMPOSITION_WITH_RULE_ALTCHARS)); 326 : COMPOSITION_WITH_RULE_ALTCHARS));
327#ifdef USE_FONT_BACKEND
328 if (cmp->method == COMPOSITION_WITH_RULE_ALTCHARS
329 && VECTORP (components)
330 && ! INTEGERP (AREF (components, 0)))
331 cmp->method = COMPOSITION_WITH_GLYPH_STRING;
332#endif /* USE_FONT_BACKEND */
309 cmp->hash_index = hash_index; 333 cmp->hash_index = hash_index;
310 glyph_len = (cmp->method == COMPOSITION_WITH_RULE_ALTCHARS 334 glyph_len = (cmp->method == COMPOSITION_WITH_RULE_ALTCHARS
311 ? (XVECTOR (key)->size + 1) / 2 335 ? (XVECTOR (key)->size + 1) / 2
@@ -314,6 +338,14 @@ get_composition_id (charpos, bytepos, nchars, prop, string)
314 cmp->offsets = (short *) xmalloc (sizeof (short) * glyph_len * 2); 338 cmp->offsets = (short *) xmalloc (sizeof (short) * glyph_len * 2);
315 cmp->font = NULL; 339 cmp->font = NULL;
316 340
341#ifdef USE_FONT_BACKEND
342 if (cmp->method == COMPOSITION_WITH_GLYPH_STRING)
343 {
344 cmp->width = 1; /* Should be fixed later. */
345 cmp->glyph_len--;
346 }
347 else
348#endif /* USE_FONT_BACKEND */
317 /* Calculate the width of overall glyphs of the composition. */ 349 /* Calculate the width of overall glyphs of the composition. */
318 if (cmp->method != COMPOSITION_WITH_RULE_ALTCHARS) 350 if (cmp->method != COMPOSITION_WITH_RULE_ALTCHARS)
319 { 351 {