subframe7536/maple-font · error · Exception

tag with suffix `:` must be in {built_in_tag_text}, but '{te

Error message

tag with suffix `:` must be in {built_in_tag_text}, but '{text}' is not

What it means

tag_suffix_colon() generates ligature substitutions for the 'TEXT:' colon-suffix tag style (e.g. 'TODO:' becoming a colored tag glyph). To keep the tag set finite, text must be one of the built-in tag names defined in built_in_tag_text (trace, debug, info, warn, error, fatal, todo, fixme, note, hack, mark, eror, warning); anything else raises Exception. Input is lowercased before the check, so case doesn't matter.

Source

Thrown at source/py/feature/calt/tag.py:229

        lookup_name = f"custom_tag_{'_'.join(desc)}"

        result.append(
            ast.Lookup(
                name=lookup_name,
                desc=source,
                content=subst_list,
            )
        )

    return result


def tag_suffix_colon(text_list: list[str]):
    result = []
    for text in text_list:
        text = text.lower()
        if text not in built_in_tag_text:
            raise Exception(
                f"tag with suffix `:` must be in {built_in_tag_text}, but '{text}' is not"
            )

        result.append(
            ast.subst_liga(
                source=f"{text.upper()}:",
                target=f"tag_{text}.liga",
                lookup_name=f"{text}_colon",
            )
        )
    return result


def get_lookup(cls_var: ast.Clazz):
    # Dict to map letter and class.
    # Only letter that has uppercase variant will be added.
    # {"q": ast.Clazz("BgQ", ["Q", "Q.cv01"])}
    bg_cls_dict = {}

View on GitHub (pinned to c08fda97fe)

Solutions

  1. Use one of the built-in names: trace, debug, info, warn, error, fatal, todo, fixme, note, hack, mark, eror, warning.
  2. Fix typos in your configured tag names (they are matched after lowercasing).
  3. Use the [NAME] bracket style via tag_upper() instead, which silently skips unknown names — or better, only pass supported names there too.
  4. Add your name to built_in_tag_text in source/py/feature/calt/tag.py:4 if you maintain a font build fork.

Example fix

// before
tag_suffix_colon(['perf'])
// after
tag_suffix_colon(['note'])  # or another built-in tag name
Defensive patterns

Strategy: validation

Validate before calling

from source.py.feature.calt.tag import built_in_tag_text

def filter_built_in_tags(names):
    invalid = [n for n in names if n.lower() not in built_in_tag_text]
    if invalid:
        raise ValueError(f'colon-suffix tags must be in {built_in_tag_text}, got {invalid}')
    return names

tag_suffix_colon(filter_built_in_tags(my_tags))

Type guard

def is_built_in_tag(name: str) -> bool:
    return name.lower() in built_in_tag_text

Try / catch

try:
    result = tag_suffix_colon(text_list)
except Exception as e:
    if 'tag with suffix' in str(e):
        allowed = [t for t in text_list if is_built_in_tag(t)]
        result = tag_suffix_colon(allowed) if allowed else []
    else:
        raise

Prevention

When it happens

Trigger: Calling tag_suffix_colon(['perf']) or including 'perf:' in the colon-suffix tag config where 'perf' is not in built_in_tag_text.

Common situations: Configuring custom log-level tags like 'debug2' or domain tags like 'security' in editor/font config expecting any name to work; typos of built-in names; expecting parity with tag_upper-style custom lists.

Related errors


AI-assisted analysis of subframe7536/maple-font@c08fda97fe (2026-08-28). Data as JSON: /api/errors/9bbe357f1caea151. Report an issue: GitHub.