Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions docs/changes/1.3.0.md
Original file line number Diff line number Diff line change
Expand Up @@ -18,6 +18,7 @@

## Bug fixes
- PowerPoint2007 Reader : Fixed a node taken out of a node list being treated as an element without being asked whether it is one, which `phpoffice/common` 1.1.0 no longer promises, by [@dkulyk](http://github.com/dkulyk) in [#1000](https://github.com/PHPOffice/PHPPresentation/pull/1000)
- PowerPoint2007 Writer : Fixed `Font::BASELINE_SUPERSCRIPT` and `Font::BASELINE_SUBSCRIPT` being ten times too large, which raised a superscript by 300% and dropped a subscript by 250%, putting it on a line of its own, by [@dkulyk](http://github.com/dkulyk) fixing [#997](https://github.com/PHPOffice/PHPPresentation/issues/997) in [#998](https://github.com/PHPOffice/PHPPresentation/pull/998)
- PowerPoint2007 Reader : Fixed a colour with an alpha coming back opaque and one character short, taking the first digit of the colour with it, by [@dkulyk](http://github.com/dkulyk) in [#961](https://github.com/PHPOffice/PHPPresentation/pull/961)
- Both Writers : Fixed a second shape holding the same picture, and a second chart holding the same numbers, being written as a reference to a part that was never put in the archive, which is what PowerPoint offers to repair, by [@dkulyk](http://github.com/dkulyk) in [#948](https://github.com/PHPOffice/PHPPresentation/pull/948)
- PowerPoint2007 Writer : Fixed a group taking two shape identifiers and using the second, leaving a number no shape carries, by [@dkulyk](http://github.com/dkulyk) in [#947](https://github.com/PHPOffice/PHPPresentation/pull/947)
Expand Down
6 changes: 3 additions & 3 deletions docs/usage/styles.md
Original file line number Diff line number Diff line change
Expand Up @@ -158,12 +158,12 @@ echo $alignment->isRTL();
### Baseline

The baseline set the position relative to the line.
The value is a percentage.
The value is a percentage in thousandths, so `30000` is 30% of the font size.

You can use some predefined values :

* `Font::BASELINE_SUPERSCRIPT` (= 300000 = 300%)
* `Font::BASELINE_SUBSCRIPT` (= -250000 = -250%)
* `Font::BASELINE_SUPERSCRIPT` (= 30000 = 30%)
* `Font::BASELINE_SUBSCRIPT` (= -25000 = -25%)


### Capitalization
Expand Down
4 changes: 2 additions & 2 deletions src/PhpPresentation/Style/Font.php
Original file line number Diff line number Diff line change
Expand Up @@ -68,8 +68,8 @@ class Font implements ComparableInterface
public const UNDERLINE_WORDS = 'words';

// Script sub and super values
public const BASELINE_SUPERSCRIPT = 300000;
public const BASELINE_SUBSCRIPT = -250000;
public const BASELINE_SUPERSCRIPT = 30000;
public const BASELINE_SUBSCRIPT = -25000;

/**
* Name.
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -1172,7 +1172,7 @@ public function testTypeBar3DSubScript(): void

$element = '/c:chartSpace/c:chart/c:plotArea/c:bar3DChart/c:ser/c:dLbls/c:txPr/a:p/a:pPr/a:defRPr';
$this->assertZipXmlElementExists('ppt/charts/' . $oShape->getIndexedFilename(), $element);
$this->assertZipXmlAttributeEquals('ppt/charts/' . $oShape->getIndexedFilename(), $element, 'baseline', '-250000');
$this->assertZipXmlAttributeEquals('ppt/charts/' . $oShape->getIndexedFilename(), $element, 'baseline', '-25000');
$this->assertIsSchemaECMA376Valid();
}

Expand All @@ -1189,7 +1189,7 @@ public function testTypeBar3DSuperScript(): void

$element = '/c:chartSpace/c:chart/c:plotArea/c:bar3DChart/c:ser/c:dLbls/c:txPr/a:p/a:pPr/a:defRPr';
$this->assertZipXmlElementExists('ppt/charts/' . $oShape->getIndexedFilename(), $element);
$this->assertZipXmlAttributeEquals('ppt/charts/' . $oShape->getIndexedFilename(), $element, 'baseline', '300000');
$this->assertZipXmlAttributeEquals('ppt/charts/' . $oShape->getIndexedFilename(), $element, 'baseline', '30000');
$this->assertIsSchemaECMA376Valid();
}

Expand Down Expand Up @@ -1597,7 +1597,7 @@ public function testTypeLineSubScript(): void

$element = '/c:chartSpace/c:chart/c:plotArea/c:lineChart/c:ser/c:dLbls/c:txPr/a:p/a:pPr/a:defRPr';
$this->assertZipXmlElementExists('ppt/charts/' . $oShape->getIndexedFilename(), $element);
$this->assertZipXmlAttributeEquals('ppt/charts/' . $oShape->getIndexedFilename(), $element, 'baseline', '-250000');
$this->assertZipXmlAttributeEquals('ppt/charts/' . $oShape->getIndexedFilename(), $element, 'baseline', '-25000');

$this->assertIsSchemaECMA376Valid();
}
Expand All @@ -1615,7 +1615,7 @@ public function testTypeLineSuperScript(): void

$element = '/c:chartSpace/c:chart/c:plotArea/c:lineChart/c:ser/c:dLbls/c:txPr/a:p/a:pPr/a:defRPr';
$this->assertZipXmlElementExists('ppt/charts/' . $oShape->getIndexedFilename(), $element);
$this->assertZipXmlAttributeEquals('ppt/charts/' . $oShape->getIndexedFilename(), $element, 'baseline', '300000');
$this->assertZipXmlAttributeEquals('ppt/charts/' . $oShape->getIndexedFilename(), $element, 'baseline', '30000');

$this->assertIsSchemaECMA376Valid();
}
Expand Down Expand Up @@ -1723,7 +1723,7 @@ public function testTypePie3DSubScript(): void

$element = '/c:chartSpace/c:chart/c:plotArea/c:pie3DChart/c:ser/c:dLbls/c:txPr/a:p/a:pPr/a:defRPr';
$this->assertZipXmlElementExists('ppt/charts/' . $oShape->getIndexedFilename(), $element);
$this->assertZipXmlAttributeEquals('ppt/charts/' . $oShape->getIndexedFilename(), $element, 'baseline', '-250000');
$this->assertZipXmlAttributeEquals('ppt/charts/' . $oShape->getIndexedFilename(), $element, 'baseline', '-25000');

$this->assertIsSchemaECMA376Valid();
}
Expand All @@ -1741,7 +1741,7 @@ public function testTypePie3DSuperScript(): void

$element = '/c:chartSpace/c:chart/c:plotArea/c:pie3DChart/c:ser/c:dLbls/c:txPr/a:p/a:pPr/a:defRPr';
$this->assertZipXmlElementExists('ppt/charts/' . $oShape->getIndexedFilename(), $element);
$this->assertZipXmlAttributeEquals('ppt/charts/' . $oShape->getIndexedFilename(), $element, 'baseline', '300000');
$this->assertZipXmlAttributeEquals('ppt/charts/' . $oShape->getIndexedFilename(), $element, 'baseline', '30000');

$this->assertIsSchemaECMA376Valid();
}
Expand Down Expand Up @@ -2007,7 +2007,7 @@ public function testTypeScatterSubScript(): void

$element = '/c:chartSpace/c:chart/c:plotArea/c:scatterChart/c:ser/c:dLbls/c:txPr/a:p/a:pPr/a:defRPr';
$this->assertZipXmlElementExists('ppt/charts/' . $oShape->getIndexedFilename(), $element);
$this->assertZipXmlAttributeEquals('ppt/charts/' . $oShape->getIndexedFilename(), $element, 'baseline', '-250000');
$this->assertZipXmlAttributeEquals('ppt/charts/' . $oShape->getIndexedFilename(), $element, 'baseline', '-25000');

$this->assertIsSchemaECMA376Valid();
}
Expand All @@ -2025,7 +2025,7 @@ public function testTypeScatterSuperScript(): void

$element = '/c:chartSpace/c:chart/c:plotArea/c:scatterChart/c:ser/c:dLbls/c:txPr/a:p/a:pPr/a:defRPr';
$this->assertZipXmlElementExists('ppt/charts/' . $oShape->getIndexedFilename(), $element);
$this->assertZipXmlAttributeEquals('ppt/charts/' . $oShape->getIndexedFilename(), $element, 'baseline', '300000');
$this->assertZipXmlAttributeEquals('ppt/charts/' . $oShape->getIndexedFilename(), $element, 'baseline', '30000');

$this->assertIsSchemaECMA376Valid();
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -1695,7 +1695,7 @@ public function testStyleSubScript(): void

$element = '/p:sld/p:cSld/p:spTree/p:sp/p:txBody/a:p/a:r/a:rPr';
$this->assertZipXmlElementExists('ppt/slides/slide1.xml', $element);
$this->assertZipXmlAttributeEquals('ppt/slides/slide1.xml', $element, 'baseline', '-250000');
$this->assertZipXmlAttributeEquals('ppt/slides/slide1.xml', $element, 'baseline', '-25000');
$this->assertIsSchemaECMA376Valid();
}

Expand All @@ -1708,7 +1708,7 @@ public function testStyleSuperScript(): void

$element = '/p:sld/p:cSld/p:spTree/p:sp/p:txBody/a:p/a:r/a:rPr';
$this->assertZipXmlElementExists('ppt/slides/slide1.xml', $element);
$this->assertZipXmlAttributeEquals('ppt/slides/slide1.xml', $element, 'baseline', '300000');
$this->assertZipXmlAttributeEquals('ppt/slides/slide1.xml', $element, 'baseline', '30000');
$this->assertIsSchemaECMA376Valid();
}

Expand Down
Loading