summaryrefslogtreecommitdiff
path: root/legacy/evas/src/lib/engines/common/evas_font_main.c
diff options
context:
space:
mode:
authorCarsten Haitzler <raster@rasterman.com>2012-10-10 06:07:38 +0000
committerCarsten Haitzler <raster@rasterman.com>2012-10-10 06:07:38 +0000
commitaad2041e5522797bb850cf6bc210f0b49c47e8c6 (patch)
tree979b4b1a96e0a0591ca4136cd9ee2c872ea89fdc /legacy/evas/src/lib/engines/common/evas_font_main.c
parentf91826870daf36209f642cf3b86362f2b8784e97 (diff)
fix font rounding in evas to round and not floor - fixes some rare
font sizing issues. SVN revision: 77688
Diffstat (limited to '')
-rw-r--r--legacy/evas/src/lib/engines/common/evas_font_main.c16
1 files changed, 8 insertions, 8 deletions
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 ecbe263059..1154bd7e12 100644
--- a/legacy/evas/src/lib/engines/common/evas_font_main.c
+++ b/legacy/evas/src/lib/engines/common/evas_font_main.c
@@ -112,7 +112,7 @@ evas_common_font_ascent_get(RGBA_Font *fn)
112 WRN("NOT SCALABLE!"); 112 WRN("NOT SCALABLE!");
113 } 113 }
114 val = (int)fi->src->ft.face->size->metrics.ascender; 114 val = (int)fi->src->ft.face->size->metrics.ascender;
115 return val >> 6; 115 return FONT_METRIC_ROUNDUP(val);
116// printf("%i | %i\n", val, val >> 6); 116// printf("%i | %i\n", val, val >> 6);
117// if (fi->src->ft.face->units_per_EM == 0) 117// if (fi->src->ft.face->units_per_EM == 0)
118// return val; 118// return val;
@@ -138,7 +138,7 @@ evas_common_font_descent_get(RGBA_Font *fn)
138 fi->src->current_size = fi->size; 138 fi->src->current_size = fi->size;
139 } 139 }
140 val = -(int)fi->src->ft.face->size->metrics.descender; 140 val = -(int)fi->src->ft.face->size->metrics.descender;
141 return val >> 6; 141 return FONT_METRIC_ROUNDUP(val);
142// if (fi->src->ft.face->units_per_EM == 0) 142// if (fi->src->ft.face->units_per_EM == 0)
143// return val; 143// return val;
144// dv = (fi->src->ft.orig_upem * 2048) / fi->src->ft.face->units_per_EM; 144// dv = (fi->src->ft.orig_upem * 2048) / fi->src->ft.face->units_per_EM;
@@ -166,13 +166,13 @@ evas_common_font_max_ascent_get(RGBA_Font *fn)
166 if ((fi->src->ft.face->bbox.yMax == 0) && 166 if ((fi->src->ft.face->bbox.yMax == 0) &&
167 (fi->src->ft.face->bbox.yMin == 0) && 167 (fi->src->ft.face->bbox.yMin == 0) &&
168 (fi->src->ft.face->units_per_EM == 0)) 168 (fi->src->ft.face->units_per_EM == 0))
169 val = (int)fi->src->ft.face->size->metrics.ascender / 64; 169 val = FONT_METRIC_ROUNDUP((int)fi->src->ft.face->size->metrics.ascender);
170 else 170 else
171 val = (int)fi->src->ft.face->bbox.yMax; 171 val = (int)fi->src->ft.face->bbox.yMax;
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 = (val * fi->src->ft.face->size->metrics.y_scale) / (dv * dv); 175 ret = FONT_MERTIC_CONV(val, dv, fi->src->ft.face->size->metrics.y_scale);
176 return ret; 176 return ret;
177} 177}
178 178
@@ -196,13 +196,13 @@ evas_common_font_max_descent_get(RGBA_Font *fn)
196 if ((fi->src->ft.face->bbox.yMax == 0) && 196 if ((fi->src->ft.face->bbox.yMax == 0) &&
197 (fi->src->ft.face->bbox.yMin == 0) && 197 (fi->src->ft.face->bbox.yMin == 0) &&
198 (fi->src->ft.face->units_per_EM == 0)) 198 (fi->src->ft.face->units_per_EM == 0))
199 val = -(int)fi->src->ft.face->size->metrics.descender / 64; 199 val = FONT_METRIC_ROUNDUP(-(int)fi->src->ft.face->size->metrics.descender);
200 else 200 else
201 val = -(int)fi->src->ft.face->bbox.yMin; 201 val = -(int)fi->src->ft.face->bbox.yMin;
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 = (val * fi->src->ft.face->size->metrics.y_scale) / (dv * dv); 205 ret = FONT_MERTIC_CONV(val, dv, fi->src->ft.face->size->metrics.y_scale);
206 return ret; 206 return ret;
207} 207}
208 208
@@ -226,10 +226,10 @@ evas_common_font_get_line_advance(RGBA_Font *fn)
226 if ((fi->src->ft.face->bbox.yMax == 0) && 226 if ((fi->src->ft.face->bbox.yMax == 0) &&
227 (fi->src->ft.face->bbox.yMin == 0) && 227 (fi->src->ft.face->bbox.yMin == 0) &&
228 (fi->src->ft.face->units_per_EM == 0)) 228 (fi->src->ft.face->units_per_EM == 0))
229 return val >> 6; 229 return FONT_METRIC_ROUNDUP(val);
230 else if (fi->src->ft.face->units_per_EM == 0) 230 else if (fi->src->ft.face->units_per_EM == 0)
231 return val; 231 return val;
232 return val >> 6; 232 return FONT_METRIC_ROUNDUP(val);
233// dv = (fi->src->ft.orig_upem * 2048) / fi->src->ft.face->units_per_EM; 233// dv = (fi->src->ft.orig_upem * 2048) / fi->src->ft.face->units_per_EM;
234// ret = (val * fi->src->ft.face->size->metrics.y_scale) / (dv * dv); 234// ret = (val * fi->src->ft.face->size->metrics.y_scale) / (dv * dv);
235// return ret; 235// return ret;