summaryrefslogtreecommitdiff
path: root/src/lib/evas/common/evas_font_main.c
diff options
context:
space:
mode:
authorTom Hacohen <tom@stosb.com>2013-06-10 14:51:44 +0100
committerTom Hacohen <tom@stosb.com>2013-06-10 14:52:10 +0100
commit3137e18962146fa3a1f5565c4d84dbb2759056c9 (patch)
tree534bf7250219df8a3e8a82dc0403de873b3e0203 /src/lib/evas/common/evas_font_main.c
parentd7db12f196611acbcf5bbb923fed10621b68b1b8 (diff)
Revert "continuation of ascent/descent fix by tom - make textblock work too."
This reverts commit 9473c4a9a5b9e056e516b660895cb83c64a1c77f. This commit is not correct. It just goes through every font in the fontset, which is usually all the fonts in the system and tries to get their ascent/descent and by that getting the max ascent/descent. This won't work nicely. The solution is to properly fix textblock, if you think there's something lacking (I.e in the same way I did text). However, my changes did not change previous behaviour, but were just wrappers, so I don't see why extra changes would be needed. Please elaborate. I'm reverting this because: 1. I don't think it's correct. 2. It severly broke e in some cases (reference: http://www.enlightenment.org/ss/e-51b5d5e98cd387.04568822.png ).
Diffstat (limited to '')
-rw-r--r--src/lib/evas/common/evas_font_main.c48
1 files changed, 4 insertions, 44 deletions
diff --git a/src/lib/evas/common/evas_font_main.c b/src/lib/evas/common/evas_font_main.c
index 76247cd2be..80d722144b 100644
--- a/src/lib/evas/common/evas_font_main.c
+++ b/src/lib/evas/common/evas_font_main.c
@@ -84,7 +84,6 @@ evas_common_font_instance_ascent_get(RGBA_Font_Int *fi)
84 FTUNLOCK(); 84 FTUNLOCK();
85 fi->src->current_size = fi->size; 85 fi->src->current_size = fi->size;
86 } 86 }
87 if (!fi->src->ft.face) return 0;
88 if (!FT_IS_SCALABLE(fi->src->ft.face)) 87 if (!FT_IS_SCALABLE(fi->src->ft.face))
89 { 88 {
90 WRN("NOT SCALABLE!"); 89 WRN("NOT SCALABLE!");
@@ -111,7 +110,6 @@ evas_common_font_instance_descent_get(RGBA_Font_Int *fi)
111 FTUNLOCK(); 110 FTUNLOCK();
112 fi->src->current_size = fi->size; 111 fi->src->current_size = fi->size;
113 } 112 }
114 if (!fi->src->ft.face) return 0;
115 val = -(int)fi->src->ft.face->size->metrics.descender; 113 val = -(int)fi->src->ft.face->size->metrics.descender;
116 return FONT_METRIC_ROUNDUP(val); 114 return FONT_METRIC_ROUNDUP(val);
117// if (fi->src->ft.face->units_per_EM == 0) 115// if (fi->src->ft.face->units_per_EM == 0)
@@ -135,7 +133,6 @@ evas_common_font_instance_max_ascent_get(RGBA_Font_Int *fi)
135 FTUNLOCK(); 133 FTUNLOCK();
136 fi->src->current_size = fi->size; 134 fi->src->current_size = fi->size;
137 } 135 }
138 if (!fi->src->ft.face) return 0;
139 if ((fi->src->ft.face->bbox.yMax == 0) && 136 if ((fi->src->ft.face->bbox.yMax == 0) &&
140 (fi->src->ft.face->bbox.yMin == 0) && 137 (fi->src->ft.face->bbox.yMin == 0) &&
141 (fi->src->ft.face->units_per_EM == 0)) 138 (fi->src->ft.face->units_per_EM == 0))
@@ -163,7 +160,6 @@ evas_common_font_instance_max_descent_get(RGBA_Font_Int *fi)
163 FTUNLOCK(); 160 FTUNLOCK();
164 fi->src->current_size = fi->size; 161 fi->src->current_size = fi->size;
165 } 162 }
166 if (!fi->src->ft.face) return 0;
167 if ((fi->src->ft.face->bbox.yMax == 0) && 163 if ((fi->src->ft.face->bbox.yMax == 0) &&
168 (fi->src->ft.face->bbox.yMin == 0) && 164 (fi->src->ft.face->bbox.yMin == 0) &&
169 (fi->src->ft.face->units_per_EM == 0)) 165 (fi->src->ft.face->units_per_EM == 0))
@@ -181,64 +177,28 @@ EAPI int
181evas_common_font_ascent_get(RGBA_Font *fn) 177evas_common_font_ascent_get(RGBA_Font *fn)
182{ 178{
183// evas_common_font_size_use(fn); 179// evas_common_font_size_use(fn);
184 int max = 0, v; 180 return evas_common_font_instance_ascent_get(fn->fonts->data);
185 Eina_List *l;
186 RGBA_Font_Int *fi;
187
188 EINA_LIST_FOREACH(fn->fonts, l, fi)
189 {
190 v = evas_common_font_instance_ascent_get(fi);
191 if (v > max) max = v;
192 }
193 return max;
194} 181}
195 182
196EAPI int 183EAPI int
197evas_common_font_descent_get(RGBA_Font *fn) 184evas_common_font_descent_get(RGBA_Font *fn)
198{ 185{
199// evas_common_font_size_use(fn); 186// evas_common_font_size_use(fn);
200 int max = 0, v; 187 return evas_common_font_instance_descent_get(fn->fonts->data);
201 Eina_List *l;
202 RGBA_Font_Int *fi;
203
204 EINA_LIST_FOREACH(fn->fonts, l, fi)
205 {
206 v = evas_common_font_instance_descent_get(fi);
207 if (v > max) max = v;
208 }
209 return max;
210} 188}
211 189
212EAPI int 190EAPI int
213evas_common_font_max_ascent_get(RGBA_Font *fn) 191evas_common_font_max_ascent_get(RGBA_Font *fn)
214{ 192{
215// evas_common_font_size_use(fn); 193// evas_common_font_size_use(fn);
216 int max = 0, v; 194 return evas_common_font_instance_max_ascent_get(fn->fonts->data);
217 Eina_List *l;
218 RGBA_Font_Int *fi;
219
220 EINA_LIST_FOREACH(fn->fonts, l, fi)
221 {
222 v = evas_common_font_instance_max_ascent_get(fi);
223 if (v > max) max = v;
224 }
225 return max;
226} 195}
227 196
228EAPI int 197EAPI int
229evas_common_font_max_descent_get(RGBA_Font *fn) 198evas_common_font_max_descent_get(RGBA_Font *fn)
230{ 199{
231// evas_common_font_size_use(fn); 200// evas_common_font_size_use(fn);
232 int max = 0, v; 201 return evas_common_font_instance_max_descent_get(fn->fonts->data);
233 Eina_List *l;
234 RGBA_Font_Int *fi;
235
236 EINA_LIST_FOREACH(fn->fonts, l, fi)
237 {
238 v = evas_common_font_instance_max_descent_get(fi);
239 if (v > max) max = v;
240 }
241 return max;
242} 202}
243 203
244EAPI int 204EAPI int