Skip to content

Commit 5a7ec05

Browse files
authored
add APIs for font control to report_objects (#406)
Co-authored-by: viseshrp <[email protected]>
1 parent d6c3488 commit 5a7ec05

File tree

2 files changed

+27
-4
lines changed

2 files changed

+27
-4
lines changed

src/ansys/dynamicreporting/core/utils/report_objects.py

Lines changed: 20 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -3504,6 +3504,26 @@ def output_pptx(self, value):
35043504
props["output_pptx"] = value
35053505
self.set_property(props)
35063506

3507+
@property
3508+
def font_size(self):
3509+
return self.get_property().get("font_size")
3510+
3511+
@font_size.setter
3512+
def font_size(self, value):
3513+
props = self.get_property()
3514+
props["font_size"] = value
3515+
self.set_property(props)
3516+
3517+
@property
3518+
def html_font_scale(self):
3519+
return self.get_property().get("html_font_scale")
3520+
3521+
@html_font_scale.setter
3522+
def html_font_scale(self, value):
3523+
props = self.get_property()
3524+
props["html_font_scale"] = value
3525+
self.set_property(props)
3526+
35073527

35083528
class pptxslideREST(LayoutREST):
35093529
"""Representation of PPTX Slide Layout Template."""

tests/test_report_objects.py

Lines changed: 7 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1895,12 +1895,15 @@ def test_squile_query() -> None:
18951895
def test_pptx() -> None:
18961896
a = ro.pptxREST()
18971897
a.input_pptx = "a"
1898-
succ = a.input_pptx == "a"
1898+
assert a.input_pptx == "a"
18991899
a.use_all_slides = 1
1900-
succ_two = a.use_all_slides == 1
1900+
assert a.use_all_slides == 1
19011901
a.output_pptx = "b"
1902-
succ_three = a.output_pptx == "b"
1903-
assert succ and succ_two and succ_three
1902+
assert a.output_pptx == "b"
1903+
a.font_size = "4"
1904+
assert a.font_size == "4"
1905+
a.html_font_scale = "0.5"
1906+
assert a.html_font_scale == "0.5"
19041907

19051908

19061909
@pytest.mark.ado_test

0 commit comments

Comments
 (0)