{
  "$schema": "http://json-schema.org/draft-07/schema#",
  "title": "Maple Mono Build Configuration Schema",
  "description": "Schema for the build configuration of Maple Mono",
  "type": "object",
  "definitions": {
    "freeze_options": {
      "type": "string",
      "enum": [
        "ignore",
        "disable",
        "enable"
      ],
      "enumDescriptions": [
        "Do nothing",
        "Remove the features from font file",
        "Enable the features as default ligatures"
      ]
    }
  },
  "properties": {
    "pool_size": {
      "type": "number",
      "description": "The number of parallel tasks. Default is 4. When run in codespace, this will be 1",
      "default": 4
    },
    "family_name": {
      "type": "string",
      "description": "The font family name",
      "default": "Maple Mono"
    },
    "use_hinted": {
      "type": "boolean",
      "description": "Whether to use hinted TTF as base font",
      "default": true
    },
    "ligature": {
      "type": "boolean",
      "description": "Whether to enable ligature.\nIf set to false, all the ligatures will be removed and 'ssXX' options in 'feature_freeze' will no longer effect",
      "default": true
    },
    "feature_freeze": {
      "type": "object",
      "description": "Freeze some font features (No effect on Variable font) \n enable: Move ligature rules to `calt`, which will enable the ligatures without setting up `cvXX` / `ssXX` / `zero` in font features config, just as default ligatures \n disable: Remove the ligature rules in `cvXX` / `ssXX` / `zero`, which will no longer effect, even if you enable it manually \n ignore: Do nothing",
      "properties": {
        "cv01": {
          "description": "Classic '@', '$', '%', '&', 'Q', '=>', '->'",
          "$ref": "#/definitions/freeze_options"
        },
        "cv02": {
          "description": "Alternative 'a' (with top alarm)",
          "$ref": "#/definitions/freeze_options"
        },
        "cv03": {
          "description": "Alternative regular 'i' (without bottom left bar)",
          "$ref": "#/definitions/freeze_options"
        },
        "cv04": {
          "description": "Alternative 'l' (with bottom left bar) and '1' (without bottom bar), will be overrided by cv35 in italic style",
          "$ref": "#/definitions/freeze_options"
        },
        "cv31": {
          "description": "[Italic Only] Alternative 'a' (with top alarm)",
          "$ref": "#/definitions/freeze_options"
        },
        "cv32": {
          "description": "[Italic Only] Alternative 'f' (without bottom tail)",
          "$ref": "#/definitions/freeze_options"
        },
        "cv33": {
          "description": "[Italic Only] Alternative 'i' (with bottom left bar) and 'j'",
          "$ref": "#/definitions/freeze_options"
        },
        "cv34": {
          "description": "[Italic Only] Alternative 'k' (without center circle)",
          "$ref": "#/definitions/freeze_options"
        },
        "cv35": {
          "description": "[Italic Only] Alternative 'l' (without center tail)",
          "$ref": "#/definitions/freeze_options"
        },
        "cv36": {
          "description": "[Italic Only] Alternative 'x' (without top and bottom tails)",
          "$ref": "#/definitions/freeze_options"
        },
        "cv98": {
          "description": "[CN Only] Full width '…'(ellipsis) and '—'(emdash)",
          "$ref": "#/definitions/freeze_options"
        },
        "cv99": {
          "description": "[CN Only] Traditional punctuations",
          "$ref": "#/definitions/freeze_options"
        },
        "ss01": {
          "description": "Broken equals ligatures (==, ===, !=, !==, =/=)",
          "$ref": "#/definitions/freeze_options"
        },
        "ss02": {
          "description": "Broken compare and equal ligatures (<=, >=)",
          "$ref": "#/definitions/freeze_options"
        },
        "ss03": {
          "description": "Enable arbitrary tag (allow to use any case letters in all tags)",
          "$ref": "#/definitions/freeze_options"
        },
        "ss04": {
          "description": "Break multiple underscores (__, #__)",
          "$ref": "#/definitions/freeze_options"
        },
        "ss05": {
          "description": "Restore the thickness of backslash in escape letters (\\\\, \\', \\[, ...)",
          "$ref": "#/definitions/freeze_options"
        },
        "ss06": {
          "description": "[Italic Only] Break connected strokes between italic letters (al, ul, il ...)",
          "$ref": "#/definitions/freeze_options"
        },
        "ss07": {
          "description": "Relax the conditions for enabling multiple greater ligatures (>>, >>>)",
          "$ref": "#/definitions/freeze_options"
        },
        "ss08": {
          "description": "Enable double headed arrows and reverse arrows (>>=, -<<, ->>, >- ...)",
          "$ref": "#/definitions/freeze_options"
        },
        "zero": {
          "description": "Dot style '0'",
          "$ref": "#/definitions/freeze_options"
        }
      }
    },
    "github_mirror": {
      "type": "string",
      "description": "Github mirror config, will download from https://{github_mirror}/<user>/<repo>/releases/download/<tag>/<file>",
      "default": "github.com"
    },
    "nerd_font": {
      "type": "object",
      "description": "Config for Nerd-Font",
      "properties": {
        "enable": {
          "type": "boolean",
          "description": "Whether to enable Nerd-Font",
          "default": true
        },
        "version": {
          "type": "string",
          "description": "Target version of Nerd-Font. If font-patcher not exists when need to use it or there is no prebuild font for current version, will download from Github",
          "default": "3.2.1"
        },
        "mono": {
          "type": "boolean",
          "description": "Whether to make icon width fixed",
          "default": false
        },
        "font_forge_bin":{
          "type": "string",
          "description": "Font Forge bin path. Default: \n Windows: C:/Program Files (x86)/FontForgeBuilds/bin/fontforge.exe \n MacOS: /Applications/FontForge.app/Contents/Resources/opt/local/bin/fontforge\" \n Linux: /usr/bin/fontforge"
        },
        "use_font_patcher": {
          "type": "boolean",
          "description": "Prefer to use Font Patcher instead of using prebuilt NerdFont base font. If you want to custom build Nerd-Font using font-patcher, you need to set this to True",
          "default": false
        },
        "glyphs": {
          "type": "array",
          "items": {
            "type": "string"
          },
          "default": [
            "--complete"
          ],
          "description": "Symbol Fonts settings. if is not [\"--complete\"], will use font-patcher to generate fonts. Full args: https://github.com/ryanoasis/nerd-fonts?tab=readme-ov-file#font-patcher"
        },
        "extra_args": {
          "type": "array",
          "items": {
            "type": "string"
          },
          "default": [],
          "description": "Extra arguments for font-patcher, default args: [\"-l\", \"--careful\", \"--outputdir\", output_nf], if \"mono\" is set to true, \"--mono\" will be added, full args: https://github.com/ryanoasis/nerd-fonts?tab=readme-ov-file#font-patcher"
        }
      },
      "required": [
        "enable",
        "version",
        "mono",
        "use_font_patcher",
        "glyphs",
        "extra_args"
      ]
    },
    "cn": {
      "type": "object",
      "description": "Config for Chinese font",
      "properties": {
        "enable": {
          "type": "boolean",
          "description": "Whether to build Chinese fonts. Skip if Chinese base fonts are not founded",
          "default": true
        },
        "with_nerd_font": {
          "type": "boolean",
          "description": "Whether to patch Nerd-Font",
          "default": true
        },
        "fix_meta_table": {
          "type": "boolean",
          "description": "Fix design language and supported languages in META table",
          "default": true
        },
        "clean_cache": {
          "type": "boolean",
          "description": "Whether to clean instantiated base CN fonts",
          "default": false
        },
        "narrow": {
          "type": "boolean",
          "description": "[Experimental] Whether to narrow CN characters. THIS WILL BREAK THE 2:1 METRIC\nOnly supported in VSCode currently",
          "default": false
        },
        "use_hinted": {
          "type": "boolean",
          "description": "whether to hint CN font (will increase about 33% size)",
          "default": false
        },
        "use_static_base_font": {
          "type": "boolean",
          "description": "whether to use large pre-instantiated static CN font as base font (instantiate will cost 40-50 minutes)",
          "default": true
        }
      },
      "required": [
        "enable",
        "with_nerd_font",
        "fix_meta_table",
        "clean_cache",
        "narrow",
        "use_hinted",
        "use_static_base_font"
      ]
    }
  },
  "required": [
    "family_name",
    "use_hinted",
    "ligature",
    "nerd_font",
    "cn"
  ]
}