Format::setFontFamily

Format::setFontFamily -- フォントファミリを設定する

概要

require_once "Spreadsheet/Excel/Writer.php";

void Format::setFontFamily (string $font_family)

説明

フォントファミリを設定します。

パラメータ

注意

この関数は、スタティックにコールする ことはできません。

例 37-1setFontFamily() の使用法


<?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();
?>