struct {
int size, inc, used;
MDrawPoint *points;
-} point_table[7];
+} point_table[8];
static void
ft_render (MDrawWindow win, int x, int y,
ft_info = (MFTInfo *) rface->rfont->info;
ft_face = ft_info->ft_face;
- for (i = 0; i < 7; i++)
+ for (i = 0; i < 8; i++)
MLIST_RESET (point_table + i);
for (g = from; g < to; x += g++->width)
FT_UInt code;
unsigned char *bmp;
MDrawPoint p;
- int intensity = reverse ? 0 : 7;
+ int intensity;
if (g->otf_encoded)
code = g->code;
code = FT_Get_Char_Index (ft_face, (FT_ULong) g->code);
FT_Load_Glyph (ft_face, code, load_flags);
bmp = ft_face->glyph->bitmap.buffer;
- if (! gstring->control.anti_alias)
+ if (gstring->control.anti_alias)
{
for (i = 0; i < ft_face->glyph->bitmap.rows;
i++, bmp += ft_face->glyph->bitmap.pitch)
for (j = 0; j < ft_face->glyph->bitmap.width; j++)
- if (bmp[j / 8] & (1 << (7 - (j % 8))))
- {
- p.x = x + ft_face->glyph->bitmap_left + g->xoff + j;
- p.y = y - ft_face->glyph->bitmap_top + g->yoff + i;
- MLIST_APPEND1 (point_table + intensity - 1, points, p,
- MERROR_FONT_FT);
- }
+ {
+ intensity = bmp[j] >> 5;
+ if (intensity)
+ {
+ p.x = x + ft_face->glyph->bitmap_left + g->xoff + j;
+ p.y = y - ft_face->glyph->bitmap_top + g->yoff + i;
+ MLIST_APPEND1 (point_table + intensity, points, p,
+ MERROR_FONT_FT);
+ }
+ }
}
else
{
for (i = 0; i < ft_face->glyph->bitmap.rows;
i++, bmp += ft_face->glyph->bitmap.pitch)
for (j = 0; j < ft_face->glyph->bitmap.width; j++)
- if (bmp[j])
- {
- intensity = reverse ? (7 - (bmp[j] >> 5)) : (bmp[j] >> 5);
-
- p.x = x + ft_face->glyph->bitmap_left + g->xoff + j;
- p.y = y - ft_face->glyph->bitmap_top + g->yoff + i;
- MLIST_APPEND1 (point_table + intensity - 1, points, p,
- MERROR_FONT_FT);
- }
+ {
+ intensity = bmp[j / 8] & (1 << (7 - (j % 8)));
+ if (intensity)
+ {
+ p.x = x + ft_face->glyph->bitmap_left + g->xoff + j;
+ p.y = y - ft_face->glyph->bitmap_top + g->yoff + i;
+ MLIST_APPEND1 (point_table, points, p,
+ MERROR_FONT_FT);
+ }
+ }
}
}
- for (i = 0; i < 7; i++)
- if (point_table[i].used)
- mwin__draw_points (frame, win, rface, i + 1,
- point_table[i].points, point_table[i].used);
+ if (gstring->control.anti_alias)
+ {
+ for (i = 1; i < 8; i++)
+ if (point_table[i].used)
+ mwin__draw_points (frame, win, rface, reverse ? 7 - i : i,
+ point_table[i].points, point_table[i].used,
+ gstring->control.anti_alias);
+ }
+ else
+ {
+ mwin__draw_points (frame, win, rface, reverse ? 7 : 0,
+ point_table[0].points, point_table[0].used,
+ gstring->control.anti_alias);
+ }
}
\f
mfont__driver_list[MFONT_TYPE_FT] = &ft_driver;
- for (i = 0; i < 7; i++)
+ for (i = 0; i < 8; i++)
MLIST_INIT1 (point_table + i, points, 0x1000);
return 0;