Exemplo n.º 1
0
        echo "Copying {$src} to {$dest}...\n";
        if (!copy($src, $dest)) {
            throw new DOMPDF_Exception("Unable to copy '{$src}' to '{$dest}'");
        }
        $entry_name = mb_substr($dest, 0, -4);
        echo "Generating Adobe Font Metrics for {$entry_name}...\n";
        $font_obj = Font::load($dest);
        $font_obj->saveAdobeFontMetrics("{$entry_name}.ufm");
        $entry[$var] = $entry_name;
    }
    // Store the fonts in the lookup table
    Font_Metrics::set_font_family($fontname, $entry);
    // Save the changes
    Font_Metrics::save_font_families();
}
// If installing system fonts (may take a long time)
if ($_SERVER["argv"][1] === "system_fonts") {
    $fonts = Font_Metrics::get_system_fonts();
    foreach ($fonts as $family => $files) {
        echo " >> Installing '{$family}'... \n";
        if (!isset($files["normal"])) {
            echo "No 'normal' style font file\n";
        } else {
            install_font_family($family, @$files["normal"], @$files["bold"], @$files["italic"], @$files["bold_italic"]);
            echo "Done !\n";
        }
        echo "\n";
    }
} else {
    call_user_func_array("install_font_family", array_slice($_SERVER["argv"], 1));
}