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

Method _get_font_names

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

Source from the content-addressed store, hash-verified

415 return None
416
417 def _get_font_names(self, props: Mapping[str, str]) -> Sequence[str]:
418 font_names_tmp = re.findall(
419 r"""(?x)
420 (
421 "(?:[^"]|\\")+"
422 |
423 '(?:[^']|\\')+'
424 |
425 [^'",]+
426 )(?=,|\s*$)
427 """,
428 props.get("font-family", ""),
429 )
430
431 font_names = []
432 for name in font_names_tmp:
433 if name[:1] == '"':
434 name = name[1:-1].replace('\\"', '"')
435 elif name[:1] == "'":
436 name = name[1:-1].replace("\\'", "'")
437 else:
438 name = name.strip()
439 if name:
440 font_names.append(name)
441 return font_names
442
443 def _get_font_size(self, props: Mapping[str, str]) -> float | None:
444 size = props.get("font-size")

Callers 1

build_fontMethod · 0.95

Calls 5

findallMethod · 0.80
stripMethod · 0.80
getMethod · 0.45
replaceMethod · 0.45
appendMethod · 0.45

Tested by

no test coverage detected