[kerx/kern] Add has_cross_stream()
This commit is contained in:
parent
ea579f9ccc
commit
bc06e2805a
|
@ -848,6 +848,21 @@ struct KerxTable
|
||||||
/* https://en.wikipedia.org/wiki/Curiously_recurring_template_pattern */
|
/* https://en.wikipedia.org/wiki/Curiously_recurring_template_pattern */
|
||||||
inline const T* thiz (void) const { return static_cast<const T *> (this); }
|
inline const T* thiz (void) const { return static_cast<const T *> (this); }
|
||||||
|
|
||||||
|
inline bool has_cross_stream (void) const
|
||||||
|
{
|
||||||
|
typedef typename T::SubTable SubTable;
|
||||||
|
|
||||||
|
const SubTable *st = &thiz()->firstSubTable;
|
||||||
|
unsigned int count = thiz()->tableCount;
|
||||||
|
for (unsigned int i = 0; i < count; i++)
|
||||||
|
{
|
||||||
|
if (st->u.header.coverage & st->u.header.CrossStream)
|
||||||
|
return true;
|
||||||
|
st = &StructAfter<SubTable> (*st);
|
||||||
|
}
|
||||||
|
return false;
|
||||||
|
}
|
||||||
|
|
||||||
inline int get_h_kerning (hb_codepoint_t left, hb_codepoint_t right) const
|
inline int get_h_kerning (hb_codepoint_t left, hb_codepoint_t right) const
|
||||||
{
|
{
|
||||||
typedef typename T::SubTable SubTable;
|
typedef typename T::SubTable SubTable;
|
||||||
|
|
|
@ -273,6 +273,15 @@ struct kern
|
||||||
|
|
||||||
inline bool has_data (void) const { return u.version32; }
|
inline bool has_data (void) const { return u.version32; }
|
||||||
|
|
||||||
|
inline bool has_cross_stream (void) const
|
||||||
|
{
|
||||||
|
switch (u.major) {
|
||||||
|
case 0: return u.ot.has_cross_stream ();
|
||||||
|
case 1: return u.aat.has_cross_stream ();
|
||||||
|
default:return false;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
inline int get_h_kerning (hb_codepoint_t left, hb_codepoint_t right) const
|
inline int get_h_kerning (hb_codepoint_t left, hb_codepoint_t right) const
|
||||||
{
|
{
|
||||||
switch (u.major) {
|
switch (u.major) {
|
||||||
|
|
Loading…
Reference in New Issue