Skip to content

Style/Font - Remove defaults on superScript, subScript, and underline #2837

@rasamassen

Description

@rasamassen

Describe the problem

PhpWord/Style/Font.php

RTF (and I assume other formats) has the ability to turn superscript, subscript, and underline off (\nosupersub and \ulnone\ul0) if the inherited formatting has it turned on. However, because these items currently have default values, there's no way to tell if the values have been intentionally turned off (other variables can be checked for === false). Basically, 3 states are needed. null (not set), true/ul_style (turned on), false/ul_none (turned off).

Simply imagine the scenario where the parent ParagraphStyle is underlined, bold, and allCaps. The child ParagraphStyle the user wants to turn underlining off. Right now there's no way to tell if underline is the default value (none) and therefore isn't supposed to be change or if the user intentionally set underline to none.

I can implement if there is agreement. But because I currently don't know how the other formats work and am only beginning to understand RTF, I want to verify this change makes sense and would not break the other writers.

Describe the expected behavior

When superscript/subscript/underline are not set, nothing happens. When they are set, the on or off values are provided.

Priority

  • I want to crowdfund the feature (with @algora-io) and fund a community developer.
  • I want to pay the feature and fund a maintainer for that. (Contact @Progi1984)

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions