From 767ede1f784e8febb249350570cb2ef29d7e25cd Mon Sep 17 00:00:00 2001 From: Skef Iterum Date: Mon, 20 Jan 2025 14:26:48 -0800 Subject: [PATCH] Remove bad GDEF duplicate error message case work around apparent xcode compiler problem bump addfeatures version --- c/addfeatures/hotconv/FeatCtx.cpp | 5 +++++ c/addfeatures/hotconv/GDEF.cpp | 3 ++- c/addfeatures/main.cpp | 8 +------- tests/addfeatures_test.py | 3 ++- 4 files changed, 10 insertions(+), 9 deletions(-) diff --git a/c/addfeatures/hotconv/FeatCtx.cpp b/c/addfeatures/hotconv/FeatCtx.cpp index e289e7ef1..c2362f486 100644 --- a/c/addfeatures/hotconv/FeatCtx.cpp +++ b/c/addfeatures/hotconv/FeatCtx.cpp @@ -1096,6 +1096,11 @@ void FeatCtx::setLkpFlag(uint16_t flag) { void FeatCtx::callLkp(State &st) { Label lab = st.label; + if (st.tbl != GSUB_ && st.tbl != GPOS_) { + featMsg(sWARNING, "Internal: Bad table %d seen callLkp, ignoring."); + return; + } + #if HOT_DEBUG if (g->font.debug & HOT_DB_FEAT_2) { if (curr.tbl == GSUB_) { diff --git a/c/addfeatures/hotconv/GDEF.cpp b/c/addfeatures/hotconv/GDEF.cpp index 7688258b9..d44d5cbc0 100644 --- a/c/addfeatures/hotconv/GDEF.cpp +++ b/c/addfeatures/hotconv/GDEF.cpp @@ -131,7 +131,8 @@ void GDEF::GlyphClassTable::set(GPat::ClassRec &simple, GPat::ClassRec &ligature auto [seeni, b] = seen.emplace(gid, i); if (!b) { // Don't complain if overriding mark class - if (seeni->second != 0) { + // or duplicate is part of same class + if (seeni->second != 0 && seeni->second != i) { hadConflictingClassDef = true; if (h.g->convertFlags & HOT_VERBOSE) { h.g->ctx.feat->dumpGlyph(gid, 0, 0); diff --git a/c/addfeatures/main.cpp b/c/addfeatures/main.cpp index 742570c35..2053b9278 100644 --- a/c/addfeatures/main.cpp +++ b/c/addfeatures/main.cpp @@ -24,13 +24,7 @@ #include "sfile.h" #include "smem.h" -#define ADDFEATURES_VERSION "2.6.0" -/* Warning: this string is now part of heuristic used by CoolType to identify the - first round of CoolType fonts which had the backtrack sequence of a chaining - contextual substitution ordered incorrectly. Fonts with the old ordering MUST match - the regex: - "(Version|OTF) 1.+;Core 1\.0\..+;addfeatureslib1\." - inside the (1,0,0) nameID 5 "Version: string. */ +#define ADDFEATURES_VERSION "3.0.0" static char *progname; /* Program name */ static cbCtx cbctx; /* Client callback context */ diff --git a/tests/addfeatures_test.py b/tests/addfeatures_test.py index addcca332..518a07858 100644 --- a/tests/addfeatures_test.py +++ b/tests/addfeatures_test.py @@ -769,4 +769,5 @@ def test_heap_after_free_bug1349(): runner(cmd) output_dump = generate_ttx_dump(output_filename, ['name']) assert differ([output_dump, get_expected_path("bug1349.ttx"), - '-s', '