(
self, props: Mapping[str, str]
)
| 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") |
no test coverage detected