support for eastAsia fontstyle
support for eastAsia fontstyle add sample 10
This commit is contained in:
parent
3daaffa183
commit
af1a591271
|
|
@ -380,6 +380,7 @@ class PHPWord_Writer_Word2007_Base extends PHPWord_Writer_Word2007_WriterPart
|
||||||
$underline = $style->getUnderline();
|
$underline = $style->getUnderline();
|
||||||
$superscript = $style->getSuperScript();
|
$superscript = $style->getSuperScript();
|
||||||
$subscript = $style->getSubScript();
|
$subscript = $style->getSubScript();
|
||||||
|
$hint='';
|
||||||
|
|
||||||
$objWriter->startElement('w:rPr');
|
$objWriter->startElement('w:rPr');
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -0,0 +1,30 @@
|
||||||
|
<?php
|
||||||
|
|
||||||
|
error_reporting(E_ALL);
|
||||||
|
|
||||||
|
if(php_sapi_name() == 'cli' && empty($_SERVER['REMOTE_ADDR'])) {
|
||||||
|
define('EOL', PHP_EOL);
|
||||||
|
} else {
|
||||||
|
define('EOL', '<br />');
|
||||||
|
}
|
||||||
|
|
||||||
|
require_once '../Classes/PHPWord.php';
|
||||||
|
|
||||||
|
// New Word Document
|
||||||
|
echo date('H:i:s') , ' Create new PHPWord object' , EOL;
|
||||||
|
$PHPWord = new PHPWord();
|
||||||
|
$section = $PHPWord->createSection();
|
||||||
|
$header = array('size' => 16, 'bold' => true);
|
||||||
|
//1.Use EastAisa FontStyle
|
||||||
|
$section->addText('中文楷体样式测试',array('name' => '楷体', 'size' => 16, 'color' => '1B2232'));
|
||||||
|
|
||||||
|
// Save File
|
||||||
|
echo date('H:i:s') , ' Write to Word2007 format' , EOL;
|
||||||
|
$objWriter = PHPWord_IOFactory::createWriter($PHPWord, 'Word2007');
|
||||||
|
$objWriter->save(str_replace('.php', '.docx', __FILE__));
|
||||||
|
|
||||||
|
// Echo memory peak usage
|
||||||
|
echo date('H:i:s') , ' Peak memory usage: ' , (memory_get_peak_usage(true) / 1024 / 1024) , ' MB' , EOL;
|
||||||
|
|
||||||
|
// Echo done
|
||||||
|
echo date('H:i:s') , ' Done writing file' , EOL;
|
||||||
Loading…
Reference in New Issue