[HarfBuzz] harfbuzz: Branch 'master'
Behdad Esfahbod
behdad at kemper.freedesktop.org
Mon Nov 6 20:40:30 UTC 2017
src/hb-ot-kern-table.hh | 8 +++++++-
1 file changed, 7 insertions(+), 1 deletion(-)
New commits:
commit a6150306838b168475a9aa661ad569b0405c9f91
Author: Behdad Esfahbod <behdad at behdad.org>
Date: Mon Nov 6 15:40:07 2017 -0500
[kern] Implement format-2 kern subtable
diff --git a/src/hb-ot-kern-table.hh b/src/hb-ot-kern-table.hh
index d074355d..074eba32 100644
--- a/src/hb-ot-kern-table.hh
+++ b/src/hb-ot-kern-table.hh
@@ -116,7 +116,13 @@ struct KernSubTableFormat2
{
unsigned int l = (this+leftClassTable).get_class (left);
unsigned int r = (this+leftClassTable).get_class (left);
- return 0;//(&(this+array))[0/*XXX*/];
+ unsigned int offset = l * rowWidth + r * sizeof (FWORD);
+ const FWORD *v = &StructAtOffset<FWORD> (&(this+array), offset);
+ /* Untested code, as I have not been able to find ANY kern table format-2 yet. */
+ assert (&(this+array) <= v);
+ if (unlikely (v + 1 > (const FWORD *) end))
+ return 0;
+ return *v;
}
inline bool sanitize (hb_sanitize_context_t *c) const
More information about the HarfBuzz
mailing list