优化了json格式
This commit is contained in:
parent
610404d60f
commit
cdfa9a3699
@ -1040,7 +1040,7 @@ class PosterService:
|
|||||||
}
|
}
|
||||||
|
|
||||||
def _create_gradient_background_object(self, canvas_width: int, canvas_height: int, gradient_start: int) -> Dict[str, Any]:
|
def _create_gradient_background_object(self, canvas_width: int, canvas_height: int, gradient_start: int) -> Dict[str, Any]:
|
||||||
"""创建模拟毛玻璃效果的渐变背景"""
|
"""创建模拟毛玻璃效果的渐变背景(简化版本,提高兼容性)"""
|
||||||
return {
|
return {
|
||||||
"type": "rect",
|
"type": "rect",
|
||||||
"version": "5.3.0",
|
"version": "5.3.0",
|
||||||
@ -1050,24 +1050,13 @@ class PosterService:
|
|||||||
"top": gradient_start,
|
"top": gradient_start,
|
||||||
"width": canvas_width,
|
"width": canvas_width,
|
||||||
"height": canvas_height - gradient_start,
|
"height": canvas_height - gradient_start,
|
||||||
"fill": {
|
"fill": "rgba(0, 50, 120, 0.6)", # 简化为单一颜色,提高兼容性
|
||||||
"type": "linear",
|
"stroke": "",
|
||||||
"coords": {
|
"strokeWidth": 0,
|
||||||
"x1": 0,
|
|
||||||
"y1": 0,
|
|
||||||
"x2": 0,
|
|
||||||
"y2": canvas_height - gradient_start
|
|
||||||
},
|
|
||||||
"colorStops": [
|
|
||||||
{"offset": 0, "color": "rgba(0, 30, 80, 0.3)"},
|
|
||||||
{"offset": 0.5, "color": "rgba(0, 50, 120, 0.6)"},
|
|
||||||
{"offset": 1, "color": "rgba(0, 80, 160, 0.8)"}
|
|
||||||
]
|
|
||||||
},
|
|
||||||
"angle": 0,
|
"angle": 0,
|
||||||
"flipX": False,
|
"flipX": False,
|
||||||
"flipY": False,
|
"flipY": False,
|
||||||
"opacity": 1,
|
"opacity": 0.8,
|
||||||
"visible": True,
|
"visible": True,
|
||||||
"name": "glass_gradient",
|
"name": "glass_gradient",
|
||||||
"data": {
|
"data": {
|
||||||
@ -1101,8 +1090,8 @@ class PosterService:
|
|||||||
"width": content_width,
|
"width": content_width,
|
||||||
"height": title_size + 20,
|
"height": title_size + 20,
|
||||||
"fill": "#ffffff",
|
"fill": "#ffffff",
|
||||||
"stroke": "rgba(0, 30, 80, 0.8)",
|
"stroke": "#001e50",
|
||||||
"strokeWidth": 2,
|
"strokeWidth": 2,
|
||||||
"fontFamily": "Arial Black, sans-serif",
|
"fontFamily": "Arial Black, sans-serif",
|
||||||
"fontWeight": "bold",
|
"fontWeight": "bold",
|
||||||
"fontSize": title_size,
|
"fontSize": title_size,
|
||||||
@ -1135,12 +1124,7 @@ class PosterService:
|
|||||||
"width": content_width,
|
"width": content_width,
|
||||||
"height": subtitle_size + 15,
|
"height": subtitle_size + 15,
|
||||||
"fill": "#ffffff",
|
"fill": "#ffffff",
|
||||||
"shadow": {
|
"shadow": "rgba(0, 0, 0, 0.7) 2px 2px 5px",
|
||||||
"color": "rgba(0, 0, 0, 0.7)",
|
|
||||||
"blur": 5,
|
|
||||||
"offsetX": 2,
|
|
||||||
"offsetY": 2
|
|
||||||
},
|
|
||||||
"fontFamily": "Arial, sans-serif",
|
"fontFamily": "Arial, sans-serif",
|
||||||
"fontWeight": "normal",
|
"fontWeight": "normal",
|
||||||
"fontSize": subtitle_size,
|
"fontSize": subtitle_size,
|
||||||
@ -1296,12 +1280,7 @@ class PosterService:
|
|||||||
"width": column_width,
|
"width": column_width,
|
||||||
"height": price_size + 20,
|
"height": price_size + 20,
|
||||||
"fill": "#ffffff",
|
"fill": "#ffffff",
|
||||||
"shadow": {
|
"shadow": "rgba(0, 0, 0, 0.7) 2px 2px 5px",
|
||||||
"color": "rgba(0, 0, 0, 0.7)",
|
|
||||||
"blur": 5,
|
|
||||||
"offsetX": 2,
|
|
||||||
"offsetY": 2
|
|
||||||
},
|
|
||||||
"fontFamily": "Arial Black, sans-serif",
|
"fontFamily": "Arial Black, sans-serif",
|
||||||
"fontWeight": "bold",
|
"fontWeight": "bold",
|
||||||
"fontSize": price_size,
|
"fontSize": price_size,
|
||||||
@ -1350,12 +1329,7 @@ class PosterService:
|
|||||||
"width": column_width,
|
"width": column_width,
|
||||||
"height": ticket_size + 10,
|
"height": ticket_size + 10,
|
||||||
"fill": "#ffffff",
|
"fill": "#ffffff",
|
||||||
"shadow": {
|
"shadow": "rgba(0, 0, 0, 0.5) 1px 1px 3px",
|
||||||
"color": "rgba(0, 0, 0, 0.5)",
|
|
||||||
"blur": 3,
|
|
||||||
"offsetX": 1,
|
|
||||||
"offsetY": 1
|
|
||||||
},
|
|
||||||
"fontFamily": "Arial, sans-serif",
|
"fontFamily": "Arial, sans-serif",
|
||||||
"fontWeight": "normal",
|
"fontWeight": "normal",
|
||||||
"fontSize": ticket_size,
|
"fontSize": ticket_size,
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user