• 设为首页
  • 点击收藏
  • 手机版
    手机扫一扫访问
    迪恩网络手机版
  • 关注官方公众号
    微信扫一扫关注
    迪恩网络公众号

PHP units2pt函数代码示例

原作者: [db:作者] 来自: [db:来源] 收藏 邀请

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



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

示例1: parse

 function parse($value)
 {
     if ($value == '') {
         return null;
     }
     // First attempt to create media with predefined name
     if (preg_match('/^(\\w+)(?:\\s+(portrait|landscape))?$/', $value, $matches)) {
         $name = $matches[1];
         $landscape = isset($matches[2]) && $matches[2] == 'landscape';
         $media =& Media::predefined($name);
         if (is_null($media)) {
             return null;
         }
         return array('size' => array('width' => $media->get_width(), 'height' => $media->get_height()), 'landscape' => $landscape);
     }
     // Second, attempt to create media with predefined size
     $parts = preg_split('/\\s+/', $value);
     $width_str = $parts[0];
     $height_str = isset($parts[1]) ? $parts[1] : $parts[0];
     $width = units2pt($width_str);
     $height = units2pt($height_str);
     if ($width == 0 || $height == 0) {
         return null;
     }
     return array('size' => array('width' => $width / mm2pt(1) / pt2pt(1), 'height' => $height / mm2pt(1) / pt2pt(1)), 'landscape' => false);
 }
开发者ID:dadigo,项目名称:simpleinvoices,代码行数:26,代码来源:css.size.inc.php


示例2: units2pt

 /**
  * Converts the absolute lengths to the device points
  *
  * @param float $font_size Font size to use during conversion of 'ex' and 'em' units
  */
 function units2pt($font_size)
 {
     if (!$this->x_percentage) {
         $this->x = units2pt($this->x, $font_size);
     }
     if (!$this->y_percentage) {
         $this->y = units2pt($this->y, $font_size);
     }
 }
开发者ID:VUW-SIM-FIS,项目名称:emiemi,代码行数:14,代码来源:background.position.php


示例3: punits2pt

function punits2pt($value, $font_size)
{
    $value = trim($value);
    // Check if current value is percentage
    if (substr($value, strlen($value) - 1, 1) === "%") {
        return array((double) $value, true);
    } else {
        return array(units2pt($value, $font_size), false);
    }
}
开发者ID:CartworksPlatform,项目名称:cartworksplatform,代码行数:10,代码来源:utils_units.php


示例4: get_base_font_size

function get_base_font_size()
{
    global $g_font_size;
    for ($i = 0; $i < count($g_font_size); $i++) {
        $unit = value::unit_from_string($g_font_size[$i]);
        if ($unit != UNIT_EX && $unit != UNIT_EM) {
            $font_size = units2pt($g_font_size[$i]);
            for ($j = $i - 1; $j >= 0; $j--) {
                $font_size = units2pt($g_font_size[$j], $font_size);
            }
            return $font_size;
        }
    }
    return 0;
}
开发者ID:raimundlandig,项目名称:winkel.de-DEV,代码行数:15,代码来源:css.font.inc.php


示例5: RadioBox

 function RadioBox($checked, $value, $group_name)
 {
     // Call parent constructor
     $this->GenericBox();
     // Check the box state
     $this->_checked = $checked;
     /**
      * Store the form value for this radio button
      */
     $this->_value = trim($value);
     $this->_group_name = $group_name;
     // Setup box size:
     $this->default_baseline = units2pt(RADIOBUTTON_SIZE);
     $this->height = units2pt(RADIOBUTTON_SIZE);
     $this->width = units2pt(RADIOBUTTON_SIZE);
     $this->setCSSProperty(CSS_DISPLAY, '-radio');
 }
开发者ID:dadigo,项目名称:simpleinvoices,代码行数:17,代码来源:box.radiobutton.php


示例6: RadioBox

 function RadioBox($checked, $value)
 {
     // Call parent constructor
     $this->GenericFormattedBox();
     // Check the box state
     $this->_checked = $checked;
     /**
      * Store the form value for this radio button
      */
     $this->_value = trim($value);
     $handler =& get_css_handler('-html2ps-form-radiogroup');
     $this->_group_name = $handler->get();
     // Setup box size:
     $this->default_baseline = units2pt(CHECKBOX_SIZE);
     $this->height = units2pt(CHECKBOX_SIZE);
     $this->width = units2pt(CHECKBOX_SIZE);
 }
