{
  "$defs": {
    "FigureAlignment": {
      "description": "Figure alignment.",
      "enum": [
        "proportional",
        "tabular"
      ],
      "type": "string"
    },
    "FigureStyle": {
      "description": "Figure style.",
      "enum": [
        "lining",
        "oldstyle"
      ],
      "type": "string"
    },
    "FontLicense": {
      "description": "Font license type.",
      "enum": [
        "ofl",
        "apache2",
        "commercial",
        "proprietary"
      ],
      "type": "string"
    },
    "FontSource": {
      "description": "Font source.",
      "enum": [
        "google-fonts",
        "adobe-fonts",
        "custom",
        "system",
        "self-hosted"
      ],
      "type": "string"
    },
    "NumericTypography": {
      "description": "Numeric typography settings.",
      "properties": {
        "figure_alignment": {
          "anyOf": [
            {
              "$ref": "#/$defs/FigureAlignment"
            },
            {
              "type": "null"
            }
          ]
        },
        "figure_style": {
          "anyOf": [
            {
              "$ref": "#/$defs/FigureStyle"
            },
            {
              "type": "null"
            }
          ]
        }
      },
      "type": "object"
    },
    "PathRef": {
      "description": "Path-based cross-reference relative to .corpospec/ root.\nPattern: `^[a-z0-9_-]+(/[a-z0-9_.-]+)+$`",
      "pattern": "^[a-z0-9_-]+(/[a-z0-9_.-]+)+$",
      "type": "string"
    },
    "ScriptCoverage": {
      "description": "Script coverage entry for internationalization.",
      "properties": {
        "fallback": {
          "type": [
            "string",
            "null"
          ]
        },
        "rtl": {
          "type": [
            "boolean",
            "null"
          ]
        },
        "script": {
          "type": "string"
        },
        "typeface": {
          "type": "string"
        }
      },
      "required": [
        "script",
        "typeface"
      ],
      "type": "object"
    },
    "TextAlignment": {
      "description": "Text alignment.",
      "enum": [
        "left",
        "center",
        "right",
        "justify"
      ],
      "type": "string"
    },
    "TextTransform": {
      "description": "Text transform type.",
      "enum": [
        "none",
        "uppercase",
        "lowercase",
        "capitalize"
      ],
      "type": "string"
    },
    "TypeFamily": {
      "description": "Type family definition.",
      "properties": {
        "fallback_stack": {
          "default": [],
          "items": {
            "type": "string"
          },
          "type": "array"
        },
        "file_refs": {
          "default": [],
          "items": {
            "type": "string"
          },
          "type": "array"
        },
        "license": {
          "$ref": "#/$defs/FontLicense"
        },
        "name": {
          "type": "string"
        },
        "roles": {
          "items": {
            "$ref": "#/$defs/TypeRole"
          },
          "type": "array"
        },
        "source": {
          "$ref": "#/$defs/FontSource"
        },
        "variable_font": {
          "type": [
            "boolean",
            "null"
          ]
        }
      },
      "required": [
        "name",
        "source",
        "license",
        "roles"
      ],
      "type": "object"
    },
    "TypeRole": {
      "description": "Typeface role.",
      "enum": [
        "display",
        "body",
        "ui",
        "mono",
        "hand"
      ],
      "type": "string"
    },
    "TypeScaleToken": {
      "description": "Type scale token. Includes size_rem as Option<f64> (D2).",
      "properties": {
        "letter_spacing_em": {
          "format": "double",
          "type": [
            "number",
            "null"
          ]
        },
        "line_height": {
          "format": "double",
          "type": [
            "number",
            "null"
          ]
        },
        "name": {
          "type": "string"
        },
        "size_px": {
          "format": "double",
          "type": "number"
        },
        "size_rem": {
          "format": "double",
          "type": [
            "number",
            "null"
          ]
        },
        "transform": {
          "anyOf": [
            {
              "$ref": "#/$defs/TextTransform"
            },
            {
              "type": "null"
            }
          ]
        },
        "weight": {
          "format": "int64",
          "type": [
            "integer",
            "null"
          ]
        }
      },
      "required": [
        "name",
        "size_px"
      ],
      "type": "object"
    },
    "TypographicRules": {
      "description": "Typographic rules and constraints.",
      "properties": {
        "alignment": {
          "anyOf": [
            {
              "$ref": "#/$defs/TextAlignment"
            },
            {
              "type": "null"
            }
          ]
        },
        "capitalization_rules": {
          "default": [],
          "items": {
            "type": "string"
          },
          "type": "array"
        },
        "hyphenation": {
          "type": [
            "boolean",
            "null"
          ]
        },
        "max_line_length_ch": {
          "format": "int64",
          "type": [
            "integer",
            "null"
          ]
        }
      },
      "type": "object"
    },
    "WeightRule": {
      "description": "Weight rule for approved usage contexts.",
      "properties": {
        "approved_contexts": {
          "default": [],
          "items": {
            "type": "string"
          },
          "type": "array"
        },
        "prohibited_contexts": {
          "default": [],
          "items": {
            "type": "string"
          },
          "type": "array"
        },
        "weight_name": {
          "type": "string"
        },
        "weight_value": {
          "format": "int64",
          "type": "integer"
        }
      },
      "required": [
        "weight_value",
        "weight_name"
      ],
      "type": "object"
    }
  },
  "$id": "https://corpospec.com/schemas/v0.7.1/brand-typography.schema.json",
  "$schema": "https://json-schema.org/draft/2020-12/schema",
  "additionalProperties": false,
  "description": "Brand typography system.",
  "properties": {
    "families": {
      "items": {
        "$ref": "#/$defs/TypeFamily"
      },
      "type": "array"
    },
    "id": {
      "$ref": "#/$defs/PathRef"
    },
    "numeric_typography": {
      "anyOf": [
        {
          "$ref": "#/$defs/NumericTypography"
        },
        {
          "type": "null"
        }
      ]
    },
    "script_coverage": {
      "default": [],
      "items": {
        "$ref": "#/$defs/ScriptCoverage"
      },
      "type": "array"
    },
    "type_scale": {
      "default": [],
      "items": {
        "$ref": "#/$defs/TypeScaleToken"
      },
      "type": "array"
    },
    "typographic_rules": {
      "anyOf": [
        {
          "$ref": "#/$defs/TypographicRules"
        },
        {
          "type": "null"
        }
      ]
    },
    "weight_rules": {
      "default": [],
      "items": {
        "$ref": "#/$defs/WeightRule"
      },
      "type": "array"
    }
  },
  "required": [
    "id",
    "families"
  ],
  "title": "BrandTypography",
  "type": "object"
}