/* Get the face-code of the next GLYPH. */
int cf, len;
GLYPH g = *gp;
- int ch, charset;
+ int ch, first_ch, charset;
/* HIGHEST and LOWEST are used while drawing a composite
character. The meanings are described later. */
int highest, lowest;
GLYPH_FOLLOW_ALIASES (tbase, tlen, g);
cf = (cmpcharp ? cmpcharp->face_work : FAST_GLYPH_FACE (g));
ch = FAST_GLYPH_CHAR (g);
+ if (gidx == 0) first_ch = ch;
charset = CHAR_CHARSET (ch);
if (charset == CHARSET_COMPOSITION)
{
1) A face has stipple.
2) A height of font is different from that of the current line.
3) Drawing a composite character.
+ 4) Font has non-zero _MULE_BASELINE_OFFSET property.
After filling background, we draw glyphs by XDrawString16. */
int background_filled;
/* Baseline position of a character, offset from TOP. */
int baseline;
- /* The property value of `_MULE_RELATIVE_COMPOSE'. */
- int relative_compose = 0;
+ /* The property value of `_MULE_RELATIVE_COMPOSE' and
+ `_MULE_DEFAULT_ASCENT'. */
+ int relative_compose = 0, default_ascent = 0;
/* HL = 3 means use a mouse face previously chosen. */
if (hl == 3)
baseline = (f->output_data.x->font_baseline
- fontp->baseline_offset);
if (cmpcharp && cmpcharp->cmp_rule == NULL)
- relative_compose = fontp->relative_compose;
+ {
+ relative_compose = fontp->relative_compose;
+ default_ascent = fontp->default_ascent;
+ }
/* We have to change code points in the following cases. */
if (fontp->font_encoder)
else if (!font
|| stippled
|| f->output_data.x->line_height != FONT_HEIGHT (font)
- || cmpcharp)
+ || cmpcharp
+ || baseline != f->output_data.x->font_baseline)
{
if (!stippled)
/* This is to fill a rectangle with background color. */
written, LOWEST the lowest position. */
int x_offset = 0;
- pcm = PER_CHAR_METRIC (font, buf);
- highest = pcm->ascent + 1;
- lowest = - pcm->descent;
+ if (default_ascent
+ && CHAR_TABLE_P (Vuse_default_ascent)
+ && !NILP (Faref (Vuse_default_ascent, first_ch)))
+ {
+ highest = default_ascent;
+ lowest = 0;
+ }
+ else
+ {
+ pcm = PER_CHAR_METRIC (font, buf);
+ highest = pcm->ascent + 1;
+ lowest = - pcm->descent;
+ }
if (cmpcharp->cmp_rule)
x_offset = (cmpcharp->col_offset[0]
fontp->relative_compose
= (XGetFontProperty (font, dpyinfo->Xatom_MULE_RELATIVE_COMPOSE, &value)
? (long) value : 0);
+ fontp->default_ascent
+ = (XGetFontProperty (font, dpyinfo->Xatom_MULE_DEFAULT_ASCENT, &value)
+ ? (long) value : 0);
UNBLOCK_INPUT;
dpyinfo->n_fonts++;
= XInternAtom (dpyinfo->display, "_MULE_BASELINE_OFFSET", False);
dpyinfo->Xatom_MULE_RELATIVE_COMPOSE
= XInternAtom (dpyinfo->display, "_MULE_RELATIVE_COMPOSE", False);
+ dpyinfo->Xatom_MULE_DEFAULT_ASCENT
+ = XInternAtom (dpyinfo->display, "_MULE_DEFAULT_ASCENT", False);
dpyinfo->cut_buffers_initialized = 0;