开发者ID:raimundlandig,项目名称:winkel.de-DEV,代码行数:17,代码来源:box.radiobutton.php


示例7: GenericBox

 function GenericBox()
 {
     $this->_left = 0;
     $this->_top = 0;
     $this->baseline = 0;
     $this->default_baseline = 0;
     // Generic CSS properties
     // Save CSS property values
     $base_font_size = get_base_font_size();
     // 'color'
     $handler = get_css_handler('color');
     $this->color = $handler->get();
     // 'font-size'
     $this->font_size = units2pt(get_font_size(), $base_font_size);
     // 'font-family'
     $this->family = get_font_family();
     // 'font-weight'
     $this->weight = get_font_weight();
     // 'font-style'
     $this->style = get_font_style();
     // 'text-decoration'
     $handler = get_css_handler('text-decoration');
     $this->decoration = $handler->get();
 }
开发者ID:raimundlandig,项目名称:winkel.de-DEV,代码行数:24,代码来源:box.generic.php


示例8: reflow

 function reflow(&$parent, &$context)
 {
     GenericFormattedBox::reflow($parent, $context);
     // Determine upper-left _content_ corner position of current box
     $this->put_left($parent->get_left_padding());
     $this->put_top($parent->get_top_padding());
     // Legends will not wrap
     $this->put_full_width($this->get_max_width($context));
     // Reflow contents
     $this->reflow_content($context);
     // Adjust legend position
     $height = $this->get_full_height();
     $this->offset(units2pt(LEGEND_HORIZONTAL_OFFSET) + $this->get_extra_left(), $height / 2);
     // Adjust parent position
     $parent->offset(0, -$height / 2);
     // Adjust parent content position
     for ($i = 0; $i < count($parent->content); $i++) {
         if ($parent->content[$i]->uid != $this->uid) {
             $parent->content[$i]->offset(0, -$height / 2);
         }
     }
     $parent->_current_y -= $height / 2;
     $parent->extend_height($this->get_bottom_margin());
 }
开发者ID:isantiago,项目名称:foswiki,代码行数:24,代码来源:box.legend.php


示例9: units2pt

 function units2pt($base)
 {
     $this->value = units2pt($this->value, $base);
 }
开发者ID:raimundlandig,项目名称:winkel.de-DEV,代码行数:4,代码来源:css.padding.inc.php


示例10: CheckBox

 /**
  * Create a new checkbox element with the given state
  * 
  * @param $checked flag inidicating if this box should be checked
  * 
  * @see CheckBox::create()
  */
 function CheckBox($checked, $name, $value)
 {
     $this->GenericFormattedBox();
     $this->_checked = $checked;
     $this->_name = trim($name);
     $this->_value = trim($value);
     /**
      * Check box size is constant (defined in config.inc.php) and is never affected
      * neither by CSS nor HTML.
      * 
      * @see CHECKBOX_SIZE
      */
     $this->default_baseline = units2pt(CHECKBOX_SIZE);
     $this->height = units2pt(CHECKBOX_SIZE);
     $this->width = units2pt(CHECKBOX_SIZE);
 }
开发者ID:raimundlandig,项目名称:winkel.de-DEV,代码行数:23,代码来源:box.checkbutton.php


示例11: _units2pt

 function _units2pt($base)
 {
     $this->width = units2pt($this->width, $base);
 }
开发者ID:isantiago,项目名称:foswiki,代码行数:4,代码来源:width.php


示例12: setup_dimensions

 function setup_dimensions()
 {
     $this->default_baseline = units2pt(CHECKBOX_SIZE);
     $this->height = units2pt(CHECKBOX_SIZE);
     $this->width = units2pt(CHECKBOX_SIZE);
 }
开发者ID:VUW-SIM-FIS,项目名称:emiemi,代码行数:6,代码来源:box.checkbutton.php


