{
  "$schema": "https://json-schema.org/draft/2020-12/schema",
  "$id": "https://artifacts.apis.io/yukkurigen-com/json-schema/yukkurigen-com-template-style-schema.json",
  "title": "TemplateStyle",
  "description": "テンプレートの見た目（描かれている値）。描き手は元の組み込みで決まる: yukkuri-talk / tohoku-ahiru-talk を元にしたものはその組み込み、それ以外（白紙・ほかの組み込みの複製）は UserTemplate。unsupported はそのテンプレートでは描かれない項目",
  "x-generated": "2026-11-29",
  "x-method": "derived",
  "x-generator": "derive-json-schema.py",
  "x-source": "openapi/yukkurigen-com-openapi.json#/components/schemas/TemplateStyle",
  "type": "object",
  "properties": {
    "subtitle": {
      "type": "object",
      "properties": {
        "look": {
          "type": [
            "string",
            "null"
          ],
          "enum": [
            "bold",
            "box",
            "box-outline",
            "box-speaker-outline",
            "frame"
          ],
          "description": "行の字幕の描き方の既定。null はプロジェクトの既定（AI で作った動画は bold）。UserTemplate では常に null（書式をそのまま描く）"
        },
        "fontSize": {
          "type": "integer",
          "description": "基本の文字サイズ（px、横長 1920 幅で）。render_mp4 / プロジェクトの fontSize があればそちらが勝つ"
        },
        "color": {
          "type": "string",
          "description": "#rrggbb・#rrggbbaa・rgb(r,g,b)・rgba(r,g,b,a)"
        },
        "fontWeight": {
          "type": "integer"
        },
        "outlineColor": {
          "type": "string",
          "description": "#rrggbb・#rrggbbaa・rgb(r,g,b)・rgba(r,g,b,a)"
        },
        "outlineWidth": {
          "type": "number"
        },
        "backgroundColor": {
          "type": [
            "string",
            "null"
          ],
          "description": "箱の色。null は話者の色の半透明"
        },
        "backgroundPadding": {
          "type": "number"
        },
        "backgroundBorderRadius": {
          "type": "number"
        },
        "textAlign": {
          "type": "string",
          "enum": [
            "left",
            "center",
            "right"
          ]
        },
        "letterSpacing": {
          "type": "number"
        },
        "lineHeight": {
          "type": "number"
        },
        "shadowColor": {
          "type": "string",
          "description": "UserTemplate のみ"
        },
        "shadowBlur": {
          "type": "number",
          "description": "UserTemplate のみ"
        },
        "animation": {
          "type": "string",
          "description": "UserTemplate のみ"
        },
        "fontFamily": {
          "type": [
            "string",
            "null"
          ],
          "enum": [
            "noto-sans-jp",
            "m-plus-rounded-1c",
            "zen-maru-gothic",
            "kosugi-maru",
            "mochiy-pop-one",
            "hachi-maru-pop",
            "dela-gothic-one",
            "rocknroll-one",
            "m-plus-1p",
            "zen-kaku-gothic-new",
            "noto-serif-jp"
          ],
          "description": "tohoku-ahiru-talk を元にしたものだけ。字幕の書体（Google Fonts。台詞の箱・心の声の箱にも効く）。noto-sans-jp=角ゴシック（源ノ角ゴシックと同じ書体。900 が Black/Heavy）/ m-plus-rounded-1c=丸ゴシック（800 が ExtraBold）/ zen-maru-gothic=やわらかい丸ゴシック / kosugi-maru・mochiy-pop-one・hachi-maru-pop・dela-gothic-one・rocknroll-one は太さ1つ / m-plus-1p・zen-kaku-gothic-new=角ゴシック / noto-serif-jp=明朝体。太さは書体が持つ太さのうち一番近いもので描く。書いたときだけ返る"
        },
        "strokes": {
          "type": [
            "array",
            "null"
          ],
          "minItems": 1,
          "maxItems": 3,
          "items": {
            "type": "object",
            "required": [
              "color",
              "width"
            ],
            "additionalProperties": false,
            "properties": {
              "color": {
                "type": "string",
                "description": "色、または \"speaker\"（話している人の色）"
              },
              "width": {
                "type": "number",
                "minimum": 0,
                "maximum": 30,
                "description": "見えるフチの太さ（px、横長 1920 幅で）"
              }
            }
          },
          "description": "tohoku-ahiru-talk を元にしたものだけ。袋文字。内側から順に {color, width}（width は見えるフチの太さ px）。書くと outlineColor・outlineWidth・描き方（look）のフチの代わりになる。bold でも効く（frame では効かない）"
        },
        "textShadow": {
          "type": [
            "object",
            "null"
          ],
          "required": [
            "color"
          ],
          "additionalProperties": false,
          "properties": {
            "color": {
              "type": "string"
            },
            "blur": {
              "type": "number",
              "minimum": 0,
              "maximum": 40
            },
            "offsetX": {
              "type": "number",
              "minimum": -40,
              "maximum": 40
            },
            "offsetY": {
              "type": "number",
              "minimum": -40,
              "maximum": 40
            }
          },
          "description": "tohoku-ahiru-talk を元にしたものだけ。文字の影（ぼかし・ずらし px。フチの外側ごと落とす）。書くと描き方の既定の影の代わりになる"
        },
        "boxSize": {
          "type": "string",
          "enum": [
            "fit",
            "fixed"
          ],
          "description": "tohoku-ahiru-talk を元にしたものだけ。fixed で箱を字幕の枠（update_template_layout の subtitle）いっぱいに敷く。fit は文字に合わせて伸び縮み（既定）"
        },
        "backgroundPaddingSides": {
          "type": [
            "object",
            "null"
          ],
          "additionalProperties": false,
          "properties": {
            "top": {
              "type": "number",
              "minimum": 0,
              "maximum": 200
            },
            "right": {
              "type": "number",
              "minimum": 0,
              "maximum": 200
            },
            "bottom": {
              "type": "number",
              "minimum": 0,
              "maximum": 200
            },
            "left": {
              "type": "number",
              "minimum": 0,
              "maximum": 200
            }
          },
          "description": "tohoku-ahiru-talk を元にしたものだけ。箱の内側の余白を上下左右で（px。書かない辺は backgroundPadding）"
        },
        "boxBorderWidth": {
          "type": [
            "number",
            "null"
          ],
          "description": "tohoku-ahiru-talk を元にしたものだけ。箱の線の太さ（px。0 で消す。書いていなければ既定の細い白30%の線）"
        },
        "boxBorderColor": {
          "type": [
            "string",
            "null"
          ],
          "description": "tohoku-ahiru-talk を元にしたものだけ。箱の線の色"
        },
        "speakerStyles": {
          "type": "object",
          "additionalProperties": {
            "type": [
              "object",
              "null"
            ],
            "additionalProperties": false,
            "properties": {
              "color": {
                "type": "string"
              },
              "backgroundColor": {
                "type": "string"
              },
              "strokes": {
                "type": "array",
                "minItems": 1,
                "maxItems": 3,
                "items": {
                  "type": "object",
                  "required": [
                    "color",
                    "width"
                  ],
                  "additionalProperties": false,
                  "properties": {
                    "color": {
                      "type": "string",
                      "description": "色、または \"speaker\"（話している人の色）"
                    },
                    "width": {
                      "type": "number",
                      "minimum": 0,
                      "maximum": 30,
                      "description": "見えるフチの太さ（px、横長 1920 幅で）"
                    }
                  }
                }
              }
            }
          },
          "description": "tohoku-ahiru-talk を元にしたものだけ。話者ごとの字幕（ナレーションの枠）の書式。キャラ id → {color?, backgroundColor?, strokes?}。立ち絵が出ていない話者の行にも効く"
        },
        "speakerName": {
          "type": "string",
          "enum": [
            "none",
            "inline",
            "above",
            "badge"
          ]
        }
      }
    },
    "characters": {
      "type": "array",
      "items": {
        "type": "object",
        "properties": {
          "slot": {
            "type": "string"
          },
          "label": {
            "type": "string"
          },
          "character": {
            "type": "string"
          },
          "flip": {
            "type": "boolean",
            "description": "左右反転（yukkuri-talk 系には無い）"
          },
          "voiceOnly": {
            "type": "boolean"
          }
        },
        "required": [
          "slot",
          "voiceOnly"
        ]
      }
    },
    "camera": {
      "type": "object",
      "description": "yukkuri-talk 系には無い（寄りは固定）",
      "properties": {
        "zoomScale": {
          "type": "number"
        },
        "backgroundBlurOnZoom": {
          "type": "boolean"
        }
      }
    },
    "bgm": {
      "type": "object",
      "properties": {
        "volume": {
          "type": "number",
          "description": "0〜1（0.3 が標準）"
        },
        "ducking": {
          "type": "boolean",
          "description": "話している間だけ BGM を下げるか（既定 false）"
        }
      }
    },
    "background": {
      "type": "object",
      "properties": {
        "imageUrl": {
          "type": [
            "string",
            "null"
          ]
        },
        "videoUrl": {
          "type": [
            "string",
            "null"
          ]
        },
        "color": {
          "type": "string",
          "description": "UserTemplate のみ"
        }
      }
    },
    "unsupported": {
      "type": "array",
      "items": {
        "type": "string"
      },
      "description": "このテンプレートでは描かれない項目（PATCH に渡すと 400 unsupported_field）"
    }
  },
  "required": [
    "subtitle",
    "characters",
    "bgm",
    "background",
    "unsupported"
  ]
}