I am trying to make a presentation from Laravel using the PhpPresentation library.
I want to change the font of the presentation from default to "Century Gothic".
Using ->setName($pValue = 'Century Gothic');
is not working.
I am trying to make a presentation from Laravel using the PhpPresentation library.
I want to change the font of the presentation from default to "Century Gothic".
Using ->setName($pValue = 'Century Gothic');
is not working.
There is no way for defining the default font in a presentation.
I created an issue : https://github.com/PHPOffice/PHPPresentation/issues/237
The only way for the moment is : define the font in Century Gothic for each shape.
See my example:
$shape = $currentSlide->createRichTextShape()
->setHeight(50)
->setWidth(200)
->setOffsetX(760)
->setOffsetY(235);
$textRun = $shape->createTextRun($texto201);
$textRun->getFont()->setBold(false)
->setItalic(true)
->setSize(24)
->setName('Trebuchet MS')
Use ->setName('Trebuchet MS')
to change.
@Progi1984
in PhpOffice\PhpPresentation\Style\Font you can change the __construc() method $this->name = 'Calibri';
So always that you instanced new font is default