示例13: image_ry

 function image_ry($image, $x, $y, $height, $bottom, $ox, $oy, $scale)
 {
     $tmpname = $this->_mktempimage($image);
     // Fill part to the bottom
     $cy = $y;
     while ($cy + $height > $bottom) {
         $tx = $x;
         $ty = $cy + units2pt(imagesy($image));
         $this->_coords2pdf($tx, $ty);
         $this->pdf->Image($tmpname, $tx, $ty, imagesx($image) * $scale, imagesy($image) * $scale, "png");
         $cy -= $height;
     }
     // Fill part to the top
     $cy = $y;
     while ($cy - $height < $y + $oy) {
         $tx = $x;
         $ty = $cy + units2pt(imagesy($image));
         $this->_coords2pdf($tx, $ty);
         $this->pdf->Image($tmpname, $tx, $ty, imagesx($image) * $scale, imagesy($image) * $scale, "png");
         $cy += $height;
     }
     unlink($tmpname);
 }
开发者ID:raimundlandig,项目名称:winkel.de-DEV,代码行数:23,代码来源:output.fpdf.class.php


示例14: EdgePDF

 function EdgePDF($edge)
 {
     $this->_width = units2pt($edge['width']);
     $this->color = new Color($edge['color'], is_transparent($edge['color']));
     $this->style = $edge['style'];
 }
开发者ID:raimundlandig,项目名称:winkel.de-DEV,代码行数:6,代码来源:css.border.inc.php


示例15: reflow

 /**
  * Layout current checkbox element. Note that most CSS properties do not apply to the 
  * checkboxes; i.e. margin/padding values are ignored, checkboxes always aligned to 
  * to bottom of current line, etc.
  * 
  * @param GenericContainerBox $parent
  * @param FlowContext $context Context object describing current flow parameters 
  * 
  * @return Boolean flag indicating the error/success state; 'null' value in case of critical error 
  */
 function reflow(&$parent, &$context)
 {
     GenericFormattedBox::reflow($parent, $context);
     /**
      * Check box size is constant (defined in config.inc.php) and is never affected
      * neither by CSS nor HTML.
      * 
      * @see CHECKBOX_SIZE
      */
     $this->default_baseline = units2pt(CHECKBOX_SIZE);
     $this->height = units2pt(CHECKBOX_SIZE);
     $this->width = units2pt(CHECKBOX_SIZE);
     // set default baseline
     $this->baseline = $this->default_baseline;
     //     // Vertical-align
     //     $this->_apply_vertical_align($parent);
     /**
      * append to parent line box
      */
     $parent->append_line($this);
     /**
      * Determine coordinates of upper-left margin corner
      */
     $this->guess_corner($parent);
     /**
      * Offset parent current X coordinate
      */
     $parent->_current_x += $this->get_full_width();
     /**
      * Extend parents height to fit the checkbox
      */
     $parent->extend_height($this->get_bottom_margin());
 }
开发者ID:bqevin,项目名称:processmaker,代码行数:43,代码来源:box.checkbutton.php


