Spaces:
Sleeping
Sleeping
Update app.py
Browse files
app.py
CHANGED
@@ -39,7 +39,8 @@ def text_to_images_and_base64_generator(text_content, style, font_size, bg_color
|
|
39 |
"1:1 (Square)": (1080, 1080),
|
40 |
"16:9 (Widescreen)": (1080, 608),
|
41 |
"9:16 (Vertical)": (1080, 1920),
|
42 |
-
"4:3 (Standard)": (1080, 810)
|
|
|
43 |
}
|
44 |
color_map = {
|
45 |
"White": (255, 255, 255),
|
@@ -52,7 +53,7 @@ def text_to_images_and_base64_generator(text_content, style, font_size, bg_color
|
|
52 |
font_map = {
|
53 |
"Arial": os.path.join("fonts", "LiberationSans-Regular.ttf"),
|
54 |
"Times New Roman": os.path.join("fonts", "LiberationSerif-Regular.ttf"),
|
55 |
-
"Courier New": os.path.join("fonts", "DejaVuSansMono
|
56 |
"DejaVu Sans": os.path.join("fonts", "DejaVuSans.ttf")
|
57 |
}
|
58 |
|
@@ -197,7 +198,7 @@ demo = gr.Interface(
|
|
197 |
gr.Radio(['lines', 'dots', 'grid', 'plain'], label="Background Style", value='lines'),
|
198 |
gr.Slider(24, 72, value=48, step=2, label="Font Size"),
|
199 |
gr.Radio(["White", "Light Gray", "Beige", "Pale Blue"], label="Background Color", value="White"),
|
200 |
-
gr.Radio(["1:1 (Square)", "16:9 (Widescreen)", "9:16 (Vertical)", "4:3 (Standard)"], label="Aspect Ratio", value="1:1 (Square)"),
|
201 |
gr.Dropdown(font_choices, label="Font Family", value="Arial")
|
202 |
],
|
203 |
outputs=[
|
|
|
39 |
"1:1 (Square)": (1080, 1080),
|
40 |
"16:9 (Widescreen)": (1080, 608),
|
41 |
"9:16 (Vertical)": (1080, 1920),
|
42 |
+
"4:3 (Standard)": (1080, 810),
|
43 |
+
"3:4 (Standard)": (1080, 1440)
|
44 |
}
|
45 |
color_map = {
|
46 |
"White": (255, 255, 255),
|
|
|
53 |
font_map = {
|
54 |
"Arial": os.path.join("fonts", "LiberationSans-Regular.ttf"),
|
55 |
"Times New Roman": os.path.join("fonts", "LiberationSerif-Regular.ttf"),
|
56 |
+
"Courier New": os.path.join("fonts", "DejaVuSansMono.ttf"),
|
57 |
"DejaVu Sans": os.path.join("fonts", "DejaVuSans.ttf")
|
58 |
}
|
59 |
|
|
|
198 |
gr.Radio(['lines', 'dots', 'grid', 'plain'], label="Background Style", value='lines'),
|
199 |
gr.Slider(24, 72, value=48, step=2, label="Font Size"),
|
200 |
gr.Radio(["White", "Light Gray", "Beige", "Pale Blue"], label="Background Color", value="White"),
|
201 |
+
gr.Radio(["1:1 (Square)", "16:9 (Widescreen)", "9:16 (Vertical)", "4:3 (Standard)","3:4 (Standard)"], label="Aspect Ratio", value="1:1 (Square)"),
|
202 |
gr.Dropdown(font_choices, label="Font Family", value="Arial")
|
203 |
],
|
204 |
outputs=[
|