Рекурсивный акроним словосочетания «PHP: Hypertext Preprocessor»
Добро пожаловать на форум PHP программистов!
За последние 24 часа нас посетили 17194 программиста и 1833 робота. Сейчас ищут 1737 программистов ...
Format::setFontFamily
Вернуться к: Spreadsheet_Excel_Writer
Format::setFontFamily
Format::setFontFamily – Sets the font family.
Synopsis
require_once "Spreadsheet/Excel/Writer.php";
void Format::setFontFamily ( string $font_family )
Sets the font family.
Parameter
-
string $font_family - The font family name. Possible values are: 'Times New Roman', 'Arial', 'Courier'.
Note
This function can not be called statically.
Example
Using setFontFamily()
<?php
require_once 'Spreadsheet/Excel/Writer.php';
$workbook = new Spreadsheet_Excel_Writer();
$worksheet =& $workbook->addWorksheet();
$format_times =& $workbook->addFormat();
$format_times->setFontFamily('Times New Roman');
$format_courier =& $workbook->addFormat();
$format_courier->setFontFamily('Courier');
$worksheet->write(0, 0, "Hello World, Arial (default)");
$worksheet->write(1, 0, "Hello World, Times New Roman", $format_times);
$worksheet->write(2, 0, "Hello World, Courier", $format_courier);
$workbook->send('fonts.xls');
$workbook->close();
?>
Вернуться к: Spreadsheet_Excel_Writer