瀏覽代碼

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

tags/v0.99.beta17
Sam Hocevar sam 15 年之前
父節點
當前提交
a1fd592363
共有 4 個文件被更改,包括 9 次插入8 次删除
  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 查看文件

@@ -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 查看文件

@@ -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 查看文件

@@ -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 查看文件

@@ -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…
取消
儲存