protected function shortenFontWeights($content)
    {
        $weights = array(
            'normal' => 400,
            'bold' => 700,
        );

        $callback = function ($match) use ($weights) {
            return $match[1].$weights[$match[2]];
        };

        return preg_replace_callback('/(font-weight\s*:\s*)('.implode('|', array_keys($weights)).')(?=[;}])/', $callback, $content);
    }
protected function shortenFontWeights($content)
    {
        $weights = array(
            'normal' => 400,
            'bold' => 700,
        );

        $callback = function ($match) use ($weights) {
            return $match[1].$weights[$match[2]];
        };

        return preg_replace_callback('/(font-weight\s*:\s*)('.implode('|', array_keys($weights)).')(?=[;}])/', $callback, $content);
    }
protected function shortenFontWeights ( $ content ) { $ weights = array ( 'normal' => 400 , 'bold' => 700 , ) ; $ callback = function ( $ match ) use ( $ weights ) { return $ match [ 1 ] . $ weights [ $ match [ 2 ] ] ; } ; return preg_replace_callback ( '/(font-weight\s*:\s*)(' . implode ( '|' , array_keys ( $ weights ) ) . ')(?=[;}])/' , $ callback , $ content ) ; }
Shorten CSS font weights.

@param string $content The CSS content to shorten the font weights for

@return string
Shorten CSS font weights .