Skip to content

Conversation

@rasamassen
Copy link

@rasamassen rasamassen commented Sep 1, 2025

Description

Adds underline styles, doublestrikethrough, smallcaps, allcaps, fgcolor, hidden, scale, spacing, kerning (not sure if the * 2 is correct, but I think it is), position, noproof, and bgcolor.

I completely don't know why the static analysis tests are failing. They started failing when I changed Language.php, and I did a full revert, and they still failed. Language.php works for what is needed for RTF (including the main document language finally works!), and I think RTF is the only thing that uses langId. No idea what's causing the other failures.

Fixes 321.

Does not implement:

  • shading

Checklist:

  • My CI is 🟢
  • I have covered by unit tests my new code (check build/coverage for coverage report)
  • I have updated the documentation to describe the changes
  • I have updated the changelog

In combination with next edit...

Sets the fgColor and bgColor according to the colorTable.
Adds underline styles, doublestrikethrough, smallcaps, allcaps, fgcolor, hidden, scall, spacing, kerning, position, noproof, and bgcolor.
Now that Font isn't returning unnecessary values, it could sometimes occur where it returned an extra space in the document if ($content == ''). This is fixed.
In these cases, the array_search should always return an integer, but because the php static analysis tests didn't like the chance that it might return a string, let's explicitly cast the variable as an integer.
@rasamassen
Copy link
Author

This may fix #321? I'm not sure what the bug report means by "export", but I assume they are talking about the RTF Writer?

@rasamassen rasamassen changed the title RTF: Add Missing Font Features RTF Writer: Add Missing Font Features Sep 4, 2025
@coveralls
Copy link

coveralls commented Sep 6, 2025

Coverage Status

coverage: 96.75% (-0.007%) from 96.757%
when pulling 7c6de8a on rasamassen:font
into 0ab0b49 on PHPOffice:master.

@rasamassen rasamassen changed the title RTF Writer: Add Missing Font Features RTF Writer: Font - Add Missing Features Oct 4, 2025
oleibman added a commit to oleibman/PHPWord that referenced this pull request Nov 18, 2025
I made RTF usable some time ago. @rasamassen has recently done a lot of useful work to cover many missing areas. Since who knows when those changes will be merged, I intend to incorporate much of that work. I will do this with several pushes, each based on one or more of those changes. This one is based on PR PHPOffice#2819 (fixes issue PHPOffice#321), and the Escaper portion of PR PHPOffice#2821.
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.

2 participants