Merge pull request #4054 from harfbuzz/hb-info-color-format

[hb-info] Fix output for CPAL
This commit is contained in:
Matthias Clasen 2023-01-21 02:20:00 -05:00 committed by GitHub
commit 179c93c5c2
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
1 changed files with 13 additions and 6 deletions

View File

@ -964,19 +964,26 @@ struct info_t
char name[64];
unsigned name_len = sizeof name;
hb_ot_name_get_utf8 (face, name_id,
language,
&name_len, name);
printf ("%u ", i);
const char *type = "";
if (flags)
{
if (flags & HB_OT_COLOR_PALETTE_FLAG_USABLE_WITH_LIGHT_BACKGROUND)
printf ("Light");
if (flags & HB_OT_COLOR_PALETTE_FLAG_USABLE_WITH_DARK_BACKGROUND)
printf ("Dark");
{
if (flags & HB_OT_COLOR_PALETTE_FLAG_USABLE_WITH_DARK_BACKGROUND)
type = "Both";
else
type = "Light";
}
else {
type = "Dark";
}
}
printf ("%s\n", name);
printf ("%u %-*s %s\n", i, (int)strlen ("Light"), type, name);
}
}