mightstone.services.cardconjurer.models.Text
- pydantic model mightstone.services.cardconjurer.models.Text
A layer composed of a text (One of the 3 possible layer types)
Show JSON schema
{ "title": "Text", "description": "A layer composed of a text (One of the 3 possible layer types)", "type": "object", "properties": { "type": { "const": "text", "enum": [ "text" ], "title": "Type", "type": "string" }, "name": { "anyOf": [ { "type": "string" }, { "type": "null" } ], "default": null, "title": "Name" }, "tags": { "anyOf": [ { "items": { "$ref": "#/$defs/Tags" }, "type": "array" }, { "type": "null" } ], "default": null, "title": "Tags" }, "text": { "title": "Text", "type": "string" }, "font": { "anyOf": [ { "type": "string" }, { "type": "null" } ], "default": null, "title": "Font" }, "color": { "default": "white", "format": "color", "title": "Color", "type": "string" }, "oneLine": { "default": false, "title": "Oneline", "type": "boolean" }, "align": { "anyOf": [ { "$ref": "#/$defs/HorizontalAlign" }, { "type": "null" } ], "default": "left" }, "verticalAlign": { "anyOf": [ { "$ref": "#/$defs/VerticalAlign" }, { "type": "null" } ], "default": "center" }, "lineHeightScale": { "default": 1, "title": "Lineheightscale", "type": "number" }, "fontWeight": { "anyOf": [ { "type": "string" }, { "type": "null" } ], "default": null, "title": "Fontweight" }, "rotation": { "default": 0, "title": "Rotation", "type": "integer" }, "size": { "title": "Size", "type": "integer" }, "opacity": { "anyOf": [ { "type": "number" }, { "type": "null" } ], "default": null, "title": "Opacity" }, "x": { "title": "X", "type": "integer" }, "y": { "title": "Y", "type": "integer" }, "width": { "title": "Width", "type": "integer" }, "height": { "title": "Height", "type": "integer" }, "textCodesOnly": { "default": false, "title": "Textcodesonly", "type": "boolean" }, "filters": { "anyOf": [ { "items": { "anyOf": [ { "$ref": "#/$defs/FilterShadow" }, { "$ref": "#/$defs/FilterOverlay" } ] }, "type": "array" }, { "type": "null" } ], "default": null, "title": "Filters" } }, "$defs": { "FilterOverlay": { "properties": { "type": { "const": "colorOverlay", "enum": [ "colorOverlay" ], "title": "Type", "type": "string" }, "color": { "format": "color", "title": "Color", "type": "string" } }, "required": [ "type", "color" ], "title": "FilterOverlay", "type": "object" }, "FilterShadow": { "properties": { "type": { "const": "shadow", "enum": [ "shadow" ], "title": "Type", "type": "string" }, "color": { "default": "black", "format": "color", "title": "Color", "type": "string" }, "x": { "title": "X", "type": "integer" }, "y": { "title": "Y", "type": "integer" } }, "required": [ "type", "x", "y" ], "title": "FilterShadow", "type": "object" }, "HorizontalAlign": { "enum": [ "left", "right", "center" ], "title": "HorizontalAlign", "type": "string" }, "Tags": { "description": "Another important note is that many text and image layers have the tags \"editable\",\nand there are two groups tagged \"new-image-group\" and \"new-text-group\". These tags\ntell the UI which layers should be presented as editable, and which layer groups\nshould store newly-added layers.", "enum": [ "editable", "draggable", "new-image-group", "new-text-group", "name" ], "title": "Tags", "type": "string" }, "VerticalAlign": { "enum": [ "top", "center", "bottom" ], "title": "VerticalAlign", "type": "string" } }, "required": [ "type", "text", "size", "x", "y", "width", "height" ] }
- Fields:
- field align: HorizontalAlign | None = HorizontalAlign.LEFT
- field color: Color = Color('white', rgb=(255, 255, 255))
- field filters: List[FilterShadow | FilterOverlay] | None = None
- field font: str | None = None
- field fontWeight: str | None = None
- field height: int [Required]
- field lineHeightScale: float = 1
- field oneLine: bool = False
- field opacity: float | None = None
- field rotation: int = 0
- field size: int [Required]
- field text: str [Required]
- field textCodesOnly: bool = False
- field type: Literal[LayerTypes.TEXT] [Required]
- field verticalAlign: VerticalAlign | None = VerticalAlign.CENTER
- field width: int [Required]
- field x: int [Required]
- field y: int [Required]