Compare commits

...

1 Commits

Author SHA1 Message Date
Matthias Clasen 262bfa025f hb-shape: Print table version where relevant
When listing tables with --list-tables, show
the version for CPAL and COLR tables.
2023-01-15 21:47:50 -05:00
1 changed files with 10 additions and 1 deletions

View File

@ -28,6 +28,7 @@
#define FACE_OPTIONS_HH
#include "options.hh"
#include "hb-open-type.hh"
struct face_options_t
{
@ -141,7 +142,15 @@ static G_GNUC_NORETURN void _list_tables (hb_face_t *face)
hb_blob_t *blob = hb_face_reference_table (face, tag);
printf ("%c%c%c%c: %8u bytes\n", HB_UNTAG (tag), hb_blob_get_length (blob));
int version = 0;
if (tag == HB_TAG('C','P','A','L') ||
tag == HB_TAG('C','O','L','R'))
{
version = (int) *(OT::HBUINT16 *) hb_blob_get_data (blob, NULL);
}
printf ("%c%c%c%c%s %8u bytes\n", HB_UNTAG (tag), version == 1 ? "v1:" : ": ", hb_blob_get_length (blob));
hb_blob_destroy (blob);
}