aboutsummaryrefslogtreecommitdiffstats
path: root/src
diff options
context:
space:
mode:
authorEli Zaretskii2020-10-25 18:05:37 +0200
committerEli Zaretskii2020-10-25 18:05:37 +0200
commit8164f3e1ab3ca8d28f782407ab8daf086a624d1a (patch)
tree13b8d57d96b80a9ba3c9ea90098d9dfca4a335d2 /src
parent7276723630f93878762d474b0a5adda4251191bd (diff)
downloademacs-8164f3e1ab3ca8d28f782407ab8daf086a624d1a.tar.gz
emacs-8164f3e1ab3ca8d28f782407ab8daf086a624d1a.zip
Improve support for shaping Egyptian Hieroglyphs
* src/composite.c (composition_gstring_lookup_cache): Renamed from gstring_lookup_cache and made external. All callers changed. * src/composite.h (composition_gstring_lookup_cache): Add prototype. * src/font.c (Ffont_shape_gstring): Call composition_gstring_lookup_cache and return the cached composition if it is already in the cache. * lisp/language/misc-lang.el (egyptian-shape-grouping): New function. (composition-function-table): Use egyptian-shape-grouping in setting up compositions for Egyptian Hieroglyphs. Fix the composition setup for horizontal and vertical joiners.
Diffstat (limited to 'src')
-rw-r--r--src/composite.c8
-rw-r--r--src/composite.h1
-rw-r--r--src/font.c4
3 files changed, 8 insertions, 5 deletions
diff --git a/src/composite.c b/src/composite.c
index 984e0d9cda8..90f8536b2de 100644
--- a/src/composite.c
+++ b/src/composite.c
@@ -637,10 +637,8 @@ compose_text (ptrdiff_t start, ptrdiff_t end, Lisp_Object components,
637 637
638static Lisp_Object gstring_hash_table; 638static Lisp_Object gstring_hash_table;
639 639
640static Lisp_Object gstring_lookup_cache (Lisp_Object); 640Lisp_Object
641 641composition_gstring_lookup_cache (Lisp_Object header)
642static Lisp_Object
643gstring_lookup_cache (Lisp_Object header)
644{ 642{
645 struct Lisp_Hash_Table *h = XHASH_TABLE (gstring_hash_table); 643 struct Lisp_Hash_Table *h = XHASH_TABLE (gstring_hash_table);
646 ptrdiff_t i = hash_lookup (h, header, NULL); 644 ptrdiff_t i = hash_lookup (h, header, NULL);
@@ -1781,7 +1779,7 @@ should be ignored. */)
1781 1779
1782 header = fill_gstring_header (frompos, frombyte, 1780 header = fill_gstring_header (frompos, frombyte,
1783 topos, font_object, string); 1781 topos, font_object, string);
1784 gstring = gstring_lookup_cache (header); 1782 gstring = composition_gstring_lookup_cache (header);
1785 if (! NILP (gstring)) 1783 if (! NILP (gstring))
1786 return gstring; 1784 return gstring;
1787 1785
diff --git a/src/composite.h b/src/composite.h
index 239f1e531ef..d39fdbaae05 100644
--- a/src/composite.h
+++ b/src/composite.h
@@ -330,6 +330,7 @@ extern int composition_update_it (struct composition_it *,
330 ptrdiff_t, ptrdiff_t, Lisp_Object); 330 ptrdiff_t, ptrdiff_t, Lisp_Object);
331 331
332extern ptrdiff_t composition_adjust_point (ptrdiff_t, ptrdiff_t); 332extern ptrdiff_t composition_adjust_point (ptrdiff_t, ptrdiff_t);
333extern Lisp_Object composition_gstring_lookup_cache (Lisp_Object);
333 334
334INLINE_HEADER_END 335INLINE_HEADER_END
335 336
diff --git a/src/font.c b/src/font.c
index fe257f47dc3..f7c4c816b5d 100644
--- a/src/font.c
+++ b/src/font.c
@@ -4461,6 +4461,10 @@ GSTRING. */)
4461 signal_error ("Invalid glyph-string: ", gstring); 4461 signal_error ("Invalid glyph-string: ", gstring);
4462 if (! NILP (LGSTRING_ID (gstring))) 4462 if (! NILP (LGSTRING_ID (gstring)))
4463 return gstring; 4463 return gstring;
4464 Lisp_Object cached_gstring =
4465 composition_gstring_lookup_cache (LGSTRING_HEADER (gstring));
4466 if (! NILP (cached_gstring))
4467 return cached_gstring;
4464 font_object = LGSTRING_FONT (gstring); 4468 font_object = LGSTRING_FONT (gstring);
4465 CHECK_FONT_OBJECT (font_object); 4469 CHECK_FONT_OBJECT (font_object);
4466 font = XFONT_OBJECT (font_object); 4470 font = XFONT_OBJECT (font_object);