comparison libass/ass_library.c @ 21458:7af6c25a0cfc

Keep embedded fonts in ass_library_t and perform actual disk write in fontconfig initialization. This is required for some fontconfig-related improvements.
author eugeni
date Sun, 03 Dec 2006 17:59:13 +0000
parents 2edba6772316
children 4a4af5271542
comparison
equal deleted inserted replaced
21457:af4c8fd34494 21458:7af6c25a0cfc
69 priv->style_overrides = malloc((cnt + 1) * sizeof(char*)); 69 priv->style_overrides = malloc((cnt + 1) * sizeof(char*));
70 for (p = list, q = priv->style_overrides; *p; ++p, ++q) 70 for (p = list, q = priv->style_overrides; *p; ++p, ++q)
71 *q = strdup(*p); 71 *q = strdup(*p);
72 priv->style_overrides[cnt] = NULL; 72 priv->style_overrides[cnt] = NULL;
73 } 73 }
74
75 static void grow_array(void **array, int nelem, size_t elsize)
76 {
77 if (!(nelem & 31))
78 *array = realloc(*array, (nelem + 32) * elsize);
79 }
80
81 void ass_add_font(ass_library_t* priv, char* name, char* data, int size)
82 {
83 grow_array((void**)&priv->fontdata, priv->num_fontdata, sizeof(*priv->fontdata));
84 priv->fontdata[priv->num_fontdata].name = name;
85 priv->fontdata[priv->num_fontdata].data = data;
86 priv->fontdata[priv->num_fontdata].size = size;
87 priv->num_fontdata ++;
88 }
89