+static int
+try_otf (int depth, MFLTOtfSpec *otf_spec, int from, int to,
+ FontLayoutContext *ctx)
+{
+ MFLTFont *font = ctx->font;
+
+ if (MDEBUG_FLAG () > 2)
+ MDEBUG_PRINT3 ("\n [FLT] %*s%s", depth, "", MSYMBOL_NAME (otf_spec->sym));
+
+ if (! otf_spec->features[0] && ! otf_spec->features[1])
+ {
+ /* Reset categories. */
+ MCharTable *table = ctx->category->table;
+ int i;
+
+ for (i = from; i < to; i++)
+ {
+ MFLTGlyph *g = GREF (ctx->in, i);
+
+ if (! GET_COMBINED (g))
+ {
+ char enc = (GET_ENCODED (g)
+ ? (g->c > 0 ? (int) mchartable_lookup (table, g->c)
+ : 1)
+ : g->code
+ ? (int) mchartable_lookup (table, g->code)
+ : ' ');
+ SET_CATEGORY_CODE (g, enc);
+ ctx->encoded[i - ctx->encoded_offset] = enc;
+ }
+ }
+ return from;
+ }
+
+ if (ctx->stage->category->feature_table.size == 0)
+ return from;
+
+ font->get_glyph_id (font, ctx->in, from, to);
+ if (mflt_try_otf)
+ {
+ to = mflt_try_otf (font, otf_spec, ctx->in, from, to);
+ if (to < 0)
+ return from;
+ decode_packed_otf_tag (ctx, ctx->in, from, to, ctx->stage->category);
+ }
+ return from;
+}
+