ILIAS  Release_4_0_x_branch Revision 61816
 All Data Structures Namespaces Files Functions Variables Groups Pages
PHPExcel_Writer_Excel5_Font Class Reference
+ Collaboration diagram for PHPExcel_Writer_Excel5_Font:

Public Member Functions

 __construct (PHPExcel_Style_Font $font=null)
 Constructor.
 setColorIndex ($colorIndex)
 Set the color index.
 writeFont ()
 Get font record data.
 setBIFFVersion ($BIFFVersion)
 Set BIFF version.

Private Member Functions

 _mapBold ($bold)
 Map to BIFF5-BIFF8 codes for bold.
 _mapUnderline ($underline)
 Map underline.

Private Attributes

 $_BIFFVersion
 $_colorIndex
 $_font

Detailed Description

Definition at line 51 of file Font.php.

Constructor & Destructor Documentation

PHPExcel_Writer_Excel5_Font::__construct ( PHPExcel_Style_Font  $font = null)

Constructor.

Parameters
PHPExcel_Style_Font$font

Definition at line 79 of file Font.php.

{
$this->_BIFFVersion = 0x0600;
$this->_colorIndex = 0x7FFF;
$this->_font = $font;
}

Member Function Documentation

PHPExcel_Writer_Excel5_Font::_mapBold (   $bold)
private

Map to BIFF5-BIFF8 codes for bold.

Parameters
boolean$bold
Returns
int

Definition at line 184 of file Font.php.

Referenced by writeFont().

{
if ($bold) {
return 0x2BC;
}
return 0x190;
}

+ Here is the caller graph for this function:

PHPExcel_Writer_Excel5_Font::_mapUnderline (   $underline)
private

Map underline.

Parameters
string
Returns
int

Definition at line 197 of file Font.php.

References PHPExcel_Style_Font\UNDERLINE_DOUBLE, PHPExcel_Style_Font\UNDERLINE_DOUBLEACCOUNTING, PHPExcel_Style_Font\UNDERLINE_NONE, PHPExcel_Style_Font\UNDERLINE_SINGLE, and PHPExcel_Style_Font\UNDERLINE_SINGLEACCOUNTING.

Referenced by writeFont().

{
switch ($underline) {
default: return 0x00;
}
}

+ Here is the caller graph for this function:

PHPExcel_Writer_Excel5_Font::setBIFFVersion (   $BIFFVersion)

Set BIFF version.

Parameters
int$BIFFVersion

Definition at line 173 of file Font.php.

Referenced by PHPExcel_Writer_Excel5_Workbook\addXfWriter().

{
$this->_BIFFVersion = $BIFFVersion;
}

+ Here is the caller graph for this function:

PHPExcel_Writer_Excel5_Font::setColorIndex (   $colorIndex)

Set the color index.

Parameters
int$colorIndex

Definition at line 91 of file Font.php.

{
$this->_colorIndex = $colorIndex;
}
PHPExcel_Writer_Excel5_Font::writeFont ( )

Get font record data.

Returns
string

Definition at line 101 of file Font.php.

References $_colorIndex, $data, _mapBold(), _mapUnderline(), elseif(), PHPExcel_Shared_Font\getCharsetFromFontName(), and PHPExcel_Shared_String\UTF8toBIFF8UnicodeShort().

{
$font_outline = 0;
$font_shadow = 0;
$icv = $this->_colorIndex; // Index to color palette
if ($this->_font->getSuperScript()) {
$sss = 1;
} else if ($this->_font->getSubScript()) {
$sss = 2;
} else {
$sss = 0;
}
$bFamily = 0; // Font family
$bCharSet = PHPExcel_Shared_Font::getCharsetFromFontName($this->_font->getName()); // Character set
$record = 0x31; // Record identifier
$reserved = 0x00; // Reserved
$grbit = 0x00; // Font attributes
if ($this->_font->getItalic()) {
$grbit |= 0x02;
}
if ($this->_font->getStrikethrough()) {
$grbit |= 0x08;
}
if ($font_outline) {
$grbit |= 0x10;
}
if ($font_shadow) {
$grbit |= 0x20;
}
if ($this->_BIFFVersion == 0x0500) {
$data = pack("vvvvvCCCCC",
$this->_font->getSize() * 20,
$grbit,
$icv,
$this->_mapBold($this->_font->getBold()),
$sss,
$this->_mapUnderline($this->_font->getUnderline()),
$bFamily,
$bCharSet,
$reserved,
strlen($this->_font->getName())
);
$data .= $this->_font->getName();
} elseif ($this->_BIFFVersion == 0x0600) {
$data = pack("vvvvvCCCC",
$this->_font->getSize() * 20,
$grbit,
$icv,
$this->_mapBold($this->_font->getBold()),
$sss,
$this->_mapUnderline($this->_font->getUnderline()),
$bFamily,
$bCharSet,
$reserved
);
}
$length = strlen($data);
$header = pack("vv", $record, $length);
return($header . $data);
}

+ Here is the call graph for this function:

Field Documentation

PHPExcel_Writer_Excel5_Font::$_BIFFVersion
private

Definition at line 58 of file Font.php.

PHPExcel_Writer_Excel5_Font::$_colorIndex
private

Definition at line 65 of file Font.php.

Referenced by writeFont().

PHPExcel_Writer_Excel5_Font::$_font
private

Definition at line 72 of file Font.php.


The documentation for this class was generated from the following file: