Update 2 graph template with text wrap and uniform font
Browse files- routers/powerpoint.py +13 -4
routers/powerpoint.py
CHANGED
|
@@ -333,6 +333,7 @@ class TwoColumnGraphTemplateGenerator(TemplateGenerator):
|
|
| 333 |
title_box = slide.shapes.add_textbox(Inches(0.39), Inches(0.24), Inches(12.53), Inches(0.9))
|
| 334 |
title_tf = title_box.text_frame
|
| 335 |
title_tf.text = presentation_data.title
|
|
|
|
| 336 |
title_tf.paragraphs[0].font.name = "Verdana"
|
| 337 |
title_tf.paragraphs[0].font.size = Pt(22)
|
| 338 |
title_tf.vertical_anchor = MSO_ANCHOR.MIDDLE
|
|
@@ -376,6 +377,7 @@ class TwoColumnGraphTemplateGenerator(TemplateGenerator):
|
|
| 376 |
# === Shape 6 : Graph title gauche ===
|
| 377 |
gt_left = slide.shapes.add_textbox(Inches(0.38), Inches(2.21), Inches(5.9), Inches(0.39))
|
| 378 |
gtl_tf = gt_left.text_frame
|
|
|
|
| 379 |
gtl_tf.text = presentation_data.left_graph_title
|
| 380 |
gtl_tf.paragraphs[0].font.size = Pt(12)
|
| 381 |
gtl_tf.paragraphs[0].font.name = "Verdana"
|
|
@@ -395,6 +397,7 @@ class TwoColumnGraphTemplateGenerator(TemplateGenerator):
|
|
| 395 |
# === Shape 8 : Graph title droite ===
|
| 396 |
gt_right = slide.shapes.add_textbox(Inches(7.07), Inches(2.21), Inches(5.9), Inches(0.39))
|
| 397 |
gtr_tf = gt_right.text_frame
|
|
|
|
| 398 |
gtr_tf.text = presentation_data.right_graph_title
|
| 399 |
gtr_tf.paragraphs[0].font.size = Pt(12)
|
| 400 |
gtr_tf.paragraphs[0].font.name = "Verdana"
|
|
@@ -406,9 +409,11 @@ class TwoColumnGraphTemplateGenerator(TemplateGenerator):
|
|
| 406 |
tl_tf_fill.solid()
|
| 407 |
tl_tf_fill.fore_color.rgb = RGBColor(247, 248, 250)
|
| 408 |
tl_tf = text_left.text_frame
|
|
|
|
| 409 |
tl_tf.text = presentation_data.left_side_text
|
| 410 |
-
tl_tf.paragraphs
|
| 411 |
-
|
|
|
|
| 412 |
tl_tf.vertical_anchor = MSO_ANCHOR.MIDDLE
|
| 413 |
|
| 414 |
# === Shape 10 : Bloc texte droite ===
|
|
@@ -417,9 +422,11 @@ class TwoColumnGraphTemplateGenerator(TemplateGenerator):
|
|
| 417 |
tr_tf_fill.solid()
|
| 418 |
tr_tf_fill.fore_color.rgb = RGBColor(247, 248, 250)
|
| 419 |
tr_tf = text_right.text_frame
|
|
|
|
| 420 |
tr_tf.text = presentation_data.right_side_text
|
| 421 |
-
tr_tf.paragraphs
|
| 422 |
-
|
|
|
|
| 423 |
tr_tf.vertical_anchor = MSO_ANCHOR.MIDDLE
|
| 424 |
|
| 425 |
# === Shape 11 : Ligne verticale séparation ===
|
|
@@ -436,6 +443,7 @@ class TwoColumnGraphTemplateGenerator(TemplateGenerator):
|
|
| 436 |
# === Shape 12 : Texte haut gauche ===
|
| 437 |
txt12 = slide.shapes.add_textbox(Inches(0.38), Inches(1.52), Inches(5.9), Inches(0.44))
|
| 438 |
txt12_tf = txt12.text_frame
|
|
|
|
| 439 |
txt12_tf.text = presentation_data.left_text
|
| 440 |
txt12_tf.paragraphs[0].font.size = Pt(14)
|
| 441 |
txt12_tf.paragraphs[0].font.name = "Verdana"
|
|
@@ -444,6 +452,7 @@ class TwoColumnGraphTemplateGenerator(TemplateGenerator):
|
|
| 444 |
# === Shape 13 : Texte haut droite ===
|
| 445 |
txt13 = slide.shapes.add_textbox(Inches(7.07), Inches(1.52), Inches(5.9), Inches(0.44))
|
| 446 |
txt13_tf = txt13.text_frame
|
|
|
|
| 447 |
txt13_tf.text = presentation_data.right_text
|
| 448 |
txt13_tf.paragraphs[0].font.size = Pt(14)
|
| 449 |
txt13_tf.paragraphs[0].font.name = "Verdana"
|
|
|
|
| 333 |
title_box = slide.shapes.add_textbox(Inches(0.39), Inches(0.24), Inches(12.53), Inches(0.9))
|
| 334 |
title_tf = title_box.text_frame
|
| 335 |
title_tf.text = presentation_data.title
|
| 336 |
+
title_tf.word_wrap = True
|
| 337 |
title_tf.paragraphs[0].font.name = "Verdana"
|
| 338 |
title_tf.paragraphs[0].font.size = Pt(22)
|
| 339 |
title_tf.vertical_anchor = MSO_ANCHOR.MIDDLE
|
|
|
|
| 377 |
# === Shape 6 : Graph title gauche ===
|
| 378 |
gt_left = slide.shapes.add_textbox(Inches(0.38), Inches(2.21), Inches(5.9), Inches(0.39))
|
| 379 |
gtl_tf = gt_left.text_frame
|
| 380 |
+
gtl_tf.word_wrap = True
|
| 381 |
gtl_tf.text = presentation_data.left_graph_title
|
| 382 |
gtl_tf.paragraphs[0].font.size = Pt(12)
|
| 383 |
gtl_tf.paragraphs[0].font.name = "Verdana"
|
|
|
|
| 397 |
# === Shape 8 : Graph title droite ===
|
| 398 |
gt_right = slide.shapes.add_textbox(Inches(7.07), Inches(2.21), Inches(5.9), Inches(0.39))
|
| 399 |
gtr_tf = gt_right.text_frame
|
| 400 |
+
gtr_tf.word_wrap = True
|
| 401 |
gtr_tf.text = presentation_data.right_graph_title
|
| 402 |
gtr_tf.paragraphs[0].font.size = Pt(12)
|
| 403 |
gtr_tf.paragraphs[0].font.name = "Verdana"
|
|
|
|
| 409 |
tl_tf_fill.solid()
|
| 410 |
tl_tf_fill.fore_color.rgb = RGBColor(247, 248, 250)
|
| 411 |
tl_tf = text_left.text_frame
|
| 412 |
+
tl_tf.word_wrap = True
|
| 413 |
tl_tf.text = presentation_data.left_side_text
|
| 414 |
+
for paragraph in tl_tf.paragraphs:
|
| 415 |
+
paragraph.font.size = Pt(12)
|
| 416 |
+
paragraph.font.name = "Verdana"
|
| 417 |
tl_tf.vertical_anchor = MSO_ANCHOR.MIDDLE
|
| 418 |
|
| 419 |
# === Shape 10 : Bloc texte droite ===
|
|
|
|
| 422 |
tr_tf_fill.solid()
|
| 423 |
tr_tf_fill.fore_color.rgb = RGBColor(247, 248, 250)
|
| 424 |
tr_tf = text_right.text_frame
|
| 425 |
+
tr_tf.word_wrap = True
|
| 426 |
tr_tf.text = presentation_data.right_side_text
|
| 427 |
+
for paragraph in tr_tf.paragraphs:
|
| 428 |
+
paragraph.font.size = Pt(12)
|
| 429 |
+
paragraph.font.name = "Verdana"
|
| 430 |
tr_tf.vertical_anchor = MSO_ANCHOR.MIDDLE
|
| 431 |
|
| 432 |
# === Shape 11 : Ligne verticale séparation ===
|
|
|
|
| 443 |
# === Shape 12 : Texte haut gauche ===
|
| 444 |
txt12 = slide.shapes.add_textbox(Inches(0.38), Inches(1.52), Inches(5.9), Inches(0.44))
|
| 445 |
txt12_tf = txt12.text_frame
|
| 446 |
+
txt12_tf.word_wrap = True
|
| 447 |
txt12_tf.text = presentation_data.left_text
|
| 448 |
txt12_tf.paragraphs[0].font.size = Pt(14)
|
| 449 |
txt12_tf.paragraphs[0].font.name = "Verdana"
|
|
|
|
| 452 |
# === Shape 13 : Texte haut droite ===
|
| 453 |
txt13 = slide.shapes.add_textbox(Inches(7.07), Inches(1.52), Inches(5.9), Inches(0.44))
|
| 454 |
txt13_tf = txt13.text_frame
|
| 455 |
+
txt13_tf.word_wrap = True
|
| 456 |
txt13_tf.text = presentation_data.right_text
|
| 457 |
txt13_tf.paragraphs[0].font.size = Pt(14)
|
| 458 |
txt13_tf.paragraphs[0].font.name = "Verdana"
|