MCPcopy Index your code
hub / github.com/python-openxml/python-docx / _line_spacing

Method _line_spacing

src/docx/text/parfmt.py:257–269  ·  view source on GitHub ↗

Return the line spacing value calculated from the combination of `spacing_line` and `spacing_lineRule`. Returns a |float| number of lines when `spacing_lineRule` is ``WD_LINE_SPACING.MULTIPLE``, otherwise a |Length| object of absolute line height is returned. Returns

(spacing_line, spacing_lineRule)

Source from the content-addressed store, hash-verified

255
256 @staticmethod
257 def _line_spacing(spacing_line, spacing_lineRule):
258 """Return the line spacing value calculated from the combination of
259 `spacing_line` and `spacing_lineRule`.
260
261 Returns a |float| number of lines when `spacing_lineRule` is
262 ``WD_LINE_SPACING.MULTIPLE``, otherwise a |Length| object of absolute line
263 height is returned. Returns |None| when `spacing_line` is |None|.
264 """
265 if spacing_line is None:
266 return None
267 if spacing_lineRule == WD_LINE_SPACING.MULTIPLE:
268 return spacing_line / Pt(12)
269 return spacing_line
270
271 @staticmethod
272 def _line_spacing_rule(line, lineRule):

Callers 1

line_spacingMethod · 0.95

Calls 1

PtClass · 0.90

Tested by

no test coverage detected