27 #ifndef HB_OT_HMTX_TABLE_HH
28 #define HB_OT_HMTX_TABLE_HH
42 #define HB_OT_TAG_hmtx HB_TAG('h','m','t','x')
43 #define HB_OT_TAG_vmtx HB_TAG('v','m','t','x')
65 template <
typename T,
typename H>
78 unsigned int num_hmetrics)
const
90 table->numberOfLongMetrics = num_hmetrics;
98 template<
typename Iterator,
102 unsigned num_long_metrics)
107 if (
idx < num_long_metrics)
116 FWORD *sb =
c->allocate_size<
FWORD> (FWORD::static_size);
128 T *table_prime =
c->serializer->start_embed <
T> ();
132 unsigned num_long_metrics;
135 auto& plan =
c->plan;
136 num_long_metrics = plan->num_output_glyphs ();
138 unsigned int last_advance = plan->old_gid_for_new_gid (num_long_metrics - 1, &old_gid) ? _mtx.
get_advance (old_gid) : 0;
139 while (num_long_metrics > 1 &&
140 last_advance == (plan->old_gid_for_new_gid (num_long_metrics - 2, &old_gid) ? _mtx.
get_advance (old_gid) : 0))
147 + hb_range (
c->plan->num_output_glyphs ())
151 if (!
c->plan->old_gid_for_new_gid (
_, &old_gid))
152 return hb_pair (0
u, 0);
157 table_prime->serialize (
c->serializer,
it, num_long_metrics);
159 if (
unlikely (
c->serializer->in_error ()))
182 unsigned int len =
table.get_length ();
187 face->table.hhea->numberOfLongMetrics :
188 #ifndef HB_NO_VERTICAL
189 face->table.vhea->numberOfLongMetrics
219 var_table.destroy ();
227 return table->longMetricZ[glyph].sb;
244 if (var_table.get_length ())
245 return side_bearing + var_table->get_side_bearing_var (glyph,
font->coords,
font->num_coords);
265 #ifdef HB_NO_BORING_EXPANSION
295 if (var_table.get_length ())
296 return advance +
roundf (var_table->get_advance_var (glyph,
font));
small capitals from c petite p scientific f u
hb_blob_t * hb_blob_copy_writable_or_fail(hb_blob_t *blob)
const char * hb_blob_get_data(hb_blob_t *blob, unsigned int *length)
void hb_blob_destroy(hb_blob_t *blob)
#define TRACE_SANITIZE(this)
#define return_trace(RET)
#define TRACE_SUBSET(this)
void const void *obj HB_UNUSED
unsigned int hb_face_get_upem(const hb_face_t *face)
#define hb_is_iterator(Iter)
auto it hb_map(hb_second)) template< typename Type > inline hb_array_t< Type > operator()(hb_array_t< Type > array
static auto hb_requires(hb_is_iterable(Iterable))> static inline auto end(Iterable &&iterable) HB_AUTO_RETURN(hb_iter(iterable).end()) namespace OT
HB_INTERNAL int _glyf_get_side_bearing_var(hb_font_t *font, hb_codepoint_t glyph, bool is_vertical)
HB_INTERNAL unsigned _glyf_get_advance_var(hb_font_t *font, hb_codepoint_t glyph, bool is_vertical)
GLenum GLuint GLenum GLsizei length
GLenum GLenum GLsizei void * table
hmtx_accelerator_t(hb_face_t *face)
static constexpr hb_tag_t variationsTag
static constexpr bool is_horizontal
static constexpr hb_tag_t tableTag
unsigned int default_advance
int get_side_bearing(hb_codepoint_t glyph) const
unsigned int get_advance(hb_codepoint_t glyph) const
accelerator_t(hb_face_t *face)
unsigned num_long_metrics
unsigned int get_advance(hb_codepoint_t glyph, hb_font_t *font) const
int get_side_bearing(hb_font_t *font, hb_codepoint_t glyph) const
bool subset_update_header(hb_subset_plan_t *plan, unsigned int num_hmetrics) const
bool subset(hb_subset_context_t *c) const
DEFINE_SIZE_ARRAY(0, longMetricZ)
bool sanitize(hb_sanitize_context_t *c HB_UNUSED) const
void serialize(hb_serialize_context_t *c, Iterator it, unsigned num_long_metrics)
UnsizedArrayOf< LongMetric > longMetricZ
vmtx_accelerator_t(hb_face_t *face)
static constexpr bool is_horizontal
static constexpr hb_tag_t tableTag
static constexpr hb_tag_t variationsTag
bool add_table(hb_tag_t tag, hb_blob_t *contents)