subframe7536/maple-font · error · ValueError
Cannot build both `mono` and `propo` glyphs versions simulta
Error message
Cannot build both `mono` and `propo` glyphs versions simultaneously.
What it means
get_font_suffix() maps the build mode to a name suffix: mono -> 'Mono', propo -> 'Propo', neither -> ''. The two glyph variants are mutually exclusive in a single build, so passing mono=True and propo=True together raises this ValueError. Called by build_nf and subset.
Source
Thrown at source/py/task/nerdfont.py:109
_nf_args = [
font_forge_bin,
"FontPatcher/font-patcher",
"-l",
"-c",
"--careful",
]
if mono:
_nf_args += ["--mono"]
elif propo:
_nf_args += ["--variable-width-glyphs"]
return _nf_args
def get_font_suffix(mono: bool, propo: bool) -> str:
"""Determine the suffix for the font name and file path."""
if mono and propo:
raise ValueError(
"Cannot build both `mono` and `propo` glyphs versions simultaneously."
)
if mono:
return "Mono"
elif propo:
return "Propo"
return ""
def build_nf(mono: bool, propo: bool = False):
suffix = get_font_suffix(mono, propo)
nf_args = get_nerd_font_patcher_args(mono, propo)
nf_file_name = "NerdFont" + suffix
style_name = "Regular"
run(nf_args + [base_font_path])
_path = f"{family_name.replace(' ', '')}{nf_file_name}-{style_name}.ttf"View on GitHub (pinned to c08fda97fe)
Solutions
- Run two separate builds: one with mono=True (propo=False), one with propo=True (mono=False).
- Remove one of the conflicting flags from the command/config.
- If both variants are needed in a script, call build_nf/subset once per variant instead of once with both.
Example fix
# before build_nf(mono=True, propo=True) # after build_nf(mono=True, propo=False) build_nf(mono=False, propo=True)
Defensive patterns
Strategy: validation
Validate before calling
assert not (mono and propo), "choose either mono or propo per build; run separate builds for both"
Type guard
def is_valid_nf_mode(mono: bool, propo: bool) -> bool:
return not (mono and propo) Try / catch
try:
build_nf(mono=mono, propo=propo)
except ValueError as e:
if "mono" in str(e) and "propo" in str(e):
build_nf(mono=True, propo=False)
build_nf(mono=False, propo=True)
else:
raise Prevention
- Use mutually exclusive CLI flags (argparse add_mutually_exclusive_group) for --mono/--propo.
- When both variants are needed, script two build invocations.
- Assert mode validity at config-load time rather than deep in the build.
When it happens
Trigger: Invoking build_nf/subset (or the CLI) with both --mono and --propo flags set (or mono=true and propo=true in build options).
Common situations: CLI misuse combining flags expecting both outputs; copying a build command and editing it to add propo while leaving mono; scripted builds that default mono=True then append propo=True.
Related errors
- Invalid axe value, range: [{min_value}, {max_value}]
- line_height object must contain 'ascender' and 'descender' f
- Invalid class_list, must ends with [@Var, @HexLetter]
- id should > 0 and < 100 in Character Variants, current is {i
- id should > 0 and < 20 in Stylistic Sets, current is {id}
AI-assisted analysis of subframe7536/maple-font@c08fda97fe (2026-08-28).
Data as JSON: /api/errors/7d3dec9226c8c932.
Report an issue: GitHub.