code: public function allFonts(Spreadsheet $spreadsheet)
      {
          // Get an array of unique fonts
          $aFonts = [];
          $aStyles = $this->allStyles($spreadsheet);
  
          /** @var \PhpOffice\PhpSpreadsheet\Style\Style $style */
          foreach ($aStyles as $style) {
              if (!isset($aFonts[$style->getFont()->getHashCode()])) {
                  $aFonts[$style->getFont()->getHashCode()] = $style->getFont();
              }
          }
  
          return $aFonts;
      }
docs: Get an array of all fonts.
  
  @param Spreadsheet $spreadsheet
  
  @return Font[] All fonts in PhpSpreadsheet