MCPcopy
hub / github.com/pandas-dev/pandas / build_font

Method build_font

pandas/io/formats/excel.py:375–391  ·  view source on GitHub ↗
(
        self, props: Mapping[str, str]
    )

Source from the content-addressed store, hash-verified

373 return {"format_code": fc}
374
375 def build_font(
376 self, props: Mapping[str, str]
377 ) -> dict[str, bool | float | str | None]:
378 font_names = self._get_font_names(props)
379 decoration = self._get_decoration(props)
380 return {
381 "name": font_names[0] if font_names else None,
382 "family": self._select_font_family(font_names),
383 "size": self._get_font_size(props),
384 "bold": self._get_is_bold(props),
385 "italic": self._get_is_italic(props),
386 "underline": ("single" if "underline" in decoration else None),
387 "strike": ("line-through" in decoration) or None,
388 "color": self.color_to_excel(props.get("color")),
389 # shadow if nonzero digit before shadow color
390 "shadow": self._get_shadow(props),
391 }
392
393 def _get_is_bold(self, props: Mapping[str, str]) -> bool | None:
394 weight = props.get("font-weight")

Callers 1

build_xlstyleMethod · 0.95

Calls 9

_get_font_namesMethod · 0.95
_get_decorationMethod · 0.95
_select_font_familyMethod · 0.95
_get_font_sizeMethod · 0.95
_get_is_boldMethod · 0.95
_get_is_italicMethod · 0.95
color_to_excelMethod · 0.95
_get_shadowMethod · 0.95
getMethod · 0.45

Tested by

no test coverage detected