MCPcopy Create free account
hub / github.com/scanny/python-pptx / _apply_fit

Method _apply_fit

src/pptx/text/text.py:219–227  ·  view source on GitHub ↗

Arrange text in this text frame to fit inside its extents. This is accomplished by setting auto size off, wrap on, and setting the font of all its text to `font_family`, `font_size`, `is_bold`, and `is_italic`.

(self, font_family: str, font_size: int, is_bold: bool, is_italic: bool)

Source from the content-addressed store, hash-verified

217 }[value]
218
219 def _apply_fit(self, font_family: str, font_size: int, is_bold: bool, is_italic: bool):
220 """Arrange text in this text frame to fit inside its extents.
221
222 This is accomplished by setting auto size off, wrap on, and setting the font of
223 all its text to `font_family`, `font_size`, `is_bold`, and `is_italic`.
224 """
225 self.auto_size = MSO_AUTO_SIZE.NONE
226 self.word_wrap = True
227 self._set_font(font_family, font_size, is_bold, is_italic)
228
229 def _best_fit_font_size(
230 self, family: str, max_size: int, bold: bool, italic: bool, font_file: str | None

Callers 2

fit_textMethod · 0.95

Calls 1

_set_fontMethod · 0.95

Tested by 1