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

[pull] main from microsoft:main #79

Merged
merged 1 commit into from
Sep 28, 2023
Merged

Commits on Sep 27, 2023

  1. Use MSWord compatible RTF sequence for background text color (#16035)

    The `GenRTF(...)` was using `\highlight` control word for sending
    background text color in the RTF format during a copy command. This
    doesn't work correctly, since many applications (E.g. MSWord) don't
    support full RGB with `\highlight`, and instead uses an approximation of
    what is received. For example, `rgb(197, 15, 31)` becomes `rgb(255, 0,
    255)`. Also, the standard way of using background colors is `\cbN`
    control word, which isn't supported as per the [RTF Spec 1.9.1]
    in Word.
    
    But it briefly mentioned a workaround at Pg. 23, which seems to work on
    all the RTF editors I tested.
    
    The PR makes the changes to use `\chshdng0\chcbpatN` for the background
    coloring.
    
    Also did some refactoring to make the implementation concise.
    
    ## Validation Steps Performed
    
    Verified that the background is correctly copied on below editors:
    - MSWord
    - WordPad
    - LibreOffice
    - Outlook
    
    [RTF Spec 1.9.1]: https://msopenspecs.azureedge.net/files/Archive_References/[MSFT-RTF].pdf
    tusharsnx authored Sep 27, 2023
    Configuration menu
    Copy the full SHA
    310814b View commit details
    Browse the repository at this point in the history