PHPWord icon indicating copy to clipboard operation
PHPWord copied to clipboard

addFontStyle() not working as expected?

Open iget-master opened this issue 10 years ago • 1 comments

Just following PHPWord Sample01 until line 25 (https://github.com/PHPOffice/PHPWord/blob/develop/samples/Sample_01_SimpleText.php) and output to HTML file

And it simply don't format my text correcty using "addFontStyle".

Output

<!DOCTYPE html>
  <!-- Generated by PHPWord -->
  <html>
  <head>
  <meta charset="UTF-8" />
  <title>PHPWord</title>
  <style>
  * {font-family: Arial; font-size: 10pt;}
  a.NoteRef {text-decoration: none;}
  hr {height: 1px; padding: 0; margin: 1em 0; border: 0; border-top: 1px solid #CCC;}
  table {border: 1px solid black; border-spacing: 0px; width: 100%;}
  td {border: 1px solid black;}
  .rStyle {font-size: 16pt; font-weight: bold; font-style: italic; text-decoration: line-through ;}
  .pStyle {margin-bottom: 5pt;}
  h1 {font-weight: bold;}
  </style>
  </head>
  <body>
  <h1>Welcome to PhpWord</h1>
  <p>Hello World!</p>
  <p>&nbsp;</p>
  <p>&nbsp;</p>
  <p>I am styled by a font style definition.</p>
  <p>I am styled by a paragraph style definition.</p>
  <p>I am styled by both font and paragraph style.</p>
  </body>
  </html>

Using latest PHPWord version get from Composer.


Want to back this issue? Post a bounty on it! We accept bounties via Bountysource.

iget-master avatar Jul 06 '15 22:07 iget-master

Is this still an issue? I'm confused. addFontStyle doesn't appear to be working with the latest release either.

stevenmunro avatar Feb 01 '20 03:02 stevenmunro