示例16: GenericFormattedBox

 function GenericFormattedBox()
 {
     $this->GenericBox();
     $base_font_size = get_base_font_size();
     // 'background'
     $handler = get_css_handler('background');
     $this->background = $handler->get();
     $this->background = $this->background->copy();
     $this->background->units2pt($base_font_size);
     // 'border'
     $this->border = new BorderPDF(get_border());
     // '-cellpadding'
     $handler = get_css_handler('-cellpadding');
     $this->cellpadding = units2pt($handler->get(), $base_font_size);
     // '-cellspacing'
     $handler = get_css_handler('-cellspacing');
     $this->cellspacing = units2pt($handler->get(), $base_font_size);
     // 'clear'
     $handler = get_css_handler('clear');
     $this->clear = $handler->get();
     // 'content'
     $handler = get_css_handler('content');
     $this->content_pseudoelement = $handler->get();
     // 'display'
     $handler = get_css_handler('display');
     $this->display = $handler->get();
     // 'float'
     $handler = get_css_handler('float');
     $this->float = $handler->get();
     // 'height'
     $this->_height_constraint = HCConstraint::create($this);
     $this->_height_constraint->units2pt($base_font_size);
     // $this->height = $this->_height_constraint->apply(0, $this);
     $this->height = 0;
     // 'line-height'
     $this->line_height = get_line_height();
     $this->line_height = $this->line_height->copy();
     $this->line_height->units2pt($base_font_size);
     // 'list-style'
     $handler = get_css_handler('list-style');
     $this->list_style = $handler->get();
     $this->list_style = $this->list_style->copy();
     // 'margin'
     $handler = get_css_handler('margin');
     $this->margin = $handler->get();
     $this->margin = $this->margin->copy();
     $this->margin->units2pt($base_font_size);
     // 'overflow'
     $handler = get_css_handler('overflow');
     $this->overflow = $handler->get();
     // 'padding'
     $handler = get_css_handler('padding');
     $this->padding = $handler->get();
     $this->padding = $this->padding->copy();
     $this->padding->units2pt($base_font_size);
     // 'page-break-after'
     $handler = get_css_handler('page-break-after');
     $this->page_break_after = $handler->get();
     // 'position'
     $handler = get_css_handler('position');
     $this->position = $handler->get();
     // 'text-align'
     $handler = get_css_handler('text-align');
     $this->text_align = $handler->get();
     // 'text-indent'
     $handler = get_css_handler('text-indent');
     $this->text_indent = $handler->get();
     $this->text_indent = $this->text_indent->copy();
     $this->text_indent->units2pt($base_font_size);
     // 'vertical-align'
     $handler = get_css_handler('vertical-align');
     $this->vertical_align = $handler->get();
     // 'visibility'
     $handler = get_css_handler('visibility');
     $this->visibility = $handler->get();
     // 'width'
     $handler = get_css_handler('width');
     $this->_width_constraint = $handler->get();
     $this->_width_constraint = $this->_width_constraint->copy();
     $this->_width_constraint->units2pt($base_font_size);
     $this->width = $this->_width_constraint->apply(0, 0);
     // 'white-space'
     $handler = get_css_handler('white-space');
     $this->white_space = $handler->get();
     // CSS positioning properties
     // 'left'
     $handler = get_css_handler('left');
     $value = $handler->get();
     $this->left = $value;
     // 'top'
     $handler = get_css_handler('top');
     $this->top = $handler->get();
     // 'bottom'
     // TODO: automatic height calculation
     $handler = get_css_handler('bottom');
     $this->bottom = $handler->get();
     if (!is_null($this->bottom)) {
         $this->bottom = units2pt($this->bottom, $base_font_size);
     }
     // 'right'
//.........这里部分代码省略.........
开发者ID:raimundlandig,项目名称:winkel.de-DEV,代码行数:101,代码来源:box.generic.formatted.php


示例17: units2pt

 function units2pt($base)
 {
     $this->raw_value[0] = units2pt($this->raw_value[0], $base);
 }
开发者ID:VUW-SIM-FIS,项目名称:emiemi,代码行数:4,代码来源:value.text-indent.class.php


示例18: units2pt

 function units2pt($base)
 {
     $this->length = units2pt($this->length, $base);
 }
开发者ID:VUW-SIM-FIS,项目名称:emiemi,代码行数:4,代码来源:value.line-height.class.php


示例19: pdf

 function pdf()
 {
     return $this->get() === null ? null : units2pt($this->get());
 }
开发者ID:raimundlandig,项目名称:winkel.de-DEV,代码行数:4,代码来源:css.right.inc.php


示例20: units2pt_value

 function units2pt_value(&$value, $base)
 {
     if (is_null($value)) {
         return;
     }
     if (!$value[1]) {
         $value[0] = units2pt($value[0], $base);
     }
 }
开发者ID:raimundlandig,项目名称:winkel.de-DEV,代码行数:9,代码来源:height.php



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


鲜花

握手

雷人

路过

鸡蛋
该文章已有0人参与评论

请发表评论

全部评论

专题导读
上一篇:
PHP unix_system_HUP函数代码示例发布时间:2022-05-23
下一篇:
PHP unique_marker函数代码示例发布时间:2022-05-23
热门推荐
阅读排行榜

扫描微信二维码

查看手机版网站

随时了解更新最新资讯

139-2527-9053

在线客服(服务时间 9:00~18:00)

在线QQ客服
地址:深圳市南山区西丽大学城创智工业园
电邮:jeky_zhao#qq.com
移动电话:139-2527-9053

Powered by 互联科技 X3.4© 2001-2213 极客世界.|Sitemap