Bug 130219 - [rfe] Add "sentence" effect to Effects in Font Effects tab in paragraph style dialog (see c2)
Summary: [rfe] Add "sentence" effect to Effects in Font Effects tab in paragraph style...
Status: NEW
Alias: None
Product: LibreOffice
Classification: Unclassified
Component: Writer (show other bugs)
Version:
(earliest affected)
unspecified
Hardware: All All
: medium enhancement
Assignee: Not Assigned
URL:
Whiteboard: target:6.5.0
Keywords: needsDevEval
Depends on:
Blocks: Writer-Styles-Paragraph
  Show dependency treegraph
 
Reported: 2020-01-27 12:42 UTC by sdc.blanco
Modified: 2021-09-28 13:08 UTC (History)
3 users (show)

See Also:
Crash report or crash signature:


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description sdc.blanco 2020-01-27 12:42:20 UTC
Add a "Capitalization" tab to Paragraph Styles

(with three options)

- leave as is
- Headline (where most words have first letter capitalized)
- Sentence style

(primary practical use is for headings)  
   - Some publications want Headline for one outline level and sentence style for another outline level.
   - Authors, while composing, change heading outline levels. Would be convenient that capitalization also changed automatically with outline level.
   - Reusing a text using one capitalization style in another context that requires a different capitalization style in relation to outline levels.

