comparison src/xterm.c @ 89723:7d1daf16ade9

(x_compute_glyph_string_overhangs): Handle also a composition glyph.
author Kenichi Handa <handa@m17n.org>
date Fri, 23 Jan 2004 08:44:57 +0000
parents c7050f1a1686
children c734f0c6c3ca
comparison
equal deleted inserted replaced
89722:eee9d99444cc 89723:7d1daf16ade9
1124 XSetClipRectangles (s->display, s->gc, 0, 0, &r, 1, Unsorted); 1124 XSetClipRectangles (s->display, s->gc, 0, 0, &r, 1, Unsorted);
1125 } 1125 }
1126 1126
1127 1127
1128 /* RIF: 1128 /* RIF:
1129 Compute left and right overhang of glyph string S. If S is a glyph 1129 Compute left and right overhang of glyph string S. */
1130 string for a composition, assume overhangs don't exist. */
1131 1130
1132 static void 1131 static void
1133 x_compute_glyph_string_overhangs (s) 1132 x_compute_glyph_string_overhangs (s)
1134 struct glyph_string *s; 1133 struct glyph_string *s;
1135 { 1134 {
1140 int direction, font_ascent, font_descent; 1139 int direction, font_ascent, font_descent;
1141 XTextExtents16 (s->font, s->char2b, s->nchars, &direction, 1140 XTextExtents16 (s->font, s->char2b, s->nchars, &direction,
1142 &font_ascent, &font_descent, &cs); 1141 &font_ascent, &font_descent, &cs);
1143 s->right_overhang = cs.rbearing > cs.width ? cs.rbearing - cs.width : 0; 1142 s->right_overhang = cs.rbearing > cs.width ? cs.rbearing - cs.width : 0;
1144 s->left_overhang = cs.lbearing < 0 ? -cs.lbearing : 0; 1143 s->left_overhang = cs.lbearing < 0 ? -cs.lbearing : 0;
1144 }
1145 else if (s->cmp)
1146 {
1147 s->right_overhang = s->cmp->rbearing - s->cmp->pixel_width;
1148 s->left_overhang = - s->cmp->lbearing;
1145 } 1149 }
1146 } 1150 }
1147 1151
1148 1152
1149 /* Fill rectangle X, Y, W, H with background color of glyph string S. */ 1153 /* Fill rectangle X, Y, W, H with background color of glyph string S. */