Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add font style for Field elements #1774

Merged
merged 5 commits into from
Jul 6, 2020
Merged

Add font style for Field elements #1774

merged 5 commits into from
Jul 6, 2020

Conversation

oleibman
Copy link
Contributor

@oleibman oleibman commented Dec 6, 2019

Description

Please include a summary of the change and which issue is fixed. Please also include relevant motivation and context.

Fixes # (issue)

Checklist:

  • I have run composer run-script check --timeout=0 and no errors were reported
  • The new code is covered by unit tests (check build/coverage for coverage report)
  • I have updated the documentation to describe the changes

1. Add support for font styles for fields, and write those to Word docs.
2. Word seems to require explicit inline w:rtl tag even when rtl is specified
   in a named style. Without this tag, words are placed in ltr order.
   Allow PhpWord doc to specify rtl in named style and have it
   display correctly in resulting doc.
3. A recent change incorrectly changed how noProof tag was generated,
   omitting the third parameter of 4 parameters in the call. There was
   no test case for this change. The call is now corrected, and a
   test case has been added.
@oleibman oleibman closed this Dec 6, 2019
@oleibman oleibman reopened this Dec 6, 2019
@oleibman
Copy link
Contributor Author

oleibman commented Dec 6, 2019

RTF Changes

  1. Converter is currently expecting colors as strings of hex digits,
    but PhpWord allows specification of colors by named constant, so
    result is random when one of those is used. This change handles
    all the named colors.
  2. Table needs \pard at end; formatting may be wrong without it.
  3. RTF writer will no longer ignore paragraph style for TextRun.
  4. RTF writer will no longer ignore paragraph and font style for Title.
  5. Add support for RTF headers and footers.
  6. Add support for right-to-left in font.
  7. Add support for PageBreakBefore and LineHeight for paragraphs.
  8. Add support for PageNumberingStart for sections.

There are test cases for all of these changes.

I apologize - I do not know why my commit message, which is now shown immediately above,
was lost.

@coveralls
Copy link

coveralls commented Dec 6, 2019

Coverage Status

Coverage decreased (-0.02%) to 94.612% when pulling 8b2e21b on oleibman:fieldstyle into 733f845 on PHPOffice:develop.

Changed 1 doc-block comment suggested by Scrutinizer.
That Pull Request is "Fix PHPUnit tests on Develop Branch".
@troosan troosan changed the title Fieldstyle Add font style for Field elements Dec 8, 2019
@oleibman
Copy link
Contributor Author

oleibman commented Dec 9, 2019

I'm not sure if I need to do something about "resolve conflicts". Tests weren't working because fixes were required to AbstractWebServerEmbeddedTest.php, for which there was a pull request for a change which had not yet been merged, so I borrowed the code from that change. Now that it has been merged, it no longer needs to be part of this change, but I'm not sure how to disentangle it. Please let me know what I should be doing, if anything.

@oleibman
Copy link
Contributor Author

Still having trouble with the commit message. Trying to re-enter what it should have been with this
message..

Add font style for Field elements

Add the ability to use a Font Style with Field elements, and have Word2007 writer use that style.

Also, Word seems to require that w:rtl be specified inline rather than as part of a named style.
This change satisfies that requirement by generating inline w:rtl tag when it is part of a named style.

Test cases are added for both changes.
Changed documentation to note that Field can now have Font Style.

@troosan troosan added this to the v0.18.0 milestone Dec 14, 2019
@troosan troosan merged commit e7f70f3 into PHPOffice:develop Jul 6, 2020
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Development

Successfully merging this pull request may close these issues.

3 participants