提交 540ccc38 编写于 作者: B Behdad Esfahbod

[kern/kerx] More towards sharing

上级 d0f8f4c2
......@@ -59,6 +59,8 @@ kerxTupleKern (int value,
struct KerxSubTableHeader
{
typedef MorxTypes Types;
enum Coverage
{
Vertical = 0x80000000, /* Set if table has vertical kerning values. */
......@@ -134,13 +136,12 @@ struct KerxSubTableFormat0
inline bool sanitize (hb_sanitize_context_t *c) const
{
TRACE_SANITIZE (this);
return_trace (likely (c->check_struct (this) &&
pairs.sanitize (c)));
return_trace (likely (pairs.sanitize (c)));
}
protected:
KernSubTableHeader header;
BinSearchArrayOf<KernPair, HBUINT32>
BinSearchArrayOf<KernPair, typename KernSubTableHeader::Types::HBUINT>
pairs; /* Sorted kern records. */
public:
DEFINE_SIZE_ARRAY (KernSubTableHeader::static_size + 16, pairs);
......
......@@ -49,8 +49,7 @@ struct KernSubTableFormat0
{
hb_glyph_pair_t pair = {left, right};
int i = pairs.bsearch (pair);
if (i == -1)
return 0;
if (i == -1) return 0;
return pairs[i].get_kerning ();
}
......@@ -78,7 +77,8 @@ struct KernSubTableFormat0
protected:
KernSubTableHeader header;
BinSearchArrayOf<KernPair> pairs; /* Array of kerning pairs. */
BinSearchArrayOf<KernPair, typename KernSubTableHeader::Types::HBUINT>
pairs; /* Array of kerning pairs. */
public:
DEFINE_SIZE_ARRAY (KernSubTableHeader::static_size + 8, pairs);
};
......@@ -543,6 +543,8 @@ struct KernOT : KernTable<KernOT>
struct SubTableHeader
{
typedef AAT::MortTypes Types;
enum Coverage
{
Direction = 0x01u,
......@@ -586,6 +588,8 @@ struct KernAAT : KernTable<KernAAT>
struct SubTableHeader
{
typedef AAT::MortTypes Types;
enum Coverage
{
Direction = 0x80u,
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册