28 #ifndef HB_AAT_LAYOUT_KERX_TABLE_HH
29 #define HB_AAT_LAYOUT_KERX_TABLE_HH
38 #define HB_AAT_TAG_kerx HB_TAG('k','e','r','x')
47 kerxTupleKern (
int value,
48 unsigned int tupleCount,
50 hb_aat_apply_context_t *
c)
56 if (
unlikely (!
c->sanitizer.check_array (pv, tupleCount)))
return 0;
75 return right.cmp (
o.right);
92 template <
typename KernSubTableHeader>
99 int v = pairs.bsearch (pair).get_kerning ();
100 return kerxTupleKern (
v,
header.tuple_count (),
this,
c);
107 if (!
c->plan->requested_kerning)
115 machine.
kern (
c->font,
c->buffer,
c->plan->kern_mask);
149 template <
bool extended>
158 DontAdvance = 0x4000,
174 {
return entry.data.kernActionIndex != 0xFFFF; }
177 {
return entry.data.kernActionIndex; }
185 DontAdvance = 0x4000,
202 template <
typename KernSubTableHeader>
205 typedef typename KernSubTableHeader::Types
Types;
213 static constexpr
bool in_place =
true;
216 DontAdvance = Format1EntryT::DontAdvance,
226 kernAction (&
table->machine +
table->kernAction),
232 {
return Format1EntryT::performAction (
entry); }
239 if (
flags & Format1EntryT::Reset)
242 if (
flags & Format1EntryT::Push)
250 if (Format1EntryT::performAction (
entry) &&
depth)
252 unsigned int tuple_count = hb_max (1u,
table->header.tuple_count ());
254 unsigned int kern_idx = Format1EntryT::kernActionIndex (
entry);
255 kern_idx = Types::byteOffsetToIndex (kern_idx, &
table->machine, kernAction.arrayZ);
256 const FWORD *actions = &kernAction[kern_idx];
257 if (!
c->sanitizer.check_array (actions,
depth, tuple_count))
269 while (!last &&
depth)
273 actions += tuple_count;
291 o.attach_chain() = 0;
294 else if (
o.attach_type())
296 o.y_offset +=
c->font->em_scale_y (
v);
300 else if (
buffer->info[
idx].mask & kern_mask)
302 o.x_advance +=
c->font->em_scale_x (
v);
303 o.x_offset +=
c->font->em_scale_x (
v);
314 o.attach_chain() = 0;
317 else if (
o.attach_type())
319 o.x_offset +=
c->font->em_scale_x (
v);
323 else if (
buffer->info[
idx].mask & kern_mask)
325 o.y_advance +=
c->font->em_scale_y (
v);
326 o.y_offset +=
c->font->em_scale_y (
v);
337 unsigned int stack[8];
346 if (!
c->plan->requested_kerning &&
363 machine.sanitize (
c)));
374 template <
typename KernSubTableHeader>
377 typedef typename KernSubTableHeader::Types
Types;
383 unsigned int num_glyphs =
c->sanitizer.get_num_glyphs ();
384 unsigned int l = (
this+leftClassTable).get_class (
left, num_glyphs, 0);
385 unsigned int r = (
this+rightClassTable).get_class (
right, num_glyphs, 0);
388 unsigned int kern_idx =
l +
r;
389 kern_idx = Types::offsetToIndex (kern_idx,
this, arrayZ.
arrayZ);
390 const FWORD *
v = &arrayZ[kern_idx];
391 if (
unlikely (!
v->sanitize (&
c->sanitizer)))
return 0;
393 return kerxTupleKern (*
v,
header.tuple_count (),
this,
c);
400 if (!
c->plan->requested_kerning)
408 machine.
kern (
c->font,
c->buffer,
c->plan->kern_mask);
430 leftClassTable.sanitize (
c,
this) &&
431 rightClassTable.sanitize (
c,
this) &&
432 c->check_range (
this,
array)));
451 template <
typename KernSubTableHeader>
466 static constexpr
bool in_place =
true;
470 DontAdvance = 0x4000,
477 ActionType = 0xC0000000,
487 action_type ((
table->
flags & ActionType) >> 30),
494 {
return entry.data.ankrActionIndex != 0xFFFF; }
500 if (mark_set &&
entry.data.ankrActionIndex != 0xFFFF &&
buffer->idx <
buffer->len)
511 if (!
c->sanitizer.check_array (
data, 2))
return;
512 unsigned int markControlPoint = *
data++;
513 unsigned int currControlPoint = *
data++;
518 if (!
c->font->get_glyph_contour_point_for_origin (
c->buffer->info[mark].codepoint,
522 !
c->font->get_glyph_contour_point_for_origin (
c->buffer->cur ().codepoint,
528 o.x_offset = markX - currX;
529 o.y_offset = markY - currY;
539 if (!
c->sanitizer.check_array (
data, 2))
return;
540 unsigned int markAnchorPoint = *
data++;
541 unsigned int currAnchorPoint = *
data++;
542 const Anchor &markAnchor =
c->ankr_table->get_anchor (
c->buffer->info[mark].codepoint,
544 c->sanitizer.get_num_glyphs ());
545 const Anchor &currAnchor =
c->ankr_table->get_anchor (
c->buffer->cur ().codepoint,
547 c->sanitizer.get_num_glyphs ());
559 if (!
c->sanitizer.check_array (
data, 4))
return;
565 o.x_offset =
c->font->em_scale_x (markX) -
c->font->em_scale_x (currX);
566 o.y_offset =
c->font->em_scale_y (markY) -
c->font->em_scale_y (currY);
571 o.attach_chain() = (int) mark - (
int)
buffer->idx;
575 if (
entry.flags & Mark)
584 unsigned int action_type;
618 template <
typename KernSubTableHeader>
623 ValuesAreLong = 0x00000001,
631 unsigned int num_glyphs =
c->sanitizer.get_num_glyphs ();
635 unsigned int l = (
this+
t.rowIndexTable).get_value_or_null (
left, num_glyphs);
636 unsigned int r = (
this+
t.columnIndexTable).get_value_or_null (
right, num_glyphs);
641 if (
unlikely (!
v->sanitize (&
c->sanitizer)))
return 0;
642 return kerxTupleKern (*
v,
header.tuple_count (), &(
this+
vector),
c);
647 unsigned int l = (
this+
t.rowIndexTable).get_value_or_null (
left, num_glyphs);
648 unsigned int r = (
this+
t.columnIndexTable).get_value_or_null (
right, num_glyphs);
651 if (
unlikely (!
v->sanitize (&
c->sanitizer)))
return 0;
652 return kerxTupleKern (*
v,
header.tuple_count (), &(
this+
vector),
c);
660 if (!
c->plan->requested_kerning)
668 machine.
kern (
c->font,
c->buffer,
c->plan->kern_mask);
679 u.l.rowIndexTable.sanitize (
c,
this) &&
680 u.l.columnIndexTable.sanitize (
c,
this) &&
681 c->check_range (
this,
u.l.array)
683 u.s.rowIndexTable.sanitize (
c,
this) &&
684 u.s.columnIndexTable.sanitize (
c,
this) &&
685 c->check_range (
this,
u.s.array)
687 (
header.tuple_count () == 0 ||
688 c->check_range (
this,
vector))));
740 CrossStream = 0x40000000u,
741 Variation = 0x20000000u,
742 Backwards = 0x10000000u,
747 Reserved = 0x0FFFFF00u,
748 SubtableType= 0x000000FFu,
769 unsigned int get_size ()
const {
return u.header.length; }
770 unsigned int get_type ()
const {
return u.header.coverage &
u.header.SubtableType; }
772 template <
typename context_t,
typename ...Ts>
773 typename context_t::return_t
dispatch (context_t *
c, Ts&&... ds)
const
775 unsigned int subtable_type = get_type ();
777 switch (subtable_type) {
778 case 0:
return_trace (
c->dispatch (
u.format0, std::forward<Ts> (ds)...));
779 case 1:
return_trace (
c->dispatch (
u.format1, std::forward<Ts> (ds)...));
780 case 2:
return_trace (
c->dispatch (
u.format2, std::forward<Ts> (ds)...));
781 case 4:
return_trace (
c->dispatch (
u.format4, std::forward<Ts> (ds)...));
782 case 6:
return_trace (
c->dispatch (
u.format6, std::forward<Ts> (ds)...));
790 if (!
u.header.sanitize (
c) ||
791 u.header.length <=
u.header.static_size ||
792 !
c->check_range (
this,
u.header.length))
816 template <
typename T>
820 const T*
thiz ()
const {
return static_cast<const T *
> (
this); }
824 typedef typename T::SubTable SubTable;
826 const SubTable *st = &thiz()->firstSubTable;
827 unsigned int count = thiz()->tableCount;
828 for (
unsigned int i = 0;
i <
count;
i++)
830 if (st->get_type () == 1)
832 st = &StructAfter<SubTable> (*st);
839 typedef typename T::SubTable SubTable;
841 const SubTable *st = &thiz()->firstSubTable;
842 unsigned int count = thiz()->tableCount;
843 for (
unsigned int i = 0;
i <
count;
i++)
845 if (st->u.header.coverage & st->u.header.CrossStream)
847 st = &StructAfter<SubTable> (*st);
854 typedef typename T::SubTable SubTable;
857 const SubTable *st = &thiz()->firstSubTable;
858 unsigned int count = thiz()->tableCount;
859 for (
unsigned int i = 0;
i <
count;
i++)
861 if ((st->u.header.coverage & (st->u.header.Variation | st->u.header.CrossStream)) ||
862 !st->u.header.is_horizontal ())
865 st = &StructAfter<SubTable> (*st);
872 typedef typename T::SubTable SubTable;
875 bool seenCrossStream =
false;
876 c->set_lookup_index (0);
877 const SubTable *st = &thiz()->firstSubTable;
878 unsigned int count = thiz()->tableCount;
879 for (
unsigned int i = 0;
i <
count;
i++)
883 if (!T::Types::extended && (st->u.header.coverage & st->u.header.Variation))
889 reverse = bool (st->u.header.coverage & st->u.header.Backwards) !=
892 if (!
c->buffer->message (
c->font,
"start subtable %d",
c->lookup_index))
895 if (!seenCrossStream &&
896 (st->u.header.coverage & st->u.header.CrossStream))
899 seenCrossStream =
true;
901 unsigned int count =
c->buffer->len;
902 for (
unsigned int i = 0;
i <
count;
i++)
913 c->buffer->reverse ();
918 ret |= st->dispatch (
c);
922 c->buffer->reverse ();
924 (
void)
c->buffer->message (
c->font,
"end subtable %d",
c->lookup_index);
927 st = &StructAfter<SubTable> (*st);
928 c->set_lookup_index (
c->lookup_index + 1);
938 (
unsigned) thiz()->
version < (
unsigned) T::minVersion ||
939 !thiz()->tableCount.sanitize (
c)))
942 typedef typename T::SubTable
SubTable;
944 const SubTable *st = &thiz()->firstSubTable;
945 unsigned int count = thiz()->tableCount;
946 for (
unsigned int i = 0;
i <
count;
i++)
962 st = &StructAfter<SubTable> (*st);
974 static constexpr
unsigned minVersion = 2u;
small capitals from c petite p scientific f u
small capitals from c petite p scientific i
[1]
@ HB_BUFFER_SCRATCH_FLAG_HAS_GPOS_ATTACHMENT
#define TRACE_SANITIZE(this)
#define TRACE_DISPATCH(this, format)
#define TRACE_APPLY(this)
#define return_trace(RET)
void const void *obj HB_UNUSED
auto it unsigned count const
set set set set set set set macro pixldst1 abits if abits op else op endif endm macro pixldst2 abits if abits op else op endif endm macro pixldst4 abits if abits op else op endif endm macro pixldst0 abits op endm macro pixldst3 mem_operand op endm macro pixldst30 mem_operand op endm macro pixldst abits if abits elseif abits elseif abits elseif abits elseif abits pixldst0 abits else pixldst0 abits pixldst0 abits pixldst0 abits pixldst0 abits endif elseif abits else pixldst0 abits pixldst0 abits endif elseif abits else error unsupported bpp *numpix else pixst endif endm macro vuzp8 reg2 vuzp d d ®2 endm macro vzip8 reg2 vzip d d ®2 endm macro pixdeinterleave basereg basereg basereg basereg basereg endif endm macro pixinterleave basereg basereg basereg basereg basereg endif endm macro PF boost_increment endif if endif PF tst PF addne PF subne PF cmp ORIG_W if endif if endif if endif PF subge ORIG_W PF subges if endif if endif if endif endif endm macro cache_preload_simple endif if dst_r_bpp pld[DST_R, #(PREFETCH_DISTANCE_SIMPLE *dst_r_bpp/8)] endif if mask_bpp pld if[MASK, #(PREFETCH_DISTANCE_SIMPLE *mask_bpp/8)] endif endif endm macro ensure_destination_ptr_alignment process_pixblock_tail_head if beq irp skip1(dst_w_bpp<=(lowbit *8)) &&((lowbit *8)<(pixblock_size *dst_w_bpp)) .if lowbit< 16 tst DST_R
[3]
EGLOutputLayerEXT EGLint EGLAttrib value
GLsizei const GLfloat * v
[13]
GLint GLenum GLsizei GLsizei GLsizei depth
GLenum GLenum GLsizei count
GLint GLsizei GLsizei GLenum GLenum GLsizei void * data
GLenum GLuint GLintptr offset
GLenum GLenum GLsizei void * table
#define HB_DIRECTION_IS_FORWARD(dir)
#define HB_DIRECTION_IS_BACKWARD(dir)
#define HB_DIRECTION_IS_HORIZONTAL(dir)
QHttpRequestHeader header("GET", QUrl::toPercentEncoding("/index.html"))
[1]
static bool performAction(const Entry< EntryData > &entry)
static unsigned int kernActionIndex(const Entry< EntryData > &entry)
static unsigned int kernActionIndex(const Entry< EntryData > &entry)
static bool performAction(const Entry< EntryData > &entry)
bool sanitize(hb_sanitize_context_t *c) const
int cmp(const hb_glyph_pair_t &o) const
void transition(StateTableDriver< Types, EntryData > *driver, const Entry< EntryData > &entry)
bool is_actionable(StateTableDriver< Types, EntryData > *driver HB_UNUSED, const Entry< EntryData > &entry)
driver_context_t(const KerxSubTableFormat1 *table_, hb_aat_apply_context_t *c_)
bool is_actionable(StateTableDriver< Types, EntryData > *driver HB_UNUSED, const Entry< EntryData > &entry)
driver_context_t(const KerxSubTableFormat4 *table, hb_aat_apply_context_t *c_)
void transition(StateTableDriver< Types, EntryData > *driver, const Entry< EntryData > &entry)
KerxSubTableFormat2< KerxSubTableHeader > format2
KerxSubTableFormat4< KerxSubTableHeader > format4
unsigned int get_type() const
KerxSubTableFormat0< KerxSubTableHeader > format0
KerxSubTableFormat6< KerxSubTableHeader > format6
KerxSubTableFormat1< KerxSubTableHeader > format1
unsigned int get_size() const
bool sanitize(hb_sanitize_context_t *c) const
union AAT::KerxSubTable::@76 u
context_t::return_t dispatch(context_t *c, Ts &&... ds) const
KerxSubTableHeader header
bool apply(AAT::hb_aat_apply_context_t *c) const
int get_h_kerning(hb_codepoint_t left, hb_codepoint_t right) const
bool has_cross_stream() const
bool has_state_machine() const
bool sanitize(hb_sanitize_context_t *c, unsigned int *num_entries_out=nullptr) const
KerxSubTableHeader SubTableHeader
SubTableHeader::Types Types
Type arrayZ[HB_VAR_ARRAY]
HB_NO_SANITIZE_SIGNED_INTEGER_OVERFLOW void kern(hb_font_t *font, hb_buffer_t *buffer, hb_mask_t kern_mask, bool scale=true) const