Skip to content

Commit

Permalink
Remove bad GDEF duplicate error message case
Browse files Browse the repository at this point in the history
work around apparent xcode compiler problem
bump addfeatures version
  • Loading branch information
skef committed Jan 20, 2025
1 parent f24c7f9 commit 767ede1
Show file tree
Hide file tree
Showing 4 changed files with 10 additions and 9 deletions.
5 changes: 5 additions & 0 deletions c/addfeatures/hotconv/FeatCtx.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -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_) {
Expand Down
3 changes: 2 additions & 1 deletion c/addfeatures/hotconv/GDEF.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -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);
Expand Down
8 changes: 1 addition & 7 deletions c/addfeatures/main.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -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 */
Expand Down
3 changes: 2 additions & 1 deletion tests/addfeatures_test.py
Original file line number Diff line number Diff line change
Expand Up @@ -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', '<ttFont sfntVersion='])
'-s', '<ttFont sfntVersion=',
'-r', r'^\s+Version.*;hotconv.*;addfeatures'])

0 comments on commit 767ede1

Please sign in to comment.