summaryrefslogtreecommitdiff
path: root/legacy
diff options
context:
space:
mode:
authorCedric BAIL <cedric.bail@free.fr>2009-12-14 17:55:26 +0000
committerCedric BAIL <cedric.bail@free.fr>2009-12-14 17:55:26 +0000
commitb83490725c5417a34158aa3464bd734d199d38b3 (patch)
treea31e860f942653d3d0c5bd5438b4a2f58fef74eb /legacy
parent6ade2a3f68a0b79d81dbbb6471df5c7b89929a9a (diff)
* evas_font_dir: Add all guards.
SVN revision: 44446
Diffstat (limited to 'legacy')
-rw-r--r--legacy/evas/src/lib/canvas/evas_font_dir.c12
1 files changed, 12 insertions, 0 deletions
diff --git a/legacy/evas/src/lib/canvas/evas_font_dir.c b/legacy/evas/src/lib/canvas/evas_font_dir.c
index 4beef42b23..39cdd76500 100644
--- a/legacy/evas/src/lib/canvas/evas_font_dir.c
+++ b/legacy/evas/src/lib/canvas/evas_font_dir.c
@@ -130,8 +130,10 @@ evas_fonts_zero_free(Evas *evas)
130 if (fd->name) eina_stringshare_del(fd->name); 130 if (fd->name) eina_stringshare_del(fd->name);
131 if (fd->source) eina_stringshare_del(fd->source); 131 if (fd->source) eina_stringshare_del(fd->source);
132 evas->engine.func->font_free(evas->engine.data.output, fd->font); 132 evas->engine.func->font_free(evas->engine.data.output, fd->font);
133#ifdef HAVE_FONTCONFIG
133 if (fd->set) FcFontSetDestroy(fd->set); 134 if (fd->set) FcFontSetDestroy(fd->set);
134 if (fd->p_nm) FcPatternDestroy(fd->p_nm); 135 if (fd->p_nm) FcPatternDestroy(fd->p_nm);
136#endif
135 free(fd); 137 free(fd);
136 } 138 }
137} 139}
@@ -152,8 +154,10 @@ evas_fonts_zero_presure(Evas *evas)
152 if (fd->name) eina_stringshare_del(fd->name); 154 if (fd->name) eina_stringshare_del(fd->name);
153 if (fd->source) eina_stringshare_del(fd->source); 155 if (fd->source) eina_stringshare_del(fd->source);
154 evas->engine.func->font_free(evas->engine.data.output, fd->font); 156 evas->engine.func->font_free(evas->engine.data.output, fd->font);
157#ifdef HAVE_FONTCONFIG
155 if (fd->set) FcFontSetDestroy(fd->set); 158 if (fd->set) FcFontSetDestroy(fd->set);
156 if (fd->p_nm) FcPatternDestroy(fd->p_nm); 159 if (fd->p_nm) FcPatternDestroy(fd->p_nm);
160#endif
157 free(fd); 161 free(fd);
158 162
159 if (eina_list_count(fonts_zero) < 5) break; 163 if (eina_list_count(fonts_zero) < 5) break;
@@ -190,8 +194,10 @@ evas_font_free(Evas *evas, void *font)
190 if (fd->name) eina_stringshare_del(fd->name); 194 if (fd->name) eina_stringshare_del(fd->name);
191 if (fd->source) eina_stringshare_del(fd->source); 195 if (fd->source) eina_stringshare_del(fd->source);
192 evas->engine.func->font_free(evas->engine.data.output, fd->font); 196 evas->engine.func->font_free(evas->engine.data.output, fd->font);
197#ifdef HAVE_FONTCONFIG
193 if (fd->set) FcFontSetDestroy(fd->set); 198 if (fd->set) FcFontSetDestroy(fd->set);
194 if (fd->p_nm) FcPatternDestroy(fd->p_nm); 199 if (fd->p_nm) FcPatternDestroy(fd->p_nm);
200#endif
195 free(fd); 201 free(fd);
196 202
197 if (eina_list_count(fonts_zero) < 43) break; 203 if (eina_list_count(fonts_zero) < 43) break;
@@ -214,6 +220,7 @@ evas_font_init(void)
214#endif 220#endif
215} 221}
216 222
223#ifdef HAVE_FONTCONFIG
217static void * 224static void *
218evas_load_fontconfig(Evas *evas, FcFontSet *set, int size) 225evas_load_fontconfig(Evas *evas, FcFontSet *set, int size)
219{ 226{
@@ -235,6 +242,7 @@ evas_load_fontconfig(Evas *evas, FcFontSet *set, int size)
235 242
236 return font; 243 return font;
237} 244}
245#endif
238 246
239void * 247void *
240evas_font_load(Evas *evas, const char *name, const char *source, int size) 248evas_font_load(Evas *evas, const char *name, const char *source, int size)
@@ -267,11 +275,13 @@ evas_font_load(Evas *evas, const char *name, const char *source, int size)
267 fd->ref++; 275 fd->ref++;
268 return fd->font; 276 return fd->font;
269 } 277 }
278#ifdef HAVE_FONTCONFIG
270 else if (fd->set && fd->p_nm) 279 else if (fd->set && fd->p_nm)
271 { 280 {
272 font = evas_load_fontconfig(evas, fd->set, size); 281 font = evas_load_fontconfig(evas, fd->set, size);
273 goto on_find; 282 goto on_find;
274 } 283 }
284#endif
275 } 285 }
276 } 286 }
277 } 287 }
@@ -290,11 +300,13 @@ evas_font_load(Evas *evas, const char *name, const char *source, int size)
290 fd->ref++; 300 fd->ref++;
291 return fd->font; 301 return fd->font;
292 } 302 }
303#ifdef HAVE_FONTCONFIG
293 else if (fd->set && fd->p_nm) 304 else if (fd->set && fd->p_nm)
294 { 305 {
295 font = evas_load_fontconfig(evas, fd->set, size); 306 font = evas_load_fontconfig(evas, fd->set, size);
296 goto on_find; 307 goto on_find;
297 } 308 }
309#endif
298 } 310 }
299 } 311 }
300 } 312 }