diff options
author | Mattias Andrée <maandree@kth.se> | 2021-08-15 22:59:49 +0200 |
---|---|---|
committer | Mattias Andrée <maandree@kth.se> | 2021-08-15 23:01:41 +0200 |
commit | 8ec9c1f9d334637581edd1c95f788e785dd25f52 (patch) | |
tree | b5438eab4f93260b5b7d22da146f94e0c85f1126 /libparsesfnt.h | |
parent | First commit (diff) | |
download | libparsesfnt-8ec9c1f9d334637581edd1c95f788e785dd25f52.tar.gz libparsesfnt-8ec9c1f9d334637581edd1c95f788e785dd25f52.tar.bz2 libparsesfnt-8ec9c1f9d334637581edd1c95f788e785dd25f52.tar.xz |
Add hdmx
Signed-off-by: Mattias Andrée <maandree@kth.se>
Diffstat (limited to 'libparsesfnt.h')
-rw-r--r-- | libparsesfnt.h | 35 |
1 files changed, 35 insertions, 0 deletions
diff --git a/libparsesfnt.h b/libparsesfnt.h index 809fad7..f79ed03 100644 --- a/libparsesfnt.h +++ b/libparsesfnt.h @@ -768,4 +768,39 @@ int libparsesfnt_parse_meta_entries( size_t first, size_t count); + +/* === 'hdmx' (horizontal device metrics) === */ +/* https://developer.apple.com/fonts/TrueType-Reference-Manual/RM06/Chap6hdmx.html */ + +struct libparsesfnt_hdmx { + uint16_t version; + uint16_t num_records; + uint32_t record_size; /* includes alignment */ +}; +#define LIBPARSESFNT_HDMX__ "224" + +struct libparsesfnt_hdmx_v0_entry { + uint8_t pixel_size; + uint8_t maximum_width; +}; +#define LIBPARSESFNT_HDMX_V0_ENTRY__ "11" + +int libparsesfnt_parse_hdmx( + const char *data, size_t size, + struct libparsesfnt_hdmx *infop, + const struct libparsesfnt_tabdir_entry *tag); + +int libparsesfnt_parse_hdmx_v0_entries( + const char *data, size_t size, + struct libparsesfnt_hdmx_v0_entry *infop, + const struct libparsesfnt_tabdir_entry *tag, const struct libparsesfnt_hdmx *hdmx, + size_t first, size_t count); + +int libparsesfnt_parse_hdmx_v0_subentry( + const char *data, size_t size, + uint8_t *widthp, + const struct libparsesfnt_tabdir_entry *tag, const struct libparsesfnt_hdmx *hdmx, size_t record, + size_t first, size_t count); + + #endif |