{"record":{"id":"7d3dec9226c8c932","repo":"subframe7536/maple-font","slug":"cannot-build-both-mono-and-propo-glyphs-versio","errorCode":null,"errorMessage":"Cannot build both `mono` and `propo` glyphs versions simultaneously.","messagePattern":"Cannot build both `mono` and `propo` glyphs versions simultaneously\\.","errorType":"validation","errorClass":"ValueError","httpStatus":null,"severity":"error","filePath":"source/py/task/nerdfont.py","lineNumber":109,"sourceCode":"    _nf_args = [\n        font_forge_bin,\n        \"FontPatcher/font-patcher\",\n        \"-l\",\n        \"-c\",\n        \"--careful\",\n    ]\n    if mono:\n        _nf_args += [\"--mono\"]\n    elif propo:\n        _nf_args += [\"--variable-width-glyphs\"]\n\n    return _nf_args\n\n\ndef get_font_suffix(mono: bool, propo: bool) -> str:\n    \"\"\"Determine the suffix for the font name and file path.\"\"\"\n    if mono and propo:\n        raise ValueError(\n            \"Cannot build both `mono` and `propo` glyphs versions simultaneously.\"\n        )\n    if mono:\n        return \"Mono\"\n    elif propo:\n        return \"Propo\"\n    return \"\"\n\n\ndef build_nf(mono: bool, propo: bool = False):\n    suffix = get_font_suffix(mono, propo)\n    nf_args = get_nerd_font_patcher_args(mono, propo)\n\n    nf_file_name = \"NerdFont\" + suffix\n    style_name = \"Regular\"\n\n    run(nf_args + [base_font_path])\n    _path = f\"{family_name.replace(' ', '')}{nf_file_name}-{style_name}.ttf\"","sourceCodeStart":91,"sourceCodeEnd":127,"githubUrl":"https://github.com/subframe7536/maple-font/blob/c08fda97fef73d68c1755219852150770f6e6578/source/py/task/nerdfont.py#L91-L127","documentation":"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.","triggerScenarios":"Invoking build_nf/subset (or the CLI) with both --mono and --propo flags set (or mono=true and propo=true in build options).","commonSituations":"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.","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."],"exampleFix":"# before\nbuild_nf(mono=True, propo=True)\n\n# after\nbuild_nf(mono=True, propo=False)\nbuild_nf(mono=False, propo=True)","handlingStrategy":"validation","validationCode":"assert not (mono and propo), \"choose either mono or propo per build; run separate builds for both\"","typeGuard":"def is_valid_nf_mode(mono: bool, propo: bool) -> bool:\n    return not (mono and propo)","tryCatchPattern":"try:\n    build_nf(mono=mono, propo=propo)\nexcept ValueError as e:\n    if \"mono\" in str(e) and \"propo\" in str(e):\n        build_nf(mono=True, propo=False)\n        build_nf(mono=False, propo=True)\n    else:\n        raise","preventionTips":["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."],"tags":["python","cli","validation","nerd-fonts"],"backgroundTag":"conflicting-build-options","analyzedSha":"c08fda97fef73d68c1755219852150770f6e6578","analyzedAt":"2026-08-28T22:07:29.503Z","schemaVersion":2},"datasetVersion":"2026-08-29T02:17:18.158Z"}