diff options
| author | Glenn Morris | 2021-06-08 07:50:36 -0700 |
|---|---|---|
| committer | Glenn Morris | 2021-06-08 07:50:36 -0700 |
| commit | bef3070ab8dfbb8b68c08f0f0aa03532311f3dd5 (patch) | |
| tree | ee17d21741f4b14425e44ea13b2e4b76e8915f7d /src | |
| parent | 6456a67b5d62fb2682bf163ade8ca1f65554a2aa (diff) | |
| parent | 37f44579946380ec13f7929360f8f552334362d4 (diff) | |
| download | emacs-bef3070ab8dfbb8b68c08f0f0aa03532311f3dd5.tar.gz emacs-bef3070ab8dfbb8b68c08f0f0aa03532311f3dd5.zip | |
Merge from origin/emacs-27
37f4457994 (origin/emacs-27) ; Fix typo in dynamic module functions d...
f7d4bbceee ; * src/composite.h: Improve comments for LGSTRING and LGL...
Diffstat (limited to 'src')
| -rw-r--r-- | src/composite.h | 17 |
1 files changed, 17 insertions, 0 deletions
diff --git a/src/composite.h b/src/composite.h index 660b1fa1b9e..67e87201bf2 100644 --- a/src/composite.h +++ b/src/composite.h | |||
| @@ -246,6 +246,11 @@ composition_valid_p (ptrdiff_t start, ptrdiff_t end, Lisp_Object prop) | |||
| 246 | /* Macros for lispy glyph-string. This is completely different from | 246 | /* Macros for lispy glyph-string. This is completely different from |
| 247 | struct glyph_string. */ | 247 | struct glyph_string. */ |
| 248 | 248 | ||
| 249 | /* LGSTRING is a string of font glyphs, LGLYPHs. It is represented as | ||
| 250 | a Lisp vector, with components shown below. Once LGSTRING was | ||
| 251 | processed by a shaping engine, it holds font glyphs for one or more | ||
| 252 | grapheme clusters. */ | ||
| 253 | |||
| 249 | #define LGSTRING_HEADER(lgs) AREF (lgs, 0) | 254 | #define LGSTRING_HEADER(lgs) AREF (lgs, 0) |
| 250 | #define LGSTRING_SET_HEADER(lgs, header) ASET (lgs, 0, header) | 255 | #define LGSTRING_SET_HEADER(lgs, header) ASET (lgs, 0, header) |
| 251 | 256 | ||
| @@ -259,6 +264,10 @@ composition_valid_p (ptrdiff_t start, ptrdiff_t end, Lisp_Object prop) | |||
| 259 | #define LGSTRING_ID(lgs) AREF (lgs, 1) | 264 | #define LGSTRING_ID(lgs) AREF (lgs, 1) |
| 260 | #define LGSTRING_SET_ID(lgs, id) ASET (lgs, 1, id) | 265 | #define LGSTRING_SET_ID(lgs, id) ASET (lgs, 1, id) |
| 261 | 266 | ||
| 267 | /* LGSTRING_GLYPH_LEN is the maximum number of LGLYPHs that the | ||
| 268 | LGSTRING can hold. This is NOT the actual number of valid LGLYPHs; | ||
| 269 | to find the latter, walk the glyphs returned by LGSTRING_GLYPH | ||
| 270 | until the first one that is nil. */ | ||
| 262 | #define LGSTRING_GLYPH_LEN(lgs) (ASIZE ((lgs)) - 2) | 271 | #define LGSTRING_GLYPH_LEN(lgs) (ASIZE ((lgs)) - 2) |
| 263 | #define LGSTRING_GLYPH(lgs, idx) AREF ((lgs), (idx) + 2) | 272 | #define LGSTRING_GLYPH(lgs, idx) AREF ((lgs), (idx) + 2) |
| 264 | #define LGSTRING_SET_GLYPH(lgs, idx, val) ASET ((lgs), (idx) + 2, (val)) | 273 | #define LGSTRING_SET_GLYPH(lgs, idx, val) ASET ((lgs), (idx) + 2, (val)) |
| @@ -278,6 +287,14 @@ enum lglyph_indices | |||
| 278 | LGLYPH_SIZE | 287 | LGLYPH_SIZE |
| 279 | }; | 288 | }; |
| 280 | 289 | ||
| 290 | /* Each LGLYPH is a single font glyph, whose font code is in | ||
| 291 | LGLYPH_CODE. | ||
| 292 | LGLYPH_FROM and LGLYPH_TO are indices into LGSTRING; all the | ||
| 293 | LGLYPHs that share the same values of LGLYPH_FROM and LGLYPH_TO | ||
| 294 | belong to the same grapheme cluster. | ||
| 295 | LGLYPH_CHAR is one of the characters, usually the first one, that | ||
| 296 | contributed to the glyph (since there isn't a 1:1 correspondence | ||
| 297 | between composed characters and the font glyphs). */ | ||
| 281 | #define LGLYPH_NEW() make_nil_vector (LGLYPH_SIZE) | 298 | #define LGLYPH_NEW() make_nil_vector (LGLYPH_SIZE) |
| 282 | #define LGLYPH_FROM(g) XFIXNUM (AREF ((g), LGLYPH_IX_FROM)) | 299 | #define LGLYPH_FROM(g) XFIXNUM (AREF ((g), LGLYPH_IX_FROM)) |
| 283 | #define LGLYPH_TO(g) XFIXNUM (AREF ((g), LGLYPH_IX_TO)) | 300 | #define LGLYPH_TO(g) XFIXNUM (AREF ((g), LGLYPH_IX_TO)) |