diff options
| author | Kenichi Handa | 2008-09-10 05:54:23 +0000 |
|---|---|---|
| committer | Kenichi Handa | 2008-09-10 05:54:23 +0000 |
| commit | fc3a285ed7c00f251e1ed7e85f1e6014918d9a7a (patch) | |
| tree | 6aed99ba5e3e303871cee11267cca361e20ca9a8 /src | |
| parent | c0a839aeac3ea341d1c1fbae1a87cc6d9a193cd6 (diff) | |
| download | emacs-fc3a285ed7c00f251e1ed7e85f1e6014918d9a7a.tar.gz emacs-fc3a285ed7c00f251e1ed7e85f1e6014918d9a7a.zip | |
(Ffont_shape_gstring): Make glyphs of non-nil adjustment
compose a grapheme cluster with the preceding base glyph.
Diffstat (limited to 'src')
| -rw-r--r-- | src/ChangeLog | 7 | ||||
| -rw-r--r-- | src/font.c | 35 |
2 files changed, 34 insertions, 8 deletions
diff --git a/src/ChangeLog b/src/ChangeLog index 5fbadba6060..b8333c6bb25 100644 --- a/src/ChangeLog +++ b/src/ChangeLog | |||
| @@ -1,3 +1,10 @@ | |||
| 1 | 2008-09-10 Kenichi Handa <handa@m17n.org> | ||
| 2 | |||
| 3 | * font.c (Ffont_shape_gstring): Make glyphs of non-nil adjustment | ||
| 4 | compose a grapheme cluster with the preceding base glyph. | ||
| 5 | |||
| 6 | * composite.c (composition_compute_stop_pos): Fix previous change. | ||
| 7 | |||
| 1 | 2008-09-10 Glenn Morris <rgm@gnu.org> | 8 | 2008-09-10 Glenn Morris <rgm@gnu.org> |
| 2 | 9 | ||
| 3 | * Makefile.in (character.o, chartab.o): Fix config.h typo. | 10 | * Makefile.in (character.o, chartab.o): Fix config.h typo. |
diff --git a/src/font.c b/src/font.c index 340b69869a1..ba05b57a001 100644 --- a/src/font.c +++ b/src/font.c | |||
| @@ -4224,7 +4224,7 @@ created glyph-string. Otherwise, the value is nil. */) | |||
| 4224 | { | 4224 | { |
| 4225 | struct font *font; | 4225 | struct font *font; |
| 4226 | Lisp_Object font_object, n, glyph; | 4226 | Lisp_Object font_object, n, glyph; |
| 4227 | int i; | 4227 | int i, j, from, to; |
| 4228 | 4228 | ||
| 4229 | if (! composition_gstring_p (gstring)) | 4229 | if (! composition_gstring_p (gstring)) |
| 4230 | signal_error ("Invalid glyph-string: ", gstring); | 4230 | signal_error ("Invalid glyph-string: ", gstring); |
| @@ -4250,23 +4250,42 @@ created glyph-string. Otherwise, the value is nil. */) | |||
| 4250 | return Qnil; | 4250 | return Qnil; |
| 4251 | 4251 | ||
| 4252 | glyph = LGSTRING_GLYPH (gstring, 0); | 4252 | glyph = LGSTRING_GLYPH (gstring, 0); |
| 4253 | for (i = 1; i < LGSTRING_GLYPH_LEN (gstring); i++) | 4253 | from = LGLYPH_FROM (glyph); |
| 4254 | to = LGLYPH_TO (glyph); | ||
| 4255 | for (i = 1, j = 0; i < LGSTRING_GLYPH_LEN (gstring); i++) | ||
| 4254 | { | 4256 | { |
| 4255 | Lisp_Object this = LGSTRING_GLYPH (gstring, i); | 4257 | Lisp_Object this = LGSTRING_GLYPH (gstring, i); |
| 4256 | 4258 | ||
| 4257 | if (NILP (this)) | 4259 | if (NILP (this)) |
| 4258 | break; | 4260 | break; |
| 4259 | if (NILP (LGLYPH_ADJUSTMENT (this))) | 4261 | if (NILP (LGLYPH_ADJUSTMENT (this))) |
| 4260 | glyph = this; | 4262 | { |
| 4263 | if (j < i - 1) | ||
| 4264 | for (; j < i; j++) | ||
| 4265 | { | ||
| 4266 | glyph = LGSTRING_GLYPH (gstring, j); | ||
| 4267 | LGLYPH_SET_FROM (glyph, from); | ||
| 4268 | LGLYPH_SET_TO (glyph, to); | ||
| 4269 | } | ||
| 4270 | from = LGLYPH_FROM (this); | ||
| 4271 | to = LGLYPH_TO (this); | ||
| 4272 | j = i; | ||
| 4273 | } | ||
| 4261 | else | 4274 | else |
| 4262 | { | 4275 | { |
| 4263 | int from = LGLYPH_FROM (glyph); | 4276 | if (from > LGLYPH_FROM (this)) |
| 4264 | int to = LGLYPH_TO (glyph); | 4277 | from = LGLYPH_FROM (this); |
| 4265 | 4278 | if (to < LGLYPH_TO (this)) | |
| 4266 | LGLYPH_SET_FROM (this, from); | 4279 | to = LGLYPH_TO (this); |
| 4267 | LGLYPH_SET_TO (this, to); | ||
| 4268 | } | 4280 | } |
| 4269 | } | 4281 | } |
| 4282 | if (j < i - 1) | ||
| 4283 | for (; j < i; j++) | ||
| 4284 | { | ||
| 4285 | glyph = LGSTRING_GLYPH (gstring, j); | ||
| 4286 | LGLYPH_SET_FROM (glyph, from); | ||
| 4287 | LGLYPH_SET_TO (glyph, to); | ||
| 4288 | } | ||
| 4270 | return composition_gstring_put_cache (gstring, XINT (n)); | 4289 | return composition_gstring_put_cache (gstring, XINT (n)); |
| 4271 | } | 4290 | } |
| 4272 | 4291 | ||