original_string: public function get_font_families() {
          $families = array();
          foreach ($this->fontlist as $font) {
              if (strpos($font, 'uni2cid') === 0) {
                  // This is not an font file.
                  continue;
              }
              if (strpos($font, 'cid0') === 0) {
                  // These do not seem to work with utf-8, better ignore them for now.
                  continue;
              }
              if (substr($font, -2) === 'bi') {
                  $family = substr($font, 0, -2);
                  if (in_array($family, $this->fontlist)) {
                      $families[$family]['BI'] = 'BI';
                      continue;
                  }
              }
              if (substr($font, -1) === 'i') {
                  $family = substr($font, 0, -1);
                  if (in_array($family, $this->fontlist)) {
                      $families[$family]['I'] = 'I';
                      continue;
                  }
              }
              if (substr($font, -1) === 'b') {
                  $family = substr($font, 0, -1);
                  if (in_array($family, $this->fontlist)) {
                      $families[$family]['B'] = 'B';
                      continue;
                  }
              }
              // This must be a Family or incomplete set of fonts present.
              $families[$font]['R'] = 'R';
          }
  
          // Sort everything consistently.
          ksort($families);
          foreach ($families as $k => $v) {
              krsort($families[$k]);
          }
  
          return $families;
      }
code: public function get_font_families() {
          $families = array();
          foreach ($this->fontlist as $font) {
              if (strpos($font, 'uni2cid') === 0) {
                  // This is not an font file.
                  continue;
              }
              if (strpos($font, 'cid0') === 0) {
                  // These do not seem to work with utf-8, better ignore them for now.
                  continue;
              }
              if (substr($font, -2) === 'bi') {
                  $family = substr($font, 0, -2);
                  if (in_array($family, $this->fontlist)) {
                      $families[$family]['BI'] = 'BI';
                      continue;
                  }
              }
              if (substr($font, -1) === 'i') {
                  $family = substr($font, 0, -1);
                  if (in_array($family, $this->fontlist)) {
                      $families[$family]['I'] = 'I';
                      continue;
                  }
              }
              if (substr($font, -1) === 'b') {
                  $family = substr($font, 0, -1);
                  if (in_array($family, $this->fontlist)) {
                      $families[$family]['B'] = 'B';
                      continue;
                  }
              }
              // This must be a Family or incomplete set of fonts present.
              $families[$font]['R'] = 'R';
          }
  
          // Sort everything consistently.
          ksort($families);
          foreach ($families as $k => $v) {
              krsort($families[$k]);
          }
  
          return $families;
      }
code_tokens: public function get_font_families ( ) { $ families = array ( ) ; foreach ( $ this -> fontlist as $ font ) { if ( strpos ( $ font , 'uni2cid' ) === 0 ) { // This is not an font file. continue ; } if ( strpos ( $ font , 'cid0' ) === 0 ) { // These do not seem to work with utf-8, better ignore them for now. continue ; } if ( substr ( $ font , - 2 ) === 'bi' ) { $ family = substr ( $ font , 0 , - 2 ) ; if ( in_array ( $ family , $ this -> fontlist ) ) { $ families [ $ family ] [ 'BI' ] = 'BI' ; continue ; } } if ( substr ( $ font , - 1 ) === 'i' ) { $ family = substr ( $ font , 0 , - 1 ) ; if ( in_array ( $ family , $ this -> fontlist ) ) { $ families [ $ family ] [ 'I' ] = 'I' ; continue ; } } if ( substr ( $ font , - 1 ) === 'b' ) { $ family = substr ( $ font , 0 , - 1 ) ; if ( in_array ( $ family , $ this -> fontlist ) ) { $ families [ $ family ] [ 'B' ] = 'B' ; continue ; } } // This must be a Family or incomplete set of fonts present. $ families [ $ font ] [ 'R' ] = 'R' ; } // Sort everything consistently. ksort ( $ families ) ; foreach ( $ families as $ k => $ v ) { krsort ( $ families [ $ k ] ) ; } return $ families ; }
docstring: Returns list of font families and types of fonts.
  
  @return array multidimensional array with font families as keys and B, I, BI and N as values.
docstring_tokens: Returns list of font families and types of fonts .