src/Thujohn/Pdf/dompdf/include/style.cls.php
function get_font_family() {
  
    $DEBUGCSS=DEBUGCSS; //=DEBUGCSS; Allow override of global setting for ad hoc debug

    // Select the appropriate font.  First determine the subtype, then check
    // the specified font-families for a candidate.

    // Resolve font-weight
    $weight = $this->__get("font_weight");
    
    if ( is_numeric($weight) ) {

      if ( $weight < 600 )
        $weight = "normal";
      else
        $weight = "bold";

    } else if ( $weight === "bold" || $weight === "bolder" ) {
      $weight = "bold";

    } else {
      $weight = "normal";

    }

    // Resolve font-style
    $font_style = $this->__get("font_style");

    if ( $weight === "bold" && ($font_style === "italic" || $font_style === "oblique") )
      $subtype = "bold_italic";
    else if ( $weight === "bold" && $font_style !== "italic" && $font_style !== "oblique" )
      $subtype = "bold";
    else if ( $weight !== "bold" && ($font_style === "italic" || $font_style === "oblique") )
      $subtype = "italic";
    else
      $subtype = "normal";
    
    // Resolve the font family
    if ($DEBUGCSS) {
      print "<pre>[get_font_family:";
      print '('.$this->_props["font_family"].'.'.$font_style.'.'.$this->__get("font_weight").'.'.$weight.'.'.$subtype.')';
    }
    $families = explode(",", $this->_props["font_family"]);
    $families = array_map('trim',$families);
    reset($families);

    $font = null;
    while ( current($families) ) {
      list(,$family) = each($families);
      //remove leading and trailing string delimiters, e.g. on font names with spaces;
      //remove leading and trailing whitespace
      $family = trim($family, " \t\n\r\x0B\"'");
      if ($DEBUGCSS) print '('.$family.')';
      $font = Font_Metrics::get_font($family, $subtype);

      if ( $font ) {
        if ($DEBUGCSS)  print '('.$font.")get_font_family]\n</pre>";
        return $font;
      }
    }

    $family = null;
    if ($DEBUGCSS)  print '(default)';
    $font = Font_Metrics::get_font($family, $subtype);

    if ( $font ) {
      if ($DEBUGCSS) print '('.$font.")get_font_family]\n</pre>";
      return $font;
    }
    throw new DOMPDF_Exception("Unable to find a suitable font replacement for: '" . $this->_props["font_family"] ."'");
    
  }
function get_font_family() {
  
    $DEBUGCSS=DEBUGCSS; //=DEBUGCSS; Allow override of global setting for ad hoc debug

    // Select the appropriate font.  First determine the subtype, then check
    // the specified font-families for a candidate.

    // Resolve font-weight
    $weight = $this->__get("font_weight");
    
    if ( is_numeric($weight) ) {

      if ( $weight < 600 )
        $weight = "normal";
      else
        $weight = "bold";

    } else if ( $weight === "bold" || $weight === "bolder" ) {
      $weight = "bold";

    } else {
      $weight = "normal";

    }

    // Resolve font-style
    $font_style = $this->__get("font_style");

    if ( $weight === "bold" && ($font_style === "italic" || $font_style === "oblique") )
      $subtype = "bold_italic";
    else if ( $weight === "bold" && $font_style !== "italic" && $font_style !== "oblique" )
      $subtype = "bold";
    else if ( $weight !== "bold" && ($font_style === "italic" || $font_style === "oblique") )
      $subtype = "italic";
    else
      $subtype = "normal";
    
    // Resolve the font family
    if ($DEBUGCSS) {
      print "<pre>[get_font_family:";
      print '('.$this->_props["font_family"].'.'.$font_style.'.'.$this->__get("font_weight").'.'.$weight.'.'.$subtype.')';
    }
    $families = explode(",", $this->_props["font_family"]);
    $families = array_map('trim',$families);
    reset($families);

    $font = null;
    while ( current($families) ) {
      list(,$family) = each($families);
      //remove leading and trailing string delimiters, e.g. on font names with spaces;
      //remove leading and trailing whitespace
      $family = trim($family, " \t\n\r\x0B\"'");
      if ($DEBUGCSS) print '('.$family.')';
      $font = Font_Metrics::get_font($family, $subtype);

      if ( $font ) {
        if ($DEBUGCSS)  print '('.$font.")get_font_family]\n</pre>";
        return $font;
      }
    }

    $family = null;
    if ($DEBUGCSS)  print '(default)';
    $font = Font_Metrics::get_font($family, $subtype);

    if ( $font ) {
      if ($DEBUGCSS) print '('.$font.")get_font_family]\n</pre>";
      return $font;
    }
    throw new DOMPDF_Exception("Unable to find a suitable font replacement for: '" . $this->_props["font_family"] ."'");
    
  }
function get_font_family ( ) { $ DEBUGCSS = DEBUGCSS ; //=DEBUGCSS; Allow override of global setting for ad hoc debug // Select the appropriate font.  First determine the subtype, then check // the specified font-families for a candidate. // Resolve font-weight $ weight = $ this -> __get ( "font_weight" ) ; if ( is_numeric ( $ weight ) ) { if ( $ weight < 600 ) $ weight = "normal" ; else $ weight = "bold" ; } else if ( $ weight === "bold" || $ weight === "bolder" ) { $ weight = "bold" ; } else { $ weight = "normal" ; } // Resolve font-style $ font_style = $ this -> __get ( "font_style" ) ; if ( $ weight === "bold" && ( $ font_style === "italic" || $ font_style === "oblique" ) ) $ subtype = "bold_italic" ; else if ( $ weight === "bold" && $ font_style !== "italic" && $ font_style !== "oblique" ) $ subtype = "bold" ; else if ( $ weight !== "bold" && ( $ font_style === "italic" || $ font_style === "oblique" ) ) $ subtype = "italic" ; else $ subtype = "normal" ; // Resolve the font family if ( $ DEBUGCSS ) { print "<pre>[get_font_family:" ; print '(' . $ this -> _props [ "font_family" ] . '.' . $ font_style . '.' . $ this -> __get ( "font_weight" ) . '.' . $ weight . '.' . $ subtype . ')' ; } $ families = explode ( "," , $ this -> _props [ "font_family" ] ) ; $ families = array_map ( 'trim' , $ families ) ; reset ( $ families ) ; $ font = null ; while ( current ( $ families ) ) { list ( , $ family ) = each ( $ families ) ; //remove leading and trailing string delimiters, e.g. on font names with spaces; //remove leading and trailing whitespace $ family = trim ( $ family , " \t\n\r\x0B\"'" ) ; if ( $ DEBUGCSS ) print '(' . $ family . ')' ; $ font = Font_Metrics :: get_font ( $ family , $ subtype ) ; if ( $ font ) { if ( $ DEBUGCSS ) print '(' . $ font . ")get_font_family]\n</pre>" ; return $ font ; } } $ family = null ; if ( $ DEBUGCSS ) print '(default)' ; $ font = Font_Metrics :: get_font ( $ family , $ subtype ) ; if ( $ font ) { if ( $ DEBUGCSS ) print '(' . $ font . ")get_font_family]\n</pre>" ; return $ font ; } throw new DOMPDF_Exception ( "Unable to find a suitable font replacement for: '" . $ this -> _props [ "font_family" ] . "'" ) ; }
Getter for the 'font-family' CSS property.

Uses the {@link Font_Metrics} class to resolve the font family into an
actual font file.

@link http://www.w3.org/TR/CSS21/fonts.html#propdef-font-family
@return string
Getter for the font - family CSS property .