(afaik, this all must be done manually at present in 7.0.0.0.alpha)
Comment 1 RGB 2020-01-27 22:49:53 UTC
In the "font effects" tab in the style definition (for both, paragraph and character styles), under "Effects" you have a "Title" (or something like that, I'm using a Spanish version right now) option that already provides the "headline mode" you want.

So two of the three options you ask for are already implemented.
Comment 2 sdc.blanco 2020-01-28 02:34:30 UTC
(In reply to RGB from comment #1)
> In the "font effects" tab in the style definition (for both, paragraph and
> So two of the three options you ask for are already implemented.
Thanks.  Had looked in Font Effects, but did not appreciate Effects.

Actually "Title" is not so useful, because all words are capitalized (i.e., does not knowledge of the conventions about what prepositions are not capitalized).

So the strategy would be to always enter headings with necessary capitalization from the start (and use "without" effect).

Then if "lowercase" could be supplemented with a "sentence" effect (i.e., where the first word has the first letter capitalized), then this would be functionally equivalent to my initial request. 

Will revise the summary to:  

Add "sentence" effect in font effects.
Comment 3 Heiko Tietze 2020-01-28 09:57:25 UTC
Guess the UI string "title" is just wrong. Style:text-properties [1] has the properties text-transform with attributes none, lowercase, uppercase or capitalize and font-variant with normal or small-caps. I'm pretty sure this hasn't changed with ODF1.3 and we need to update the format when introducing new behavior. Regina, please correct me.

[1] http://docs.oasis-open.org/office/v1.2/os/OpenDocument-v1.2-os-part1.html#element-style_text-properties
Comment 4 sdc.blanco 2020-01-29 10:49:57 UTC
Workaround/strategy for using styles to change capitalization of headings (where  capitalization changes with outline level)  (elaborating from comment 2)

1. Type heading with desired capitalization.
2. Make a new character style (e.g., CAPS) with Font Effects - Effects - Case - Capitals.  
3. Apply this character style to the first letter of the heading. 

Now it is possible to modify (or make new) Headings using Font Effects "none" and "lowercase", for different outline levels, where "none" keeps the original capitalization and "lowercase" gives a "sentence" style capitalization.

Afaik it is not possible to attach a character style to a paragraph style, and could not see anything in the ODF document that involved a "sentence" format. 
So, at present, it is necessary to add the character style manually to the first character in the heading.

The enhancement request, in sum, is to make an "effect" for the "case" category in Font Effects (for Paragraph Style dialog) that automatically applies a capital to the first character, and lowercase for everything that follows.  Would suggest to call the effect "sentence"
Comment 5 sdc.blanco 2020-01-29 16:10:40 UTC
In Font Effects tab, the "Effects:" label was updated helpfully to "Case:" (29 Oct 2019)

Here is a patch (for consideration) that makes following changes in the dropdown box labels for Effects (6.3) / Case (6.4)

  "Title" --> "Capitalize First Letters"
  "Lowercase" -> "lowercase"
  "Capitals" to "UPPERCASE

https://gerrit.libreoffice.org/c/core/+/87684
Comment 6 Heiko Tietze 2020-01-30 14:38:30 UTC
(In reply to sdc.blanco from comment #5)
> In Font Effects tab, the "Effects:" label was updated helpfully to "Case:"
> (29 Oct 2019)
> 
> Here is a patch (for consideration) that makes following changes in the
> dropdown box labels for Effects (6.3) / Case (6.4)
> 
>   "Title" --> "Capitalize First Letters"
>   "Lowercase" -> "lowercase"
>   "Capitals" to "UPPERCASE
> 
> https://gerrit.libreoffice.org/c/core/+/87684

Different topic and I would make it similar to the functions under Format > Text. So Title could become "Capitalize Every Word".

NEEDINFO for Regina. Interesting is the .uno:ChangeCaseToSentenceCase (Sentence case) command.
Comment 7 Commit Notification 2020-01-30 18:11:28 UTC
Seth Chaiklin committed a patch related to this issue.
It has been pushed to "master":

https://git.libreoffice.org/core/commit/4aa1d8a2d56028c0b08c832dcd5f0adf3f72e38f

tdf#130219 change labels in Case dropdown box in Font Effects tab

It will be available in 6.5.0.

The patch should be included in the daily builds available at
https://dev-builds.libreoffice.org/daily/ in the next 24-48 hours. More
information about daily builds can be found at:
https://wiki.documentfoundation.org/Testing_Daily_Builds

Affected users are encouraged to test the fix and report feedback.
Comment 8 Kevin Suo 2020-01-31 14:23:25 UTC
(In reply to Commit Notification from comment #7)

Does @Seth Chaiklin's commit fixes tge problem? 

Please set the status to ASSIGNED and put your email into the assignee field, to make our search results not showing this bug if one is looking for NEW bugs.
Comment 9 Heiko Tietze 2020-01-31 14:44:45 UTC
(In reply to Kevin Suo from comment #8)
> Does @Seth Chaiklin's commit fixes tge problem? 

No, it doesn't solve the request for a true sentence style capitalization ("Foo is Bar Quz") instead of / in addition to the Capitalize Every Word option we have. See also my comment 6. Question is still if this is possible with the ODF definition.
Comment 10 QA Administrators 2020-07-30 04:10:12 UTC Comment hidden (obsolete, off-topic)
Comment 11 sdc.blanco 2020-07-30 14:09:59 UTC
(In reply to QA Administrators from comment #10)
> This bug has been in NEEDINFO status with no change for at least
> 6 months. Please provide the requested information as soon as
> possible and mark the bug as UNCONFIRMED. 

The needed info (see comment 9) is whether ODF definition can accommodate a true sentence style capitalization, but I am unable to answer this question.  I hope someone with appropriate knowledge can help.
Comment 12 Dieter 2020-07-30 14:24:29 UTC
(In reply to sdc.blanco from comment #11)
> I hope someone with appropriate knowledge can help.

And therefore Heiko asked Regina in comment 6
Comment 13 QA Administrators 2021-01-27 04:28:30 UTC Comment hidden (obsolete, off-topic)
Comment 14 sdc.blanco 2021-01-28 13:05:42 UTC
(In reply to Heiko Tietze from comment #3)
> Guess the UI string "title" is just wrong. Style:text-properties [1] has the
> properties text-transform with attributes none, lowercase, uppercase or
> capitalize and font-variant with normal or small-caps. I'm pretty sure this
> hasn't changed with ODF1.3 
"No change" appears to be the situation in ODF 1.3.

https://docs.oasis-open.org/office/OpenDocument/v1.3/cs02/part3-schema/OpenDocument-v1.3-cs02-part3-schema.html#property-fo_text-transform

> and we need to update the format when introducing
> new behavior. Regina, please correct me.
But is it necessary to make a change at the ODF level?

Why can't existing ODF attributes be used?

Forgive this naive guess -- but if it helps move things forward....

Can a "sentence case" option in "Font Effects"  in PS style dialog
have a two-part operation: 

1.  Apply fo:text-transform uppercase to the first word in Paragraph
2.  Apply fo:text-transform lowercase to rest.

(and I assume manual DF can take care of exceptional cases, e.g., proper name, acronym, that need uppercase)
Comment 15 Heiko Tietze 2021-01-28 13:41:56 UTC
(In reply to sdc.blanco from comment #14)
> Why can't existing ODF attributes be used?

The capitalization does not change the source, "Hello world" remains sentence style even when you set uppercase, AFAIU. The transform attribute allows programs to modify the text - and if we introduce something new it wont work in other applications. See also comment 3 - and I still hope Regina will correct me.

Removing UX and adding dev eval request.
Comment 16 QA Administrators 2021-07-28 04:05:58 UTC Comment hidden (obsolete)
Comment 17 QA Administrators 2021-08-28 03:53:57 UTC Comment hidden (obsolete)
Comment 18 sdc.blanco 2021-09-28 13:08:28 UTC
Reviving this request, which was closed automatically because of an unanswered question in comment 9 about whether was possible in ODF 1.3