Spaces:
Running
Running
Update routers/news.py
Browse files- routers/news.py +2 -2
routers/news.py
CHANGED
|
@@ -219,14 +219,14 @@ def render_responsive_text(draw: ImageDraw.Draw, text: str, x: int, y: int, max_
|
|
| 219 |
line_height = bbox[3] - bbox[1]
|
| 220 |
draw.text((x, current_y), line, fill=fill_color, font=final_font)
|
| 221 |
# Aplicar line height de 115% (adicionar 15% de espaçamento extra)
|
| 222 |
-
current_y += int(line_height * 1.
|
| 223 |
else:
|
| 224 |
# Desenhar texto de baixo para cima (alinhamento à base)
|
| 225 |
current_y = y
|
| 226 |
for i, line in enumerate(reversed(lines)):
|
| 227 |
line_height = line_heights[len(lines) - 1 - i]
|
| 228 |
# Aplicar line height de 115% (adicionar 15% de espaçamento extra)
|
| 229 |
-
current_y -= int(line_height * 1.
|
| 230 |
draw.text((x, current_y), line, fill=fill_color, font=final_font)
|
| 231 |
|
| 232 |
def create_canvas(image_url: Optional[str], text: Optional[str] = None, text_position: str = "bottom", text_color: str = "white") -> BytesIO:
|
|
|
|
| 219 |
line_height = bbox[3] - bbox[1]
|
| 220 |
draw.text((x, current_y), line, fill=fill_color, font=final_font)
|
| 221 |
# Aplicar line height de 115% (adicionar 15% de espaçamento extra)
|
| 222 |
+
current_y += int(line_height * 1.20)
|
| 223 |
else:
|
| 224 |
# Desenhar texto de baixo para cima (alinhamento à base)
|
| 225 |
current_y = y
|
| 226 |
for i, line in enumerate(reversed(lines)):
|
| 227 |
line_height = line_heights[len(lines) - 1 - i]
|
| 228 |
# Aplicar line height de 115% (adicionar 15% de espaçamento extra)
|
| 229 |
+
current_y -= int(line_height * 1.20)
|
| 230 |
draw.text((x, current_y), line, fill=fill_color, font=final_font)
|
| 231 |
|
| 232 |
def create_canvas(image_url: Optional[str], text: Optional[str] = None, text_position: str = "bottom", text_color: str = "white") -> BytesIO:
|