mirror of
https://github.com/harfbuzz/harfbuzz.git
synced 2025-04-15 01:18:13 +00:00
[mort] Some more
This commit is contained in:
parent
3087046d31
commit
cbaff4ef19
1 changed files with 16 additions and 18 deletions
|
@ -45,6 +45,14 @@ namespace AAT {
|
|||
|
||||
using namespace OT;
|
||||
|
||||
template <typename T>
|
||||
static inline unsigned int offsetToIndex (unsigned int offset,
|
||||
const void *base,
|
||||
const T *array)
|
||||
{
|
||||
return (offset - ((const char *) array - (const char *) base)) / sizeof (T);
|
||||
}
|
||||
|
||||
template <typename Types>
|
||||
struct RearrangementSubtable
|
||||
{
|
||||
|
@ -255,11 +263,10 @@ struct ContextualSubtable
|
|||
}
|
||||
else
|
||||
{
|
||||
unsigned int offset = 2 * (entry->data.markIndex + buffer->info[mark].codepoint);
|
||||
replacement = &StructAtOffset<GlyphID> (table, offset);
|
||||
if ((const void *) replacement < (const void *) subs ||
|
||||
!replacement->sanitize (&c->sanitizer) ||
|
||||
!*replacement)
|
||||
unsigned int offset = entry->data.markIndex + buffer->info[mark].codepoint;
|
||||
const UnsizedArrayOf<GlyphID> &subs_old = (const UnsizedArrayOf<GlyphID> &) subs;
|
||||
replacement = &subs_old[offsetToIndex (offset * 2, table, subs_old.arrayZ)];
|
||||
if (!replacement->sanitize (&c->sanitizer) || !*replacement)
|
||||
replacement = nullptr;
|
||||
}
|
||||
if (replacement)
|
||||
|
@ -281,11 +288,10 @@ struct ContextualSubtable
|
|||
}
|
||||
else
|
||||
{
|
||||
unsigned int offset = 2 * (entry->data.currentIndex + buffer->info[idx].codepoint);
|
||||
replacement = &StructAtOffset<GlyphID> (table, offset);
|
||||
if ((const void *) replacement < (const void *) subs ||
|
||||
!replacement->sanitize (&c->sanitizer) ||
|
||||
!*replacement)
|
||||
unsigned int offset = entry->data.currentIndex + buffer->info[idx].codepoint;
|
||||
const UnsizedArrayOf<GlyphID> &subs_old = (const UnsizedArrayOf<GlyphID> &) subs;
|
||||
replacement = &subs_old[offsetToIndex (offset * 2, table, subs_old.arrayZ)];
|
||||
if (!replacement->sanitize (&c->sanitizer) || !*replacement)
|
||||
replacement = nullptr;
|
||||
}
|
||||
if (replacement)
|
||||
|
@ -457,14 +463,6 @@ struct LigatureSubtable
|
|||
ligature (table+table->ligature),
|
||||
match_length (0) {}
|
||||
|
||||
template <typename T>
|
||||
static inline unsigned int offsetToIndex (unsigned int offset,
|
||||
const void *base,
|
||||
const T *array)
|
||||
{
|
||||
return (offset - ((const char *) array - (const char *) base)) / sizeof (T);
|
||||
}
|
||||
|
||||
inline bool is_actionable (StateTableDriver<Types, EntryData> *driver HB_UNUSED,
|
||||
const Entry<EntryData> *entry)
|
||||
{
|
||||
|
|
Loading…
Add table
Reference in a new issue