コード例 #1
0
ファイル: QuickEffects.php プロジェクト: palmic/lbox
    if (!file_exists(QE_DIR)) {
        die('QuickEffects directory does not exists and cannot be created.');
    }
}
if (DEBUG && file_exists(FULL_CACHE_PATH)) {
    unlink(FULL_CACHE_PATH);
}
$image = false;
if ($FLIR['text'][0] == '@') {
    $FLIR['text'] = '\\' . $FLIR['text'];
}
if (substr_count($FLIR['text'], ' ') == strlen($FLIR['text'])) {
    exit;
}
$cmdtext = escapeshellarg($FLIR['text']);
$bounds = convertBoundingBox(imagettfbbox($FLIR['size_pts'], 0, $FLIR['font'], $FLIR['text']));
$fulltrim = '';
if ($FStyle['realFontHeight'] != 'true') {
    $bounds['height'] += 200;
    $REAL_HEIGHT_BOUNDS = $bounds;
    $fulltrim = '-trim +repage ';
}
$fore_hex = dec2hex($FLIR['color']['red'], $FLIR['color']['green'], $FLIR['color']['blue']);
$bkg_hex = $FLIR['output'] == 'png' ? 'transparent' : '"#' . dec2hex($FLIR['bkgcolor']['red'], $FLIR['bkgcolor']['green'], $FLIR['bkgcolor']['blue']) . '"';
$out_width = $bounds['width'] + 300;
$out_height = $REAL_HEIGHT_BOUNDS['height'];
$opacity = '';
if ($FLIR['opacity'] < 100 && $FLIR['opacity'] >= 0) {
    $opacity = strlen($FLIR['opacity']) == 1 ? '0' . $FLIR['opacity'] : (strlen($FLIR['opacity']) > 2 ? substr($FLIR['opacity'], 0, 2) : $FLIR['opacity']);
}
$add_width = $add_height = 0;
コード例 #2
0
function bounding_box($text, $font = NULL, $size = NULL)
{
    global $FLIR;
    if (is_null($font)) {
        $font = $FLIR['font'];
    }
    if (is_null($size)) {
        $size = $FLIR['size_pts'];
    }
    return convertBoundingBox(imagettfbbox($size, 0, $font, $text));
}
コード例 #3
0
ファイル: inc-flir.php プロジェクト: palmic/lbox
function bounding_box($text, $font = NULL, $size = NULL)
{
    global $FLIR;
    if (is_null($font)) {
        $font = $FLIR['postscript'] ? $FLIR['ps']['font'] : $FLIR['font'];
    }
    if (is_null($size)) {
        $size = $FLIR['postscript'] ? $FLIR['size'] : $FLIR['size_pts'];
    } elseif ($FLIR['postscript']) {
        $size = get_points($FLIR['dpi'], $size);
    }
    // convert to points
    if ($FLIR['postscript']) {
        return convertPSBoundingBox(imagepsbbox($text, $font, $size, $FLIR['ps']['space'], $FLIR['ps']['kerning'], 0));
    } else {
        return convertBoundingBox(imagettfbbox($size, 0, $font, $text));
    }
}