Mercurial > emacs
comparison src/font.c @ 98124:629cccd78d85
(Ffont_shape_gstring): Make glyphs of non-nil adjustment
compose a grapheme cluster with the preceding base glyph.
author | Kenichi Handa <handa@m17n.org> |
---|---|
date | Wed, 10 Sep 2008 05:54:09 +0000 |
parents | fa1023e4960c |
children | 5d2542d6df18 |
comparison
equal
deleted
inserted
replaced
98123:c674ed7591e1 | 98124:629cccd78d85 |
---|---|
4222 (gstring) | 4222 (gstring) |
4223 Lisp_Object gstring; | 4223 Lisp_Object gstring; |
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); |
4231 if (! NILP (LGSTRING_ID (gstring))) | 4231 if (! NILP (LGSTRING_ID (gstring))) |
4232 return gstring; | 4232 return gstring; |
4248 } | 4248 } |
4249 if (i == 3 || XINT (n) == 0) | 4249 if (i == 3 || XINT (n) == 0) |
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); | 4280 } |
4268 } | 4281 } |
4269 } | 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 |
4273 #if 0 | 4292 #if 0 |
4274 | 4293 |