[dump-emoji] better explaination of the usage

This commit is contained in:
Ebrahim Byagowi 2018-10-15 12:04:14 +03:30 committed by Behdad Esfahbod
parent 8dc6296818
commit 27e095a613
1 changed files with 20 additions and 1 deletions

View File

@ -211,10 +211,29 @@ static void dump_glyphs (cairo_font_face_t *cairo_face, unsigned int upem,
int main (int argc, char **argv)
{
if (argc != 2) {
fprintf (stderr, "usage: %s font-file.ttf\n", argv[0]);
fprintf (stderr, "usage: %s font-file.ttf\n"
"run it like `rm -rf out && mkdir out && src/dump-emoji font-file.ttf`\n",
argv[0]);
exit (1);
}
FILE *font_name_file = fopen ("out/_font_name_file.txt", "r");
if (font_name_file != nullptr)
{
fprintf (stderr, "Purge or move ./out folder in order to run a new dump\n");
exit (1);
}
font_name_file = fopen ("out/_font_name_file.txt", "w");
if (font_name_file == nullptr)
{
fprintf (stderr, "./out is not accessible, create it please\n");
exit (1);
}
fwrite (argv[0], 1, strlen (argv[1]), font_name_file);
fclose (font_name_file);
hb_blob_t *blob = hb_blob_create_from_file (argv[1]);
hb_face_t *face = hb_face_create (blob, 0);
hb_font_t *font = hb_font_create (face);