Source for file Font.php
Documentation is available at Font.php
* Transforms FONT tags to the proper form (SPAN with CSS styling)
* This transformation takes the three proprietary attributes of FONT and
* transforms them into their corresponding CSS attributes. These are color,
* @note Size is an interesting case because it doesn't map cleanly to CSS.
* http://style.cleverchimp.com/font_size_intervals/altintervals.html
* for reasonable mappings.
public function transform($tag, $config, $context) {
// handle color transform
if (isset
($attr['color'])) {
$prepend_style .=
'color:' .
$attr['color'] .
';';
if (isset
($attr['face'])) {
$prepend_style .=
'font-family:' .
$attr['face'] .
';';
if (isset
($attr['size'])) {
// normalize large numbers
if ($attr['size']{0} ==
'+' ||
$attr['size']{0} ==
'-') {
$size = (int)
$attr['size'];
if ($size < -
2) $attr['size'] =
'-2';
if ($size >
4) $attr['size'] =
'+4';
$size = (int)
$attr['size'];
if ($size >
7) $attr['size'] =
'7';
$prepend_style .=
'font-size:' .
$attr['style'] = isset
($attr['style']) ?
$prepend_style .
$attr['style'] :
Documentation generated on Thu, 19 Jun 2008 18:49:14 -0400 by phpDocumentor 1.4.2