本文整理汇总了PHP中TCPDF_STATIC::getCSSdataArray方法的典型用法代码示例。如果您正苦于以下问题:PHP TCPDF_STATIC::getCSSdataArray方法的具体用法?PHP TCPDF_STATIC::getCSSdataArray怎么用?PHP TCPDF_STATIC::getCSSdataArray使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类TCPDF_STATIC
的用法示例。
在下文中一共展示了TCPDF_STATIC::getCSSdataArray方法的1个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: getHtmlDomArray
//.........这里部分代码省略.........
}
// copy some values from parent
$parentkey = 0;
if ($key > 0) {
$parentkey = $dom[$key]['parent'];
$dom[$key]['hide'] = $dom[$parentkey]['hide'];
$dom[$key]['fontname'] = $dom[$parentkey]['fontname'];
$dom[$key]['fontstyle'] = $dom[$parentkey]['fontstyle'];
$dom[$key]['fontsize'] = $dom[$parentkey]['fontsize'];
$dom[$key]['font-stretch'] = $dom[$parentkey]['font-stretch'];
$dom[$key]['letter-spacing'] = $dom[$parentkey]['letter-spacing'];
$dom[$key]['stroke'] = $dom[$parentkey]['stroke'];
$dom[$key]['fill'] = $dom[$parentkey]['fill'];
$dom[$key]['clip'] = $dom[$parentkey]['clip'];
$dom[$key]['line-height'] = $dom[$parentkey]['line-height'];
$dom[$key]['bgcolor'] = $dom[$parentkey]['bgcolor'];
$dom[$key]['fgcolor'] = $dom[$parentkey]['fgcolor'];
$dom[$key]['strokecolor'] = $dom[$parentkey]['strokecolor'];
$dom[$key]['align'] = $dom[$parentkey]['align'];
$dom[$key]['listtype'] = $dom[$parentkey]['listtype'];
$dom[$key]['text-indent'] = $dom[$parentkey]['text-indent'];
$dom[$key]['border'] = array();
$dom[$key]['dir'] = $dom[$parentkey]['dir'];
}
// get attributes
preg_match_all('/([^=\\s]*)[\\s]*=[\\s]*"([^"]*)"/', $element, $attr_array, PREG_PATTERN_ORDER);
$dom[$key]['attribute'] = array();
// reset attribute array
while (list($id, $name) = each($attr_array[1])) {
$dom[$key]['attribute'][strtolower($name)] = $attr_array[2][$id];
}
if (!empty($css)) {
// merge CSS style to current style
list($dom[$key]['csssel'], $dom[$key]['cssdata']) = TCPDF_STATIC::getCSSdataArray($dom, $key, $css);
$dom[$key]['attribute']['style'] = TCPDF_STATIC::getTagStyleFromCSSarray($dom[$key]['cssdata']);
}
// split style attributes
if (isset($dom[$key]['attribute']['style']) and !empty($dom[$key]['attribute']['style'])) {
// get style attributes
preg_match_all('/([^;:\\s]*):([^;]*)/', $dom[$key]['attribute']['style'], $style_array, PREG_PATTERN_ORDER);
$dom[$key]['style'] = array();
// reset style attribute array
while (list($id, $name) = each($style_array[1])) {
// in case of duplicate attribute the last replace the previous
$dom[$key]['style'][strtolower($name)] = trim($style_array[2][$id]);
}
// --- get some style attributes ---
// text direction
if (isset($dom[$key]['style']['direction'])) {
$dom[$key]['dir'] = $dom[$key]['style']['direction'];
}
// display
if (isset($dom[$key]['style']['display'])) {
$dom[$key]['hide'] = trim(strtolower($dom[$key]['style']['display'])) == 'none';
}
// font family
if (isset($dom[$key]['style']['font-family'])) {
$dom[$key]['fontname'] = $this->getFontFamilyName($dom[$key]['style']['font-family']);
}
// list-style-type
if (isset($dom[$key]['style']['list-style-type'])) {
$dom[$key]['listtype'] = trim(strtolower($dom[$key]['style']['list-style-type']));
if ($dom[$key]['listtype'] == 'inherit') {
$dom[$key]['listtype'] = $dom[$parentkey]['listtype'];
}
}