From: handa Date: Wed, 17 Mar 2004 12:56:56 +0000 (+0000) Subject: *** empty log message *** X-Git-Url: http://git.chise.org/gitweb/?a=commitdiff_plain;h=551531d6c501ab6595c6ddba893a38aca9dd93e8;p=m17n%2Fm17n-lib.git *** empty log message *** --- diff --git a/src/draw.c b/src/draw.c index f36fdba..be694fe 100644 --- a/src/draw.c +++ b/src/draw.c @@ -79,6 +79,8 @@ static MSymbol Mlatin, Minherited; /* Special categories */ static MSymbol McatCc, McatCf; +static MSymbol Mdepth; + /* Glyph-string composer. */ @@ -476,6 +478,8 @@ layout_glyphs (MFrame *frame, MGlyphString *gstring, int from, int to) g_physical_descent = gstring->physical_descent; g_width = g_lbearing = g_rbearing = 0; + mfont__get_metric (gstring, from, to); + while (g < last_g) { MGlyph *base = g++; @@ -483,7 +487,6 @@ layout_glyphs (MFrame *frame, MGlyphString *gstring, int from, int to) int size = rfont->font.property[MFONT_SIZE]; int width, lbearing, rbearing; - mfont__get_metric (rfont, base); if (g == last_g || ! g->combining_code) { /* No combining. */ @@ -543,7 +546,6 @@ layout_glyphs (MFrame *frame, MGlyphString *gstring, int from, int to) else if (end < g->to) end = g->to; - mfont__get_metric (rfont, g); g->xoff = left + (width * base_x - g->width * add_x) / 2 + off_x; if (g->xoff < left) left = g->xoff; @@ -1343,7 +1345,8 @@ free_gstring (void *object) static MGlyphString scratch_gstring; static MGlyphString * -alloc_gstring (MText *mt, int pos, MDrawControl *control, int line, int y) +alloc_gstring (MFrame *frame, MText *mt, int pos, MDrawControl *control, + int line, int y) { MGlyphString *gstring; @@ -1366,6 +1369,10 @@ alloc_gstring (MText *mt, int pos, MDrawControl *control, int line, int y) (*control->format) (line, y, &(gstring->indent), &(gstring->width_limit)); else gstring->width_limit = control->max_line_width; + gstring->anti_alias = control->anti_alias; + if (gstring->anti_alias + && (unsigned) mwin__device_get_prop (frame->device, Mdepth) < 8) + gstring->anti_alias = 0; return gstring; } @@ -1491,7 +1498,7 @@ get_gstring (MFrame *frame, MText *mt, int pos, int to, MDrawControl *control) beg = pos; end = to; } - gstring = alloc_gstring (mt, beg, control, line, y); + gstring = alloc_gstring (frame, mt, beg, control, line, y); compose_glyph_string (frame, mt, beg, end, gstring); layout_glyph_string (frame, gstring); end = gstring->to; @@ -1505,7 +1512,8 @@ get_gstring (MFrame *frame, MText *mt, int pos, int to, MDrawControl *control) while (gst->to < end) { line++, y += gst->height; - gst->next = alloc_gstring (mt, gst->from, control, line, y); + gst->next = alloc_gstring (frame, mt, gst->from, control, + line, y); gst->next->top = gstring; compose_glyph_string (frame, mt, gst->to, end, gst->next); gst = gst->next; @@ -1681,6 +1689,7 @@ mdraw__init () McatCc = msymbol ("Cc"); McatCf = msymbol ("Cf"); + Mdepth = msymbol ("depth"); MbidiR = msymbol ("R"); MbidiAL = msymbol ("AL");