Skip to content

addFontStyle() not working as expected? #569

Open
@iget-master

Description

@iget-master

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.

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions