MCPcopy Index your code
hub / github.com/matplotlib/matplotlib / get_familyname

Method get_familyname

lib/matplotlib/_afm.py:456–466  ·  view source on GitHub ↗

Return the font family name, e.g., 'Times'.

(self)

Source from the content-addressed store, hash-verified

454 return name
455
456 def get_familyname(self) -> str:
457 """Return the font family name, e.g., 'Times'."""
458 name = self._header.get('FamilyName')
459 if name is not None:
460 return name
461
462 # FamilyName not specified so we'll make a guess
463 name = self.get_fullname()
464 extras = (r'(?i)([ -](regular|plain|italic|oblique|bold|semibold|'
465 r'light|ultralight|extra|condensed))+$')
466 return re.sub(extras, '', name)
467
468 @property
469 def family_name(self) -> str: # For consistency with FT2Font.

Callers 3

family_nameMethod · 0.95
afmFontPropertyFunction · 0.80

Calls 2

get_fullnameMethod · 0.95
getMethod · 0.45

Tested by 1