summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorCarsten Haitzler <raster@rasterman.com>2012-10-10 07:00:07 +0000
committerCarsten Haitzler <raster@rasterman.com>2012-10-10 07:00:07 +0000
commit3dbe48e4fed43682ed74d215af49ca44557f6563 (patch)
treec33a658df096e2d44f6c95b78b152216db899999
parent922030ca724cd52c92341397960bcc609d6f9ae4 (diff)
ok ok.. METRIC!
SVN revision: 77695
-rw-r--r--legacy/evas/src/lib/engines/common/evas_font_load.c4
-rw-r--r--legacy/evas/src/lib/engines/common/evas_font_main.c4
-rw-r--r--legacy/evas/src/lib/engines/common/evas_font_private.h4
3 files changed, 6 insertions, 6 deletions
diff --git a/legacy/evas/src/lib/engines/common/evas_font_load.c b/legacy/evas/src/lib/engines/common/evas_font_load.c
index 11b46f9bd3..3e0cf1cc13 100644
--- a/legacy/evas/src/lib/engines/common/evas_font_load.c
+++ b/legacy/evas/src/lib/engines/common/evas_font_load.c
@@ -455,7 +455,7 @@ evas_common_font_int_load_complete(RGBA_Font_Int *fi)
455 if (fi->src->ft.face->units_per_EM != 0) 455 if (fi->src->ft.face->units_per_EM != 0)
456 { 456 {
457 dv = (fi->src->ft.orig_upem * 2048) / fi->src->ft.face->units_per_EM; 457 dv = (fi->src->ft.orig_upem * 2048) / fi->src->ft.face->units_per_EM;
458 ret = FONT_MERTIC_CONV(val, dv, fi->src->ft.face->size->metrics.y_scale); 458 ret = FONT_METRIC_CONV(val, dv, fi->src->ft.face->size->metrics.y_scale);
459 } 459 }
460 else 460 else
461 { 461 {
@@ -470,7 +470,7 @@ evas_common_font_int_load_complete(RGBA_Font_Int *fi)
470 if (fi->src->ft.face->units_per_EM != 0) 470 if (fi->src->ft.face->units_per_EM != 0)
471 { 471 {
472 dv = (fi->src->ft.orig_upem * 2048) / fi->src->ft.face->units_per_EM; 472 dv = (fi->src->ft.orig_upem * 2048) / fi->src->ft.face->units_per_EM;
473 ret = FONT_MERTIC_CONV(val, dv, fi->src->ft.face->size->metrics.y_scale); 473 ret = FONT_METRIC_CONV(val, dv, fi->src->ft.face->size->metrics.y_scale);
474 } 474 }
475 else 475 else
476 { 476 {
diff --git a/legacy/evas/src/lib/engines/common/evas_font_main.c b/legacy/evas/src/lib/engines/common/evas_font_main.c
index 1154bd7e12..d577d43ad3 100644
--- a/legacy/evas/src/lib/engines/common/evas_font_main.c
+++ b/legacy/evas/src/lib/engines/common/evas_font_main.c
@@ -172,7 +172,7 @@ evas_common_font_max_ascent_get(RGBA_Font *fn)
172 if (fi->src->ft.face->units_per_EM == 0) 172 if (fi->src->ft.face->units_per_EM == 0)
173 return val; 173 return val;
174 dv = (fi->src->ft.orig_upem * 2048) / fi->src->ft.face->units_per_EM; 174 dv = (fi->src->ft.orig_upem * 2048) / fi->src->ft.face->units_per_EM;
175 ret = FONT_MERTIC_CONV(val, dv, fi->src->ft.face->size->metrics.y_scale); 175 ret = FONT_METRIC_CONV(val, dv, fi->src->ft.face->size->metrics.y_scale);
176 return ret; 176 return ret;
177} 177}
178 178
@@ -202,7 +202,7 @@ evas_common_font_max_descent_get(RGBA_Font *fn)
202 if (fi->src->ft.face->units_per_EM == 0) 202 if (fi->src->ft.face->units_per_EM == 0)
203 return val; 203 return val;
204 dv = (fi->src->ft.orig_upem * 2048) / fi->src->ft.face->units_per_EM; 204 dv = (fi->src->ft.orig_upem * 2048) / fi->src->ft.face->units_per_EM;
205 ret = FONT_MERTIC_CONV(val, dv, fi->src->ft.face->size->metrics.y_scale); 205 ret = FONT_METRIC_CONV(val, dv, fi->src->ft.face->size->metrics.y_scale);
206 return ret; 206 return ret;
207} 207}
208 208
diff --git a/legacy/evas/src/lib/engines/common/evas_font_private.h b/legacy/evas/src/lib/engines/common/evas_font_private.h
index c50cbb0c46..bbc4675bf5 100644
--- a/legacy/evas/src/lib/engines/common/evas_font_private.h
+++ b/legacy/evas/src/lib/engines/common/evas_font_private.h
@@ -48,14 +48,14 @@ void evas_common_font_int_reload(RGBA_Font_Int *fi);
48 48
49# if 1 49# if 1
50// do proper round (up or down like 1.4 -> 1 and 1.6 -> 2 etc 50// do proper round (up or down like 1.4 -> 1 and 1.6 -> 2 etc
51# define FONT_MERTIC_CONV(val, dv, scale) \ 51# define FONT_METRIC_CONV(val, dv, scale) \
52 (((long long)((val) * (scale)) + (long long)((dv) * (dv) / 2LL)) \ 52 (((long long)((val) * (scale)) + (long long)((dv) * (dv) / 2LL)) \
53 / (long long)((dv) * (dv))) 53 / (long long)((dv) * (dv)))
54# define FONT_METRIC_ROUNDUP(val) \ 54# define FONT_METRIC_ROUNDUP(val) \
55 (((val) + 31) >> 6) 55 (((val) + 31) >> 6)
56# else 56# else
57// truncate/round down 57// truncate/round down
58# define FONT_MERTIC_CONV(val, dv, scale) \ 58# define FONT_METRIC_CONV(val, dv, scale) \
59 (((val) * (scale)) / ((dv) * (dv))) 59 (((val) * (scale)) / ((dv) * (dv)))
60# define FONT_METRIC_ROUNDUP(val) \ 60# define FONT_METRIC_ROUNDUP(val) \
61 ((val) >> 6) 61 ((val) >> 6)