aboutsummaryrefslogtreecommitdiffstats
path: root/src/composite.h
diff options
context:
space:
mode:
authorEli Zaretskii2021-06-02 17:50:57 +0300
committerEli Zaretskii2021-06-02 17:50:57 +0300
commitf7d4bbceee8c3c29e2ef0bfacf9ff24fb020d3ee (patch)
treeaffbac1d8f4e6152a36ff24bc63f23ae1a749d4d /src/composite.h
parentbef00aa1372dbd8a72ac84be0ee397cca46a1250 (diff)
downloademacs-f7d4bbceee8c3c29e2ef0bfacf9ff24fb020d3ee.tar.gz
emacs-f7d4bbceee8c3c29e2ef0bfacf9ff24fb020d3ee.zip
; * src/composite.h: Improve comments for LGSTRING and LGLYPH.
Diffstat (limited to 'src/composite.h')
-rw-r--r--src/composite.h17
1 files changed, 17 insertions, 0 deletions
diff --git a/src/composite.h b/src/composite.h
index 1b346b4cdfe..ebbb55f49c0 100644
--- a/src/composite.h
+++ b/src/composite.h
@@ -243,6 +243,11 @@ composition_valid_p (ptrdiff_t start, ptrdiff_t end, Lisp_Object prop)
243/* Macros for lispy glyph-string. This is completely different from 243/* Macros for lispy glyph-string. This is completely different from
244 struct glyph_string. */ 244 struct glyph_string. */
245 245
246/* LGSTRING is a string of font glyphs, LGLYPHs. It is represented as
247 a Lisp vector, with components shown below. Once LGSTRING was
248 processed by a shaping engine, it holds font glyphs for one or more
249 grapheme clusters. */
250
246#define LGSTRING_HEADER(lgs) AREF (lgs, 0) 251#define LGSTRING_HEADER(lgs) AREF (lgs, 0)
247#define LGSTRING_SET_HEADER(lgs, header) ASET (lgs, 0, header) 252#define LGSTRING_SET_HEADER(lgs, header) ASET (lgs, 0, header)
248 253
@@ -256,6 +261,10 @@ composition_valid_p (ptrdiff_t start, ptrdiff_t end, Lisp_Object prop)
256#define LGSTRING_ID(lgs) AREF (lgs, 1) 261#define LGSTRING_ID(lgs) AREF (lgs, 1)
257#define LGSTRING_SET_ID(lgs, id) ASET (lgs, 1, id) 262#define LGSTRING_SET_ID(lgs, id) ASET (lgs, 1, id)
258 263
264/* LGSTRING_GLYPH_LEN is the maximum number of LGLYPHs that the
265 LGSTRING can hold. This is NOT the actual number of valid LGLYPHs;
266 to find the latter, walk the glyphs returned by LGSTRING_GLYPH
267 until the first one that is nil. */
259#define LGSTRING_GLYPH_LEN(lgs) (ASIZE ((lgs)) - 2) 268#define LGSTRING_GLYPH_LEN(lgs) (ASIZE ((lgs)) - 2)
260#define LGSTRING_GLYPH(lgs, idx) AREF ((lgs), (idx) + 2) 269#define LGSTRING_GLYPH(lgs, idx) AREF ((lgs), (idx) + 2)
261#define LGSTRING_SET_GLYPH(lgs, idx, val) ASET ((lgs), (idx) + 2, (val)) 270#define LGSTRING_SET_GLYPH(lgs, idx, val) ASET ((lgs), (idx) + 2, (val))
@@ -275,6 +284,14 @@ enum lglyph_indices
275 LGLYPH_SIZE 284 LGLYPH_SIZE
276 }; 285 };
277 286
287/* Each LGLYPH is a single font glyph, whose font code is in
288 LGLYPH_CODE.
289 LGLYPH_FROM and LGLYPH_TO are indices into LGSTRING; all the
290 LGLYPHs that share the same values of LGLYPH_FROM and LGLYPH_TO
291 belong to the same grapheme cluster.
292 LGLYPH_CHAR is one of the characters, usually the first one, that
293 contributed to the glyph (since there isn't a 1:1 correspondence
294 between composed characters and the font glyphs). */
278#define LGLYPH_NEW() make_nil_vector (LGLYPH_SIZE) 295#define LGLYPH_NEW() make_nil_vector (LGLYPH_SIZE)
279#define LGLYPH_FROM(g) XFIXNUM (AREF ((g), LGLYPH_IX_FROM)) 296#define LGLYPH_FROM(g) XFIXNUM (AREF ((g), LGLYPH_IX_FROM))
280#define LGLYPH_TO(g) XFIXNUM (AREF ((g), LGLYPH_IX_TO)) 297#define LGLYPH_TO(g) XFIXNUM (AREF ((g), LGLYPH_IX_TO))