Browse Source

Store built-in fonts in a uin8_t[] instead of char[].

tags/v0.99.beta17
Sam Hocevar sam 15 years ago
parent
commit
a1fd592363
4 changed files with 9 additions and 8 deletions
  1. +2
    -2
      caca/font.c
  2. +2
    -2
      caca/mono9.data
  3. +2
    -2
      caca/monobold12.data
  4. +3
    -2
      tools/makefont.c

+ 2
- 2
caca/font.c View File

@@ -118,9 +118,9 @@ caca_font_t *caca_load_font(void const *data, size_t size)
if(size == 0)
{
if(!strcasecmp(data, "Monospace 9"))
return caca_load_font((char *)&mono9_data, mono9_size);
return caca_load_font(mono9_data, mono9_size);
if(!strcasecmp(data, "Monospace Bold 12"))
return caca_load_font((char *)&monobold12_data, monobold12_size);
return caca_load_font(monobold12_data, monobold12_size);

seterrno(ENOENT);
return NULL;


+ 2
- 2
caca/mono9.data View File

@@ -4,8 +4,8 @@
* tools/makefont mono9 "Monospace 9" 96 4
*/

static unsigned int const mono9_size = 246854;
static char mono9_data[246854] =
static size_t const mono9_size = 246854;
static uint8_t mono9_data[246854] =
{
/* file: */
0xCA,0xCA, /* caca_header */


+ 2
- 2
caca/monobold12.data View File

@@ -4,8 +4,8 @@
* tools/makefont monobold12 "Monospace Bold 12" 96 4
*/

static unsigned int const monobold12_size = 419205;
static char monobold12_data[419205] =
static size_t const monobold12_size = 419205;
static uint8_t monobold12_data[419205] =
{
/* file: */
0xCA,0xCA, /* caca_header */


+ 3
- 2
tools/makefont.c View File

@@ -187,9 +187,10 @@ int main(int argc, char *argv[])
printf(" */\n");
printf("\n");

printf("static unsigned int const %s_size = %i;\n",
printf("static size_t const %s_size = %i;\n",
prefix, 4 + control_size + data_size);
printf("static uint8_t %s_data[%i] =\n",
prefix, 4 + control_size + data_size);
printf("static char %s_data[%i] =\n", prefix, 4 + control_size + data_size);
printf("{\n");

printf("/* file: */\n");


Loading…
Cancel
Save