zdxpan commited on
Commit
04edf71
1 Parent(s): aea40f1

Update app.py

Browse files
Files changed (1) hide show
  1. app.py +2 -2
app.py CHANGED
@@ -146,7 +146,7 @@ def generate_image(bac_img, title,a,b,c,d,e,f, #-- 当前文本行内字数可
146
  continue
147
  sub_title = lines[0]
148
  sub_texts = "。".join(lines[1:])
149
- words = int((width) / sz3) + 2
150
  sub_text = textwrap.wrap(sub_texts, width=words)
151
  # sub_text = [i.center(words) for i in sub_text]
152
  # -----文本框效果--------
@@ -348,7 +348,7 @@ with gr.Blocks() as demo:
348
  color2 = gr.Textbox("#007000", label = "子标题颜色")
349
  font_txt = gr.Dropdown(choices = font_list, label = "文本字体", value = "fonts/simsun.ttc")
350
  sz3 = gr.Slider(1, 100, label = "wordSize", value=40, step = 5)
351
- txt_x = gr.Slider(1, WIDTH, label = "内容位置_x", value=80, step = 5)
352
  color3 = gr.Textbox("#101010", label = "文字颜色")
353
 
354
  with gr.Row():
 
146
  continue
147
  sub_title = lines[0]
148
  sub_texts = "。".join(lines[1:])
149
+ words = int((width - txt_x) / sz3) + 2
150
  sub_text = textwrap.wrap(sub_texts, width=words)
151
  # sub_text = [i.center(words) for i in sub_text]
152
  # -----文本框效果--------
 
348
  color2 = gr.Textbox("#007000", label = "子标题颜色")
349
  font_txt = gr.Dropdown(choices = font_list, label = "文本字体", value = "fonts/simsun.ttc")
350
  sz3 = gr.Slider(1, 100, label = "wordSize", value=40, step = 5)
351
+ txt_x = gr.Slider(1, WIDTH, label = "内容位置_x", value=20, step = 5)
352
  color3 = gr.Textbox("#101010", label = "文字颜色")
353
 
354
  with gr.Row():