diff options
author | Michael Pavone <pavone@retrodev.com> | 2018-03-25 12:01:49 -0700 |
---|---|---|
committer | Michael Pavone <pavone@retrodev.com> | 2018-03-25 12:01:49 -0700 |
commit | a5d5c017589945008024f111c06894f5724d6c3b (patch) | |
tree | a06db423e81d53aee66cfa0b0ca366bd57d71dc8 /nuklear_ui/sfnt.h | |
parent | 15af9462392967b6adf7ba6ff4f7ff778cf10eb3 (diff) | |
parent | b6feecb6c12566e9ea826cb67701008f9e423eea (diff) |
Merged nuklear_ui into default
Diffstat (limited to 'nuklear_ui/sfnt.h')
-rw-r--r-- | nuklear_ui/sfnt.h | 44 |
1 files changed, 44 insertions, 0 deletions
diff --git a/nuklear_ui/sfnt.h b/nuklear_ui/sfnt.h new file mode 100644 index 0000000..010a147 --- /dev/null +++ b/nuklear_ui/sfnt.h @@ -0,0 +1,44 @@ +#ifndef SFNT_H_ +#define SFNT_H_ + +#include <stdint.h> +enum { + CONTAINER_TTF, + CONTAINER_TTC, + CONTAINER_DFONT +}; + +enum { + SFNT_COPYRIGHT, + SFNT_FAMILY, + SFNT_SUBFAMILY, + SFNT_SUBFAMILY_UNIQUE, + SFNT_FULL_NAME, + SFNT_VERSION, + SFNT_POSTSCRIPT, + //TODO: add the rest of the name IDs +}; + +typedef struct sfnt_container sfnt_container; +typedef struct { + uint8_t *data; + sfnt_container *container; + uint32_t offset; + uint16_t num_entries; +} sfnt_table; + +struct sfnt_container { + uint8_t *blob; + sfnt_table *tables; + uint32_t size; + uint8_t num_fonts; + uint8_t container_type; +}; + +sfnt_container *load_sfnt(uint8_t *buffer, uint32_t size); +char *sfnt_name(sfnt_table *sfnt, uint16_t name_type); +uint8_t *sfnt_flatten(sfnt_table *sfnt, uint32_t *size_out); +sfnt_table *sfnt_subfamily_by_names(sfnt_container *sfnt, const char **names); +void sfnt_free(sfnt_container *sfnt); + +#endif // SFNT_H_
\ No newline at end of file |