/'; $fontSize = 14; /** * ================================================================= * MAIN * ================================================================= */ $processed = 1; $good = 0; $error = 0; $no_maches = 0; $files = glob($path . '*.svg'); print '==================================================' . "\n"; print ' SVG Patcher' . "\n"; print '==================================================' . "\n"; print 'Processing ' . count($files) . ' files.' . "\n"; print '--------------------------------------------------' . "\n"; foreach ( $files as $filename) { print $processed . "\t" . $filename . "\t" . ' - '; $fileContent = file_get_contents($filename); $count = null; preg_match_all($regexExpr, $fileContent, $matches); $textItems = $matches[0]; foreach($textItems as $item) { if (strpos($item, ' style') !== false) { $item_to_replace = str_replace('style="', 'style="font-size:' . $fontSize . '; ', $item); } else { $item_to_replace = str_replace('