You are here

private function CSSCompression_Individuals::font in Advanced CSS/JS Aggregation 6

Same name and namespace in other branches
  1. 7 advagg_css_compress/css-compressor-3.x/src/lib/Individuals.inc \CSSCompression_Individuals::font()

Special font conversions

Parameters

(string) val: property value:

1 call to CSSCompression_Individuals::font()
CSSCompression_Individuals::individuals in advagg_css_compress/css-compressor-3.x/src/lib/Individuals.inc
Runs special unit/directional compressions

File

advagg_css_compress/css-compressor-3.x/src/lib/Individuals.inc, line 228

Class

CSSCompression_Individuals
CSS Compressor [VERSION] [DATE] Corey Hart @ http://www.codenothing.com

Code

private function font($val) {

  // Split out the font-size/line-height split and run through numerical handlers
  if (preg_match($this->rsplitter, $val, $match, PREG_OFFSET_CAPTURE)) {
    $size = $this->Numeric
      ->numeric($match[2][0]);
    $height = $this->Numeric
      ->numeric($match[3][0]);
    $concat = $match[1][0] . $size . '/' . $height . $match[4][0];
    $val = substr_replace($val, $concat, $match[0][1], strlen($match[0][0]));
  }
  return $val;
}