File tree Expand file tree Collapse file tree 2 files changed +18
-1
lines changed
Expand file tree Collapse file tree 2 files changed +18
-1
lines changed Original file line number Diff line number Diff line change 1+ Feature : Access run font
2+ In order to discover or change the character formatting of a run
3+ As a developer using python-docx
4+ I need access to the font of a run
5+
6+
7+ @wip
8+ Scenario : Access the font of a run
9+ Given a run
10+ Then run.font is the Font object for the run
Original file line number Diff line number Diff line change 1414from docx .enum .text import WD_BREAK , WD_UNDERLINE
1515from docx .oxml import parse_xml
1616from docx .oxml .ns import nsdecls , qn
17- from docx .text .run import Run
17+ from docx .text .run import Font , Run
1818
1919from helpers import test_docx , test_file , test_text
2020
@@ -284,6 +284,13 @@ def then_type_is_page_break(context):
284284 assert attrib == {qn ('w:type' ): 'page' }
285285
286286
287+ @then ('run.font is the Font object for the run' )
288+ def then_run_font_is_the_Font_object_for_the_run (context ):
289+ run , font = context .run , context .run .font
290+ assert isinstance (font , Font )
291+ assert font .element is run .element
292+
293+
287294@then ('the last item in the run is a break' )
288295def then_last_item_in_run_is_a_break (context ):
289296 run = context .run
You can’t perform that action at this time.
0 commit comments