ok - freetype does WEIRD shit setting grays to bizarre values so now i have

toformat AND grays levels.


SVN revision: 18500
This commit is contained in:
Carsten Haitzler 2005-11-16 13:17:27 +00:00
parent a458660298
commit ebbe8f1267
2 changed files with 7 additions and 5 deletions

View File

@ -16,7 +16,7 @@ evas_common_font_int_cache_glyph_get(RGBA_Font_Int *fi, FT_UInt index)
fg = evas_hash_find(fi->glyphs, key);
if (fg) return fg;
// error = FT_Load_Glyph(fi->src->ft.face, index, FT_LOAD_NO_BITMAP);
error = FT_Load_Glyph(fi->src->ft.face, index,
FT_LOAD_RENDER);
@ -187,7 +187,8 @@ evas_common_font_draw(RGBA_Image *dst, RGBA_Draw_Context *dc, RGBA_Font *fn, int
}
else
{
if (fg->glyph_out->bitmap.num_grays == 256)
if ((fg->glyph_out->bitmap.num_grays == 256) &&
(fg->glyph_out->bitmap.pixel_mode == ft_pixel_mode_grays))
{
for (i = 0; i < h; i++)
{
@ -220,7 +221,7 @@ evas_common_font_draw(RGBA_Image *dst, RGBA_Draw_Context *dc, RGBA_Font *fn, int
}
}
}
else if (fg->glyph_out->bitmap.num_grays == 0)
else
{
DATA8 *tmpbuf = NULL, *dp, *tp, bits;
int bi, bj;

View File

@ -61,7 +61,8 @@ _xre_font_surface_new(Ximage_Info *xinf, RGBA_Font_Glyph *fg)
fs->pic = XRenderCreatePicture(xinf->disp, fs->draw, xinf->fmt8, CPRepeat | CPDither | CPComponentAlpha, &att);
xim = _xr_image_new(fs->xinf, w, h, xinf->fmt8->depth);
if (fg->glyph_out->bitmap.num_grays == 256)
if ((fg->glyph_out->bitmap.num_grays == 256) &&
(fg->glyph_out->bitmap.pixel_mode == ft_pixel_mode_grays))
{
int x, y;
DATA8 *p1, *p2;
@ -79,7 +80,7 @@ _xre_font_surface_new(Ximage_Info *xinf, RGBA_Font_Glyph *fg)
}
}
else if (fg->glyph_out->bitmap.num_grays == 0)
else
{
DATA8 *tmpbuf = NULL, *dp, *tp, bits;
int bi, bj, end;