0

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.

nha
  • 17,623
  • 13
  • 87
  • 133

2 Answers2

0

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.

Progi1984
  • 498
  • 3
  • 12
0

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