瀏覽代碼

Search for missing fonts in the current directory (Fixes #40) and display

an error message in case of failure.
pull/1/head
Sam Hocevar sam 15 年之前
父節點
當前提交
a5f4d401fc
共有 2 個文件被更改,包括 9 次插入1 次删除
  1. +1
    -0
      doc/toilet.1.in
  2. +8
    -1
      src/figlet.c

+ 1
- 0
doc/toilet.1.in 查看文件

@@ -56,6 +56,7 @@ or
.B .tlf
files stored in the
.B @datarootdir@/figlet
directory. Fonts are looked first in the font directory, then in the current
directory. There is also a special built-in font called
.I term
that serves as a fallback if no font is available.


+ 8
- 1
src/figlet.c 查看文件

@@ -42,7 +42,14 @@ int init_figlet(context_t *cx)

snprintf(path, 2047, "%s/%s", cx->dir, cx->font);
if(caca_canvas_set_figfont(cx->cv, path))
return -1;
{
snprintf(path, 2047, "./%s", cx->font);
if(caca_canvas_set_figfont(cx->cv, path))
{
fprintf(stderr, "error: could not load font %s\n", cx->font);
return -1;
}
}

cx->feed = feed_figlet;
cx->flush = flush_figlet;


Loading…
取消
儲存