完善了海报生成
This commit is contained in:
parent
4f5d8cfbfe
commit
7224f46027
Binary file not shown.
@ -464,7 +464,7 @@ class VibrantTemplate(BaseTemplate):
|
||||
|
||||
def _render_right_column(self, draw: ImageDraw.Draw, content: Dict[str, Any], y: int, x: int, right_margin: int):
|
||||
"""渲染右栏内容:价格、票种和备注(增强版本,与demo一致)"""
|
||||
price_text = content.get('price', '')
|
||||
price_text = str(content.get('price', '')) # 确保价格是字符串类型
|
||||
price_target_width = int((right_margin - x) * 0.7)
|
||||
price_size, price_actual_width = self._calculate_optimal_font_size_enhanced(
|
||||
price_text, price_target_width, max_size=120, min_size=40
|
||||
@ -1020,7 +1020,7 @@ class VibrantTemplate(BaseTemplate):
|
||||
# 使用中文字体
|
||||
|
||||
# 价格
|
||||
price_text = content.get('price', '')
|
||||
price_text = str(content.get('price', '')) # 确保价格是字符串类型
|
||||
if price_text:
|
||||
price_target_width = int((right_margin - x) * 0.7)
|
||||
price_size, price_actual_width = self._calculate_optimal_font_size_enhanced(
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user