From bb478a48e5eabc46dc8ffb1bdcf0a553201de734 Mon Sep 17 00:00:00 2001 From: Jan Laupetin Date: Wed, 8 Jul 2026 22:48:21 +0200 Subject: [PATCH] feat: add schema for file fonts --- schema/font/iw3.v1.json | 64 +++++++++++++++++++-------- schema/font/iw4.v1.json | 64 +++++++++++++++++++-------- schema/font/iw5.v1.json | 64 +++++++++++++++++++-------- schema/font/t4.v1.json | 64 +++++++++++++++++++-------- schema/font/t5.v1.json | 64 +++++++++++++++++++-------- schema/font/t6.v1.json | 97 +++++++++++++++++++++++++++-------------- 6 files changed, 299 insertions(+), 118 deletions(-) diff --git a/schema/font/iw3.v1.json b/schema/font/iw3.v1.json index 29aa86c..8df72d0 100644 --- a/schema/font/iw3.v1.json +++ b/schema/font/iw3.v1.json @@ -2,30 +2,60 @@ "$schema": "http://json-schema.org/draft-07/schema#", "$id": "http://openassettools.dev/schema/font/iw3.v1.json", "type": "object", - "required": ["_game", "_version", "pixelHeight", "material", "glyphs"], + "required": ["_game", "_version"], "properties": { "_game": { "const": "iw3" }, "_version": { "const": 1 + } + }, + "oneOf": [ + { + "type": "object", + "required": ["file"], + "properties": { + "file": { + "type": "string" + }, + "fontSize": { + "type": "integer", + "minimum": 0 + }, + "yOffset": { + "type": "integer" + }, + "generatedMaterialName": { + "type": "string" + }, + "generatedGlowMaterialName": { + "type": "string" + } + } }, - "pixelHeight": { - "type": "integer", - "minimum": 0 - }, - "material": { - "type": "string" - }, - "glowMaterial": { - "type": "string" - }, - "glyphs": { - "type": "array", - "minItems": 96, - "items": { - "$ref": "http://openassettools.dev/schema/font/common.v1.json#/definitions/Glyph" + { + "type": "object", + "required": ["pixelHeight", "material", "glyphs"], + "properties": { + "pixelHeight": { + "type": "integer", + "minimum": 0 + }, + "material": { + "type": "string" + }, + "glowMaterial": { + "type": "string" + }, + "glyphs": { + "type": "array", + "minItems": 96, + "items": { + "$ref": "http://openassettools.dev/schema/font/common.v1.json#/definitions/Glyph" + } + } } } - } + ] } diff --git a/schema/font/iw4.v1.json b/schema/font/iw4.v1.json index a046b1c..2eb8f1a 100644 --- a/schema/font/iw4.v1.json +++ b/schema/font/iw4.v1.json @@ -2,30 +2,60 @@ "$schema": "http://json-schema.org/draft-07/schema#", "$id": "http://openassettools.dev/schema/font/iw4.v1.json", "type": "object", - "required": ["_game", "_version", "pixelHeight", "material", "glyphs"], + "required": ["_game", "_version"], "properties": { "_game": { "const": "iw4" }, "_version": { "const": 1 + } + }, + "oneOf": [ + { + "type": "object", + "required": ["file"], + "properties": { + "file": { + "type": "string" + }, + "fontSize": { + "type": "integer", + "minimum": 0 + }, + "yOffset": { + "type": "integer" + }, + "generatedMaterialName": { + "type": "string" + }, + "generatedGlowMaterialName": { + "type": "string" + } + } }, - "pixelHeight": { - "type": "integer", - "minimum": 0 - }, - "material": { - "type": "string" - }, - "glowMaterial": { - "type": "string" - }, - "glyphs": { - "type": "array", - "minItems": 96, - "items": { - "$ref": "http://openassettools.dev/schema/font/common.v1.json#/definitions/Glyph" + { + "type": "object", + "required": ["pixelHeight", "material", "glyphs"], + "properties": { + "pixelHeight": { + "type": "integer", + "minimum": 0 + }, + "material": { + "type": "string" + }, + "glowMaterial": { + "type": "string" + }, + "glyphs": { + "type": "array", + "minItems": 96, + "items": { + "$ref": "http://openassettools.dev/schema/font/common.v1.json#/definitions/Glyph" + } + } } } - } + ] } diff --git a/schema/font/iw5.v1.json b/schema/font/iw5.v1.json index f44ab04..01b1320 100644 --- a/schema/font/iw5.v1.json +++ b/schema/font/iw5.v1.json @@ -2,30 +2,60 @@ "$schema": "http://json-schema.org/draft-07/schema#", "$id": "http://openassettools.dev/schema/font/iw5.v1.json", "type": "object", - "required": ["_game", "_version", "pixelHeight", "material", "glyphs"], + "required": ["_game", "_version"], "properties": { "_game": { "const": "iw5" }, "_version": { "const": 1 + } + }, + "oneOf": [ + { + "type": "object", + "required": ["file"], + "properties": { + "file": { + "type": "string" + }, + "fontSize": { + "type": "integer", + "minimum": 0 + }, + "yOffset": { + "type": "integer" + }, + "generatedMaterialName": { + "type": "string" + }, + "generatedGlowMaterialName": { + "type": "string" + } + } }, - "pixelHeight": { - "type": "integer", - "minimum": 0 - }, - "material": { - "type": "string" - }, - "glowMaterial": { - "type": "string" - }, - "glyphs": { - "type": "array", - "minItems": 96, - "items": { - "$ref": "http://openassettools.dev/schema/font/common.v1.json#/definitions/Glyph" + { + "type": "object", + "required": ["pixelHeight", "material", "glyphs"], + "properties": { + "pixelHeight": { + "type": "integer", + "minimum": 0 + }, + "material": { + "type": "string" + }, + "glowMaterial": { + "type": "string" + }, + "glyphs": { + "type": "array", + "minItems": 96, + "items": { + "$ref": "http://openassettools.dev/schema/font/common.v1.json#/definitions/Glyph" + } + } } } - } + ] } diff --git a/schema/font/t4.v1.json b/schema/font/t4.v1.json index 107be12..275793c 100644 --- a/schema/font/t4.v1.json +++ b/schema/font/t4.v1.json @@ -2,30 +2,60 @@ "$schema": "http://json-schema.org/draft-07/schema#", "$id": "http://openassettools.dev/schema/font/t4.v1.json", "type": "object", - "required": ["_game", "_version", "pixelHeight", "material", "glyphs"], + "required": ["_game", "_version"], "properties": { "_game": { "const": "t4" }, "_version": { "const": 1 + } + }, + "oneOf": [ + { + "type": "object", + "required": ["file"], + "properties": { + "file": { + "type": "string" + }, + "fontSize": { + "type": "integer", + "minimum": 0 + }, + "yOffset": { + "type": "integer" + }, + "generatedMaterialName": { + "type": "string" + }, + "generatedGlowMaterialName": { + "type": "string" + } + } }, - "pixelHeight": { - "type": "integer", - "minimum": 0 - }, - "material": { - "type": "string" - }, - "glowMaterial": { - "type": "string" - }, - "glyphs": { - "type": "array", - "minItems": 96, - "items": { - "$ref": "http://openassettools.dev/schema/font/common.v1.json#/definitions/Glyph" + { + "type": "object", + "required": ["pixelHeight", "material", "glyphs"], + "properties": { + "pixelHeight": { + "type": "integer", + "minimum": 0 + }, + "material": { + "type": "string" + }, + "glowMaterial": { + "type": "string" + }, + "glyphs": { + "type": "array", + "minItems": 96, + "items": { + "$ref": "http://openassettools.dev/schema/font/common.v1.json#/definitions/Glyph" + } + } } } - } + ] } diff --git a/schema/font/t5.v1.json b/schema/font/t5.v1.json index 8ed41f7..bc7b9e5 100644 --- a/schema/font/t5.v1.json +++ b/schema/font/t5.v1.json @@ -2,30 +2,60 @@ "$schema": "http://json-schema.org/draft-07/schema#", "$id": "http://openassettools.dev/schema/font/t5.v1.json", "type": "object", - "required": ["_game", "_version", "pixelHeight", "material", "glyphs"], + "required": ["_game", "_version"], "properties": { "_game": { "const": "t5" }, "_version": { "const": 1 + } + }, + "oneOf": [ + { + "type": "object", + "required": ["file"], + "properties": { + "file": { + "type": "string" + }, + "fontSize": { + "type": "integer", + "minimum": 0 + }, + "yOffset": { + "type": "integer" + }, + "generatedMaterialName": { + "type": "string" + }, + "generatedGlowMaterialName": { + "type": "string" + } + } }, - "pixelHeight": { - "type": "integer", - "minimum": 0 - }, - "material": { - "type": "string" - }, - "glowMaterial": { - "type": "string" - }, - "glyphs": { - "type": "array", - "minItems": 96, - "items": { - "$ref": "http://openassettools.dev/schema/font/common.v1.json#/definitions/Glyph" + { + "type": "object", + "required": ["pixelHeight", "material", "glyphs"], + "properties": { + "pixelHeight": { + "type": "integer", + "minimum": 0 + }, + "material": { + "type": "string" + }, + "glowMaterial": { + "type": "string" + }, + "glyphs": { + "type": "array", + "minItems": 96, + "items": { + "$ref": "http://openassettools.dev/schema/font/common.v1.json#/definitions/Glyph" + } + } } } - } + ] } diff --git a/schema/font/t6.v1.json b/schema/font/t6.v1.json index caf8850..cf4df0e 100644 --- a/schema/font/t6.v1.json +++ b/schema/font/t6.v1.json @@ -2,47 +2,78 @@ "$schema": "http://json-schema.org/draft-07/schema#", "$id": "http://openassettools.dev/schema/font/t6.v1.json", "type": "object", - "required": [ - "_game", - "_version", - "pixelHeight", - "isScalingAllowed", - "material", - "glyphs", - "kerningPairs" - ], + "required": ["_game", "_version"], "properties": { "_game": { "const": "t6" }, "_version": { "const": 1 - }, - "pixelHeight": { - "type": "integer", - "minimum": 0 - }, - "isScalingAllowed": { - "type": "boolean" - }, - "material": { - "type": "string" - }, - "glowMaterial": { - "type": "string" - }, - "glyphs": { - "type": "array", - "minItems": 96, - "items": { - "$ref": "http://openassettools.dev/schema/font/common.v1.json#/definitions/Glyph" + } + }, + "oneOf": [ + { + "type": "object", + "required": ["file"], + "properties": { + "file": { + "type": "string" + }, + "fontSize": { + "type": "integer", + "minimum": 0 + }, + "yOffset": { + "type": "integer" + }, + "isScalingAllowed": { + "type": "boolean" + }, + "generatedMaterialName": { + "type": "string" + }, + "generatedGlowMaterialName": { + "type": "string" + } } }, - "kerningPairs": { - "type": "array", - "items": { - "$ref": "http://openassettools.dev/schema/font/common.v1.json#/definitions/KerningPair" + { + "type": "object", + "required": [ + "pixelHeight", + "isScalingAllowed", + "material", + "glyphs", + "kerningPairs" + ], + "properties": { + "pixelHeight": { + "type": "integer", + "minimum": 0 + }, + "isScalingAllowed": { + "type": "boolean" + }, + "material": { + "type": "string" + }, + "glowMaterial": { + "type": "string" + }, + "glyphs": { + "type": "array", + "minItems": 96, + "items": { + "$ref": "http://openassettools.dev/schema/font/common.v1.json#/definitions/Glyph" + } + }, + "kerningPairs": { + "type": "array", + "items": { + "$ref": "http://openassettools.dev/schema/font/common.v1.json#/definitions/KerningPair" + } + } } } - } + ] }