Enlightenment CVS committal
Author : raster
Project : e17
Module : libs/evas
Dir : e17/libs/evas/src/lib/engines/common
Modified Files:
evas_font_draw.c evas_font_query.c
Log Message:
remove sub-pixel cursor advance for font rendering
===================================================================
RCS file: /cvs/e/e17/libs/evas/src/lib/engines/common/evas_font_draw.c,v
retrieving revision 1.28
retrieving revision 1.29
diff -u -3 -r1.28 -r1.29
--- evas_font_draw.c 6 Sep 2006 07:33:40 -0000 1.28
+++ evas_font_draw.c 8 Oct 2006 12:43:31 -0000 1.29
@@ -174,8 +174,8 @@
if (ext_w <= 0) return;
if (ext_h <= 0) return;
- pen_x = x << 8;
- pen_y = y << 8;
+ pen_x = x;
+ pen_y = y;
evas_common_font_size_use(fn);
use_kerning = FT_HAS_KERNING(fi->src->ft.face);
prev_index = 0;
@@ -200,7 +200,7 @@
if (FT_Get_Kerning(fi->src->ft.face, prev_index, index,
ft_kerning_default, &delta) == 0)
- pen_x += delta.x << 2;
+ pen_x += delta.x >> 6;
}
pface = fi->src->ft.face;
fg = evas_common_font_int_cache_glyph_get(fi, index);
@@ -213,8 +213,8 @@
fg->ext_dat_free = dc->font_ext.func.gl_free;
}
- chr_x = (pen_x + (fg->glyph_out->left << 8)) >> 8;
- chr_y = (pen_y + (fg->glyph_out->top << 8)) >> 8;
+ chr_x = (pen_x + (fg->glyph_out->left));
+ chr_y = (pen_y + (fg->glyph_out->top));
if (chr_x < (ext_x + ext_w))
{
@@ -335,7 +335,7 @@
}
else
break;
- pen_x += fg->glyph->advance.x >> 8;
+ pen_x += fg->glyph->advance.x >> 16;
prev_index = index;
}
}
===================================================================
RCS file: /cvs/e/e17/libs/evas/src/lib/engines/common/evas_font_query.c,v
retrieving revision 1.20
retrieving revision 1.21
diff -u -3 -r1.20 -r1.21
--- evas_font_query.c 6 Sep 2006 07:33:40 -0000 1.20
+++ evas_font_query.c 8 Oct 2006 12:43:31 -0000 1.21
@@ -44,7 +44,7 @@
if (FT_Get_Kerning(fi->src->ft.face, prev_index, index,
ft_kerning_default, &delta) == 0)
{
- kern = delta.x << 2;
+ kern = delta.x >> 6;
pen_x += kern;
}
}
@@ -52,14 +52,14 @@
fg = evas_common_font_int_cache_glyph_get(fi, index);
if (!fg) continue;
- chr_x = (pen_x + (fg->glyph_out->left << 8)) >> 8;
- chr_y = (pen_y + (fg->glyph_out->top << 8)) >> 8;
+ chr_x = (pen_x + (fg->glyph_out->left));
+ chr_y = (pen_y + (fg->glyph_out->top));
// chr_w = fg->glyph_out->bitmap.width;
- chr_w = fg->glyph_out->bitmap.width + (kern >> 8);
+ chr_w = fg->glyph_out->bitmap.width + kern;
{
int advw;
- advw = ((fg->glyph->advance.x + (kern << 8)) >> 16);
+ advw = ((fg->glyph->advance.x + (kern << 16)) >> 16);
if (chr_w < advw) chr_w = advw;
}
@@ -68,7 +68,7 @@
if ((chr_x + chr_w) > end_x)
end_x = chr_x + chr_w;
- pen_x += fg->glyph->advance.x >> 8;
+ pen_x += fg->glyph->advance.x >> 16;
prev_index = index;
}
if (w) *w = end_x - start_x;
@@ -138,21 +138,21 @@
if (FT_Get_Kerning(fi->src->ft.face, prev_index, index,
ft_kerning_default, &delta) == 0)
- pen_x += delta.x << 2;
+ pen_x += delta.x >> 6;
}
pface = fi->src->ft.face;
fg = evas_common_font_int_cache_glyph_get(fi, index);
if (!fg) continue;
- chr_x = (pen_x + (fg->glyph_out->left << 8)) >> 8;
- chr_y = (pen_y + (fg->glyph_out->top << 8)) >> 8;
+ chr_x = (pen_x + (fg->glyph_out->left));
+ chr_y = (pen_y + (fg->glyph_out->top));
chr_w = fg->glyph_out->bitmap.width;
- pen_x += fg->glyph->advance.x >> 8;
+ pen_x += fg->glyph->advance.x >> 16;
prev_index = index;
}
if (v_adv) *v_adv = evas_common_font_get_line_advance(fn);
- if (h_adv) *h_adv = (pen_x >> 8) - start_x;
+ if (h_adv) *h_adv = pen_x - start_x;
}
/* x y w h for char at char pos */
@@ -202,7 +202,7 @@
if (FT_Get_Kerning(fi->src->ft.face, prev_index, index,
ft_kerning_default, &delta) == 0)
{
- kern = delta.x << 2;
+ kern = delta.x >> 6;
pen_x += kern;
}
}
@@ -211,14 +211,14 @@
if (!fg) continue;
if (kern < 0) kern = 0;
- chr_x = ((pen_x - kern) + (fg->glyph_out->left << 8)) >> 8;
- chr_y = (pen_y + (fg->glyph_out->top << 8)) >> 8;
- chr_w = fg->glyph_out->bitmap.width + (kern >> 8);
+ chr_x = ((pen_x - kern) + (fg->glyph_out->left));
+ chr_y = (pen_y + (fg->glyph_out->top));
+ chr_w = fg->glyph_out->bitmap.width + (kern);
/* if (text[chr]) */
{
int advw;
- advw = ((fg->glyph->advance.x + (kern << 8)) >> 16);
+ advw = ((fg->glyph->advance.x + (kern << 16)) >> 16);
if (chr_w < advw) chr_w = advw;
}
if (chr_x > prev_chr_end)
@@ -235,7 +235,7 @@
return 1;
}
prev_chr_end = chr_x + chr_w;
- pen_x += fg->glyph->advance.x >> 8;
+ pen_x += fg->glyph->advance.x >> 16;
prev_index = index;
}
return 0;
@@ -288,7 +288,7 @@
if (FT_Get_Kerning(fi->src->ft.face, prev_index, index,
ft_kerning_default, &delta) == 0)
{
- kern = delta.x << 2;
+ kern = delta.x >> 6;
pen_x += kern;
}
}
@@ -297,14 +297,14 @@
if (!fg) continue;
if (kern < 0) kern = 0;
- chr_x = ((pen_x - kern) + (fg->glyph_out->left << 8)) >> 8;
- chr_y = (pen_y + (fg->glyph_out->top << 8)) >> 8;
- chr_w = fg->glyph_out->bitmap.width + (kern >> 8);
+ chr_x = ((pen_x - kern) + (fg->glyph_out->left));
+ chr_y = (pen_y + (fg->glyph_out->top));
+ chr_w = fg->glyph_out->bitmap.width + kern;
/* if (text[chr]) */
{
int advw;
- advw = ((fg->glyph->advance.x + (kern << 8)) >> 16);
+ advw = ((fg->glyph->advance.x + (kern << 16)) >> 16);
if (chr_w < advw) chr_w = advw;
}
if (chr_x > prev_chr_end)
@@ -322,7 +322,7 @@
return pchr;
}
prev_chr_end = chr_x + chr_w;
- pen_x += fg->glyph->advance.x >> 8;
+ pen_x += fg->glyph->advance.x >> 16;
prev_index = index;
}
return -1;
-------------------------------------------------------------------------
Take Surveys. Earn Cash. Influence the Future of IT
Join SourceForge.net's Techsay panel and you'll get the chance to share your
opinions on IT & business topics through brief surveys -- and earn cash
http://www.techsay.com/default.php?page=join.php&p=sourceforge&CID=DEVDEV
_______________________________________________
enlightenment-cvs mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/enlightenment-cvs