27 #ifndef HB_OT_POST_TABLE_HH
28 #define HB_OT_POST_TABLE_HH
32 #define HB_STRING_ARRAY_NAME format1_names
33 #define HB_STRING_ARRAY_LIST "hb-ot-post-macroman.hh"
35 #undef HB_STRING_ARRAY_LIST
36 #undef HB_STRING_ARRAY_NAME
42 #define HB_OT_TAG_post HB_TAG('p','o','s','t')
58 template<
typename Iterator>
61 const void* _post)
const;
84 post *post_prime =
c->allocate_min<
post> ();
87 memcpy (post_prime,
this, post::min_size);
98 post *post_prime =
c->serializer->start_embed<
post> ();
118 unsigned int table_length =
table.get_length ();
121 if (
version != 0x00020000)
return;
125 glyphNameIndex = &
v2.glyphNameIndex;
126 pool = &StructAfter<uint8_t> (
v2.glyphNameIndex);
128 const uint8_t *
end = (
const uint8_t *) (
const void *)
table + table_length;
141 char *
buf,
unsigned int buf_len)
const
144 if (!
s.length)
return false;
145 if (!buf_len)
return true;
146 unsigned int len = hb_min (buf_len - 1,
s.length);
163 uint16_t *gids = gids_sorted_by_name.
get ();
171 for (
unsigned int i = 0;
i <
count;
i++)
173 hb_qsort (gids,
count,
sizeof (gids[0]),
cmp_gids, (
void *)
this);
183 auto* gid = hb_bsearch (st, gids,
count,
sizeof (gids[0]),
cmp_key, (
void *)
this);
200 return format1_names_length;
203 return glyphNameIndex->len;
211 uint16_t
a = * (
const uint16_t *) pa;
212 uint16_t
b = * (
const uint16_t *)
pb;
216 static int cmp_key (
const void *pk,
const void *po,
void *
arg)
220 uint16_t
o = * (
const uint16_t *) po;
228 if (glyph >= format1_names_length)
231 return format1_names (glyph);
234 if (
version != 0x00020000 || glyph >= glyphNameIndex->len)
237 unsigned int index = glyphNameIndex->arrayZ[glyph];
238 if (
index < format1_names_length)
239 return format1_names (
index);
240 index -= format1_names_length;
247 unsigned int name_length = *
data;
257 const uint8_t *
pool =
nullptr;
small capitals from c petite p scientific i
[1]
hb_array_t< const char > hb_bytes_t
#define TRACE_SERIALIZE(this)
#define TRACE_SANITIZE(this)
#define return_trace(RET)
#define TRACE_SUBSET(this)
@ HB_SERIALIZE_ERROR_INT_OVERFLOW
@ HB_SUBSET_FLAGS_GLYPH_NAMES
PCRE2_SIZE PRIV() strlen(PCRE2_SPTR str)
GLint GLfloat GLfloat GLfloat v2
GLboolean GLboolean GLboolean b
GLboolean GLboolean GLboolean GLboolean a
[7]
GLenum GLenum GLsizei count
GLenum GLuint GLenum GLsizei const GLchar * buf
GLint GLsizei GLsizei GLenum GLenum GLsizei void * data
GLenum GLuint GLintptr offset
GLenum GLenum GLsizei void * table
bool get_glyph_from_name(const char *name, int len, hb_codepoint_t *glyph) const
unsigned int get_glyph_count() const
bool get_glyph_name(hb_codepoint_t glyph, char *buf, unsigned int buf_len) const
hb_blob_ptr_t< post > table
static int cmp_gids(const void *pa, const void *pb, void *arg)
accelerator_t(hb_face_t *face)
static int cmp_key(const void *pk, const void *po, void *arg)
hb_bytes_t find_glyph_name(hb_codepoint_t glyph) const
post_accelerator_t(hb_face_t *face)
bool serialize(hb_serialize_context_t *c, bool glyph_names) const
static constexpr hb_tag_t tableTag
bool sanitize(hb_sanitize_context_t *c) const
bool subset(hb_subset_context_t *c) const
bool serialize(hb_serialize_context_t *c, Iterator it, const void *_post) const
bool subset(hb_subset_context_t *c) const
Array16Of< HBUINT16 > glyphNameIndex
DEFINE_SIZE_ARRAY(2, glyphNameIndex)
bool sanitize(hb_sanitize_context_t *c) const
int cmp(const hb_array_t &a) const
bool cmpexch(const T *old, T *new_) const