public function merge_font($input_css) {
		$font_prop_default = & $this->parser->data['csstidy']['font_prop_default'];
		$new_font_value = '';
		$important = '';
		// Skip if not font-family and font-size set
		if (isset($input_css['font-family']) && isset($input_css['font-size']) && $input_css['font-family'] != 'inherit') {
			// fix several words in font-family - add quotes
			if (isset($input_css['font-family'])) {
				$families = explode(',', $input_css['font-family']);
				$result_families = array();
				foreach ($families as $family) {
					$family = trim($family);
					$len = strlen($family);
					if (strpos($family, ' ') &&
									!(($family{0} === '"' && $family{$len - 1} === '"') ||
									($family{0} === "'" && $family{$len - 1} === "'"))) {
						$family = '"' . $family . '"';
					}
					$result_families[] = $family;
				}
				$input_css['font-family'] = implode(',', $result_families);
			}
			foreach ($font_prop_default as $font_property => $default_value) {

				// Skip if property does not exist
				if (!isset($input_css[$font_property])) {
					continue;
				}

				$cur_value = $input_css[$font_property];

				// Skip if default value is used
				if ($cur_value === $default_value) {
					continue;
				}

				// Remove !important
				if ($this->parser->is_important($cur_value)) {
					$important = '!important';
					$cur_value = $this->parser->gvw_important($cur_value);
				}

				$new_font_value .= $cur_value;
				// Add delimiter
				$new_font_value .= ( $font_property === 'font-size' &&
								isset($input_css['line-height'])) ? '/' : ' ';
			}

			$new_font_value = trim($new_font_value);

			// Delete all font-properties
			foreach ($font_prop_default as $font_property => $default_value) {
				if ($font_property !== 'font' || !$new_font_value)
					unset($input_css[$font_property]);
			}

			// Add new font property
			if ($new_font_value !== '') {
				$input_css['font'] = $new_font_value . $important;
			}
		}

		return $input_css;
	}
public function merge_font($input_css) {
		$font_prop_default = & $this->parser->data['csstidy']['font_prop_default'];
		$new_font_value = '';
		$important = '';
		// Skip if not font-family and font-size set
		if (isset($input_css['font-family']) && isset($input_css['font-size']) && $input_css['font-family'] != 'inherit') {
			// fix several words in font-family - add quotes
			if (isset($input_css['font-family'])) {
				$families = explode(',', $input_css['font-family']);
				$result_families = array();
				foreach ($families as $family) {
					$family = trim($family);
					$len = strlen($family);
					if (strpos($family, ' ') &&
									!(($family{0} === '"' && $family{$len - 1} === '"') ||
									($family{0} === "'" && $family{$len - 1} === "'"))) {
						$family = '"' . $family . '"';
					}
					$result_families[] = $family;
				}
				$input_css['font-family'] = implode(',', $result_families);
			}
			foreach ($font_prop_default as $font_property => $default_value) {

				// Skip if property does not exist
				if (!isset($input_css[$font_property])) {
					continue;
				}

				$cur_value = $input_css[$font_property];

				// Skip if default value is used
				if ($cur_value === $default_value) {
					continue;
				}

				// Remove !important
				if ($this->parser->is_important($cur_value)) {
					$important = '!important';
					$cur_value = $this->parser->gvw_important($cur_value);
				}

				$new_font_value .= $cur_value;
				// Add delimiter
				$new_font_value .= ( $font_property === 'font-size' &&
								isset($input_css['line-height'])) ? '/' : ' ';
			}

			$new_font_value = trim($new_font_value);

			// Delete all font-properties
			foreach ($font_prop_default as $font_property => $default_value) {
				if ($font_property !== 'font' || !$new_font_value)
					unset($input_css[$font_property]);
			}

			// Add new font property
			if ($new_font_value !== '') {
				$input_css['font'] = $new_font_value . $important;
			}
		}

		return $input_css;
	}
public function merge_font ( $ input_css ) { $ font_prop_default = & $ this -> parser -> data [ 'csstidy' ] [ 'font_prop_default' ] ; $ new_font_value = '' ; $ important = '' ; // Skip if not font-family and font-size set if ( isset ( $ input_css [ 'font-family' ] ) && isset ( $ input_css [ 'font-size' ] ) && $ input_css [ 'font-family' ] != 'inherit' ) { // fix several words in font-family - add quotes if ( isset ( $ input_css [ 'font-family' ] ) ) { $ families = explode ( ',' , $ input_css [ 'font-family' ] ) ; $ result_families = array ( ) ; foreach ( $ families as $ family ) { $ family = trim ( $ family ) ; $ len = strlen ( $ family ) ; if ( strpos ( $ family , ' ' ) && ! ( ( $ family { 0 } === '"' && $ family { $ len - 1 } === '"' ) || ( $ family { 0 } === "'" && $ family { $ len - 1 } === "'" ) ) ) { $ family = '"' . $ family . '"' ; } $ result_families [ ] = $ family ; } $ input_css [ 'font-family' ] = implode ( ',' , $ result_families ) ; } foreach ( $ font_prop_default as $ font_property => $ default_value ) { // Skip if property does not exist if ( ! isset ( $ input_css [ $ font_property ] ) ) { continue ; } $ cur_value = $ input_css [ $ font_property ] ; // Skip if default value is used if ( $ cur_value === $ default_value ) { continue ; } // Remove !important if ( $ this -> parser -> is_important ( $ cur_value ) ) { $ important = '!important' ; $ cur_value = $ this -> parser -> gvw_important ( $ cur_value ) ; } $ new_font_value .= $ cur_value ; // Add delimiter $ new_font_value .= ( $ font_property === 'font-size' && isset ( $ input_css [ 'line-height' ] ) ) ? '/' : ' ' ; } $ new_font_value = trim ( $ new_font_value ) ; // Delete all font-properties foreach ( $ font_prop_default as $ font_property => $ default_value ) { if ( $ font_property !== 'font' || ! $ new_font_value ) unset ( $ input_css [ $ font_property ] ) ; } // Add new font property if ( $ new_font_value !== '' ) { $ input_css [ 'font' ] = $ new_font_value . $ important ; } } return $ input_css ; }
Merges all fonts properties
@param array $input_css
@return array
@version 1.3
@see dissolve_short_font()
Merges all fonts properties