From 3855f9a59ec9ea7b741120306725945656bff7b3 Mon Sep 17 00:00:00 2001 From: Linda Date: Fri, 1 Sep 2023 12:38:53 -0700 Subject: [PATCH] default font to Lato (#2) --- src/PhpPresentation/Shape/Chart/Series.php | 2 +- src/PhpPresentation/Shape/Chart/Title.php | 2 +- src/PhpPresentation/Style/Bullet.php | 6 +++--- src/PhpPresentation/Style/Font.php | 6 +++--- src/PhpPresentation/Writer/PowerPoint2007/PptTheme.php | 4 ++-- tests/PhpPresentation/Tests/Shape/Chart/SeriesTest.php | 2 +- tests/PhpPresentation/Tests/Shape/Chart/TitleTest.php | 2 +- tests/PhpPresentation/Tests/Style/BulletTest.php | 6 +++--- tests/PhpPresentation/Tests/Style/FontTest.php | 6 +++--- .../Tests/Writer/ODPresentation/ObjectsChartTest.php | 2 +- .../Tests/Writer/PowerPoint2007/PptSlidesTest.php | 6 +++--- 11 files changed, 22 insertions(+), 22 deletions(-) diff --git a/src/PhpPresentation/Shape/Chart/Series.php b/src/PhpPresentation/Shape/Chart/Series.php index ede269d5a..c29fd1e8a 100644 --- a/src/PhpPresentation/Shape/Chart/Series.php +++ b/src/PhpPresentation/Shape/Chart/Series.php @@ -153,7 +153,7 @@ public function __construct(string $title = 'Series Title', array $values = []) { $this->fill = new Fill(); $this->font = new Font(); - $this->font->setName('Calibri'); + $this->font->setName(); $this->font->setSize(9); $this->marker = new Marker(); diff --git a/src/PhpPresentation/Shape/Chart/Title.php b/src/PhpPresentation/Shape/Chart/Title.php index a03165724..616ed90a0 100644 --- a/src/PhpPresentation/Shape/Chart/Title.php +++ b/src/PhpPresentation/Shape/Chart/Title.php @@ -99,7 +99,7 @@ public function __construct() { $this->alignment = new Alignment(); $this->font = new Font(); - $this->font->setName('Calibri'); + $this->font->setName(); $this->font->setSize(18); } diff --git a/src/PhpPresentation/Style/Bullet.php b/src/PhpPresentation/Style/Bullet.php index dd3729d5d..70509ff7d 100644 --- a/src/PhpPresentation/Style/Bullet.php +++ b/src/PhpPresentation/Style/Bullet.php @@ -128,7 +128,7 @@ class Bullet implements ComparableInterface public function __construct() { $this->bulletType = self::TYPE_NONE; - $this->bulletFont = 'Calibri'; + $this->bulletFont = 'Lato'; $this->bulletChar = '-'; $this->bulletColor = new Color(); $this->bulletNumericStyle = self::NUMERIC_DEFAULT; @@ -176,10 +176,10 @@ public function getBulletFont() * * @return \PhpOffice\PhpPresentation\Style\Bullet */ - public function setBulletFont($pValue = 'Calibri') + public function setBulletFont($pValue = 'Lato') { if ('' == $pValue) { - $pValue = 'Calibri'; + $pValue = 'Lato'; } $this->bulletFont = $pValue; diff --git a/src/PhpPresentation/Style/Font.php b/src/PhpPresentation/Style/Font.php index 2e25b257a..aee27d20f 100644 --- a/src/PhpPresentation/Style/Font.php +++ b/src/PhpPresentation/Style/Font.php @@ -56,7 +56,7 @@ class Font implements ComparableInterface * * @var string */ - private $name = 'Calibri'; + private $name = 'Lato'; /** * Font Size. @@ -157,10 +157,10 @@ public function getName(): string * * @return self */ - public function setName(string $pValue = 'Calibri'): self + public function setName(string $pValue = 'Lato'): self { if ('' == $pValue) { - $pValue = 'Calibri'; + $pValue = 'Lato'; } $this->name = $pValue; diff --git a/src/PhpPresentation/Writer/PowerPoint2007/PptTheme.php b/src/PhpPresentation/Writer/PowerPoint2007/PptTheme.php index c2c9e8e9b..af7d08844 100644 --- a/src/PhpPresentation/Writer/PowerPoint2007/PptTheme.php +++ b/src/PhpPresentation/Writer/PowerPoint2007/PptTheme.php @@ -130,7 +130,7 @@ protected function writeTheme(Slide\SlideMaster $oMasterSlide): string // a:theme/a:themeElements/a:fontScheme/a:majorFont/a:latin $objWriter->startElement('a:latin'); - $objWriter->writeAttribute('typeface', 'Calibri'); + $objWriter->writeAttribute('typeface', 'Lato'); $objWriter->endElement(); // a:theme/a:themeElements/a:fontScheme/a:majorFont/a:ea @@ -159,7 +159,7 @@ protected function writeTheme(Slide\SlideMaster $oMasterSlide): string // a:theme/a:themeElements/a:fontScheme/a:majorFont/a:latin $objWriter->startElement('a:latin'); - $objWriter->writeAttribute('typeface', 'Calibri'); + $objWriter->writeAttribute('typeface', 'Lato'); $objWriter->endElement(); // a:theme/a:themeElements/a:fontScheme/a:majorFont/a:ea diff --git a/tests/PhpPresentation/Tests/Shape/Chart/SeriesTest.php b/tests/PhpPresentation/Tests/Shape/Chart/SeriesTest.php index f3cc6b7b1..ab6e5d2bd 100644 --- a/tests/PhpPresentation/Tests/Shape/Chart/SeriesTest.php +++ b/tests/PhpPresentation/Tests/Shape/Chart/SeriesTest.php @@ -40,7 +40,7 @@ public function testConstruct(): void $this->assertInstanceOf(Fill::class, $object->getFill()); $this->assertInstanceOf(Font::class, $object->getFont()); - $this->assertEquals('Calibri', $object->getFont()->getName()); + $this->assertEquals('Lato', $object->getFont()->getName()); $this->assertEquals(9, $object->getFont()->getSize()); $this->assertEquals('Series Title', $object->getTitle()); $this->assertIsArray($object->getValues()); diff --git a/tests/PhpPresentation/Tests/Shape/Chart/TitleTest.php b/tests/PhpPresentation/Tests/Shape/Chart/TitleTest.php index a2e076451..7328140f5 100644 --- a/tests/PhpPresentation/Tests/Shape/Chart/TitleTest.php +++ b/tests/PhpPresentation/Tests/Shape/Chart/TitleTest.php @@ -38,7 +38,7 @@ public function testConstruct(): void $this->assertInstanceOf('PhpOffice\\PhpPresentation\\Style\\Alignment', $object->getAlignment()); $this->assertInstanceOf('PhpOffice\\PhpPresentation\\Style\\Font', $object->getFont()); - $this->assertEquals('Calibri', $object->getFont()->getName()); + $this->assertEquals('Lato', $object->getFont()->getName()); $this->assertEquals(18, $object->getFont()->getSize()); } diff --git a/tests/PhpPresentation/Tests/Style/BulletTest.php b/tests/PhpPresentation/Tests/Style/BulletTest.php index 8d8b96563..786270100 100644 --- a/tests/PhpPresentation/Tests/Style/BulletTest.php +++ b/tests/PhpPresentation/Tests/Style/BulletTest.php @@ -38,7 +38,7 @@ public function testConstruct(): void { $object = new Bullet(); $this->assertEquals(Bullet::TYPE_NONE, $object->getBulletType()); - $this->assertEquals('Calibri', $object->getBulletFont()); + $this->assertEquals('Lato', $object->getBulletFont()); $this->assertEquals('-', $object->getBulletChar()); $this->assertEquals(Bullet::NUMERIC_DEFAULT, $object->getBulletNumericStyle()); $this->assertEquals(1, $object->getBulletNumericStartAt()); @@ -81,9 +81,9 @@ public function testSetGetBulletFont(): void { $object = new Bullet(); $this->assertInstanceOf('PhpOffice\\PhpPresentation\\Style\\Bullet', $object->setBulletFont()); - $this->assertEquals('Calibri', $object->getBulletFont()); + $this->assertEquals('Lato', $object->getBulletFont()); $this->assertInstanceOf('PhpOffice\\PhpPresentation\\Style\\Bullet', $object->setBulletFont('')); - $this->assertEquals('Calibri', $object->getBulletFont()); + $this->assertEquals('Lato', $object->getBulletFont()); $this->assertInstanceOf('PhpOffice\\PhpPresentation\\Style\\Bullet', $object->setBulletFont('Arial')); $this->assertEquals('Arial', $object->getBulletFont()); } diff --git a/tests/PhpPresentation/Tests/Style/FontTest.php b/tests/PhpPresentation/Tests/Style/FontTest.php index 47deb3f0b..aec93e4c7 100644 --- a/tests/PhpPresentation/Tests/Style/FontTest.php +++ b/tests/PhpPresentation/Tests/Style/FontTest.php @@ -37,7 +37,7 @@ class FontTest extends TestCase public function testConstruct(): void { $object = new Font(); - $this->assertEquals('Calibri', $object->getName()); + $this->assertEquals('Lato', $object->getName()); $this->assertEquals(10, $object->getSize()); $this->assertFalse($object->isBold()); $this->assertFalse($object->isItalic()); @@ -101,9 +101,9 @@ public function testName(): void { $object = new Font(); $this->assertInstanceOf(Font::class, $object->setName()); - $this->assertEquals('Calibri', $object->getName()); + $this->assertEquals('Lato', $object->getName()); $this->assertInstanceOf(Font::class, $object->setName('')); - $this->assertEquals('Calibri', $object->getName()); + $this->assertEquals('Lato', $object->getName()); $this->assertInstanceOf(Font::class, $object->setName('Arial')); $this->assertEquals('Arial', $object->getName()); } diff --git a/tests/PhpPresentation/Tests/Writer/ODPresentation/ObjectsChartTest.php b/tests/PhpPresentation/Tests/Writer/ODPresentation/ObjectsChartTest.php index 59e668c8a..f081e9551 100644 --- a/tests/PhpPresentation/Tests/Writer/ODPresentation/ObjectsChartTest.php +++ b/tests/PhpPresentation/Tests/Writer/ODPresentation/ObjectsChartTest.php @@ -86,7 +86,7 @@ public function testAxisFont(): void $this->assertZipXmlAttributeEquals('Object 1/content.xml', $element, 'fo:color', '#AABBCC'); $this->assertZipXmlAttributeEquals('Object 1/content.xml', $element, 'fo:font-style', 'italic'); $this->assertZipXmlAttributeEquals('Object 1/content.xml', $element, 'fo:font-size', '10pt'); - $this->assertZipXmlAttributeEquals('Object 1/content.xml', $element, 'fo:font-family', 'Calibri'); + $this->assertZipXmlAttributeEquals('Object 1/content.xml', $element, 'fo:font-family', 'Lato'); $element = '/office:document-content/office:automatic-styles/style:style[@style:name=\'styleAxisY\']/style:text-properties'; $this->assertZipXmlElementExists('Object 1/content.xml', $element); diff --git a/tests/PhpPresentation/Tests/Writer/PowerPoint2007/PptSlidesTest.php b/tests/PhpPresentation/Tests/Writer/PowerPoint2007/PptSlidesTest.php index c1651a84c..9a030214c 100644 --- a/tests/PhpPresentation/Tests/Writer/PowerPoint2007/PptSlidesTest.php +++ b/tests/PhpPresentation/Tests/Writer/PowerPoint2007/PptSlidesTest.php @@ -778,7 +778,7 @@ public function testRichTextRunFontFormat(): void $this->assertZipXmlElementExists('ppt/slides/slide1.xml', $latinElement); $this->assertZipXmlAttributeExists('ppt/slides/slide1.xml', $latinElement, 'typeface'); - $this->assertZipXmlAttributeEquals('ppt/slides/slide1.xml', $latinElement, 'typeface', 'Calibri'); + $this->assertZipXmlAttributeEquals('ppt/slides/slide1.xml', $latinElement, 'typeface', 'Lato'); $this->assertZipXmlElementNotExists('ppt/slides/slide1.xml', $eastAsianElement); $this->assertZipXmlElementNotExists('ppt/slides/slide1.xml', $complexScriptElement); $this->assertIsSchemaECMA376Valid(); @@ -789,7 +789,7 @@ public function testRichTextRunFontFormat(): void $this->assertZipXmlElementNotExists('ppt/slides/slide1.xml', $latinElement); $this->assertZipXmlElementExists('ppt/slides/slide1.xml', $eastAsianElement); $this->assertZipXmlAttributeExists('ppt/slides/slide1.xml', $eastAsianElement, 'typeface'); - $this->assertZipXmlAttributeEquals('ppt/slides/slide1.xml', $eastAsianElement, 'typeface', 'Calibri'); + $this->assertZipXmlAttributeEquals('ppt/slides/slide1.xml', $eastAsianElement, 'typeface', 'Lato'); $this->assertZipXmlElementNotExists('ppt/slides/slide1.xml', $complexScriptElement); $this->assertIsSchemaECMA376Valid(); @@ -800,7 +800,7 @@ public function testRichTextRunFontFormat(): void $this->assertZipXmlElementNotExists('ppt/slides/slide1.xml', $eastAsianElement); $this->assertZipXmlElementExists('ppt/slides/slide1.xml', $complexScriptElement); $this->assertZipXmlAttributeExists('ppt/slides/slide1.xml', $complexScriptElement, 'typeface'); - $this->assertZipXmlAttributeEquals('ppt/slides/slide1.xml', $complexScriptElement, 'typeface', 'Calibri'); + $this->assertZipXmlAttributeEquals('ppt/slides/slide1.xml', $complexScriptElement, 'typeface', 'Lato'); $this->assertIsSchemaECMA376Valid(); }