当前位置: 首页>>代码示例>>PHP>>正文


PHP install_font_family函数代码示例

本文整理汇总了PHP中install_font_family函数的典型用法代码示例。如果您正苦于以下问题:PHP install_font_family函数的具体用法?PHP install_font_family怎么用?PHP install_font_family使用的例子?那么恭喜您, 这里精选的函数代码示例或许可以为您提供帮助。


在下文中一共展示了install_font_family函数的2个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。

示例1: DOMPDF_Exception

        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));
}
开发者ID:fredcido,项目名称:simuweb,代码行数:31,代码来源:load_font.php

示例2: DOMPDF_Exception

            $entry[$var] = $dest;
        }
    } else {
        throw new DOMPDF_Exception("Unable to process fonts of type '{$ext}'.");
    }
    // If the extension is a ttf, try and convert the fonts to afm too
    if (mb_strtolower($ext) === ".ttf" || strtolower($ext) == ".otf") {
        foreach ($fonts as $var => $font) {
            if (is_null($font)) {
                $entry[$var] = DOMPDF_FONT_DIR . mb_substr(basename($normal), 0, -4);
                continue;
            }
            $dest = DOMPDF_FONT_DIR . mb_substr(basename($font), 0, -4);
            echo "Generating .afm for {$font}...\n";
            echo "Command: " . _TTF2AFM . " " . escapeshellarg($font) . " " . escapeshellarg($dest) . "\n";
            exec(_TTF2AFM . " " . escapeshellarg($font) . " " . escapeshellarg($dest) . " &> /dev/null", $output, $ret);
            $entry[$var] = $dest;
        }
    }
    // FIXME: how to generate afms from pfb?
    // Store the fonts in the lookup table
    Font_Metrics::set_font_family(strtolower($fontname), $entry);
    // Save the changes
    Font_Metrics::save_font_families();
}
$normal = $_SERVER["argv"][2];
$bold = isset($_SERVER["argv"][3]) ? $_SERVER["argv"][3] : null;
$italic = isset($_SERVER["argv"][4]) ? $_SERVER["argv"][4] : null;
$bold_italic = isset($_SERVER["argv"][5]) ? $_SERVER["argv"][5] : null;
install_font_family($_SERVER["argv"][1], $normal, $bold, $italic, $bold_italic);
开发者ID:jratenci,项目名称:dee,代码行数:30,代码来源:load_font.php


注:本文中的install_font_family函数示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。