Bug 157735 - Small Caps Style Issue
Summary: Small Caps Style Issue
Status: RESOLVED NOTABUG
Alias: None
Product: LibreOffice
Classification: Unclassified
Component: Writer (show other bugs)
Version:
(earliest affected)
7.6.2.1 release
Hardware: All All
: medium normal
Assignee: Not Assigned
URL:
Whiteboard:
Keywords:
Depends on:
Blocks:
 
Reported: 2023-10-13 04:52 UTC by Elmar
Modified: 2024-11-07 03:26 UTC (History)
1 user (show)

See Also:
Crash report or crash signature:


Attachments
small caps in style (50.95 KB, application/vnd.oasis.opendocument.text)
2023-10-13 04:53 UTC, Elmar
Details
Small caps effect via a new writer style (2.58 MB, image/gif)
2023-10-13 12:01 UTC, V Stuart Foote
Details

Note You need to log in before you can comment on or make changes to this bug.
Description Elmar 2023-10-13 04:52:25 UTC
Description:
Small Caps in style is inconsistent.
In the format menu, there are two things one must do: select capitalize every word and select small capitals.
This cannot be done in the style, there it is an either/or option.

Steps to Reproduce:
1.type text, use Heading 2
2.First word has normal cap, rest is small caps
3.select text
4.use menu to change to capitalize every word

Actual Results:
does not appear to be possible to do both in the style

Expected Results:
should be possible, is unnecessary extra work. Same could be achieved by simply having a different size in the style


Reproducible: Always


User Profile Reset: No

Additional Info:
Version: 7.6.3.0.0+ (X86_64) / LibreOffice Community
Build ID: 2865050bf82c717ea403bf7635bf4072b1876f41
CPU threads: 8; OS: Linux 5.15; UI render: default; VCL: gtk3
Locale: en-GB (en_GB.UTF-8); UI: en-GB
Calc: threaded

same issue in previous versions
Comment 1 Elmar 2023-10-13 04:53:33 UTC
Created attachment 190182 [details]
small caps in style
Comment 2 V Stuart Foote 2023-10-13 11:39:43 UTC
No, you simply need to edit the "Heading 2" style, saving to a new "custom style".

Apply the new style to the heading.

Edit the "custom style" and open the 'Font Effects' tab. Look at the 'Case' listbox: UPPER, lower, Capitalize Every Word, and Small capitals effects are available to apply via Style (rather than direct formatting).

The change is persistent for this document (and if you save as a template). And
in the ODF you'll end up with a style:parent-style-name= that includes the 'Case' listbox selection made from the 'Font Effects' tab of the Style editor.

   <style:text-properties fo:font-variant="small-caps"/>
Comment 3 V Stuart Foote 2023-10-13 12:01:34 UTC
Created attachment 190191 [details]
Small caps effect via a new writer style

the style will show in <F11> stylist in the Applied view (when applied) but resides in the Custom styles listing.
Comment 4 V Stuart Foote 2023-10-13 12:16:06 UTC
Oh, and I guess since you wanted each word to be capitalized (and show thatway in the SmallCaps effect), you need to edit the string in advance--manually, or it can be done with the Format -> Text -> 'Capitalize every word' (.uno:ChangeCaseToTitleCase) of a selection. Available to assign to shortcut.

That capitalization then is permanent (it has changed the string). 

The other effects available in the Style use string transliterations and leave the original string intact.
Comment 5 Elmar 2023-10-14 05:27:06 UTC
I do not understand what you are saying.

The example you added seems to confirm my problem which is this:
In a style, you can have every word capitalized, or 
you can have the sentence in small caps, but
you cannot have both

in the menu: after selecting the sentence, then
format/text/capitalize every word, then
selecting the sentence again, then
format/text, tick the small capitals option
you get both

the alternative is to type every word with a cap first letter, then set the style to be "small caps"

I guess this last option is not a burden, especially if the usual approach is not to capitalize short words, as in 
This is a Capitalized Sentence

a style guide says:
"Capitalize the first and last words in titles and subtitles, and capitalize all other major words (nouns, pronouns, verbs, adjectives, adverbs, and conjunctions with four or more letters)."

OK, you win.
Comment 6 V Stuart Foote 2023-10-14 13:07:42 UTC
Simply that the Small Caps "font effect" via a Style is applied using an ICU library  transliteration against a string, and then some VCL rendering onto the document canvas. It does not actually change the string (upper case and lower case characters remain) the style/ODF "font-variant" then acts on that string.

And IIUC the UNO commands on the Format -> Text menus actually use the same ICU transliterations as the "font effect", as does the <Shift>+<F3> "cycle case", but the string is actually changed by the command via replacement.

So yes you have to mix a format/edit of the string(s) with applying the style's font effect to get the capitalization and small caps result. 

Alternatively, smart font Small caps (i.e. changing the alternate glyphs for Graphite or OpenType fonts that provide the feature, e.g. Libertinus Serif) can also be done via a style edit, but applied from the 'Font' tab and the 'Features' dialog for the selected font. It will append a "smcp=1" value to the font family. But have the same requirement there to adjust capitalization of the string.
Comment 7 Marlin Cuvalis 2024-11-06 02:43:54 UTC
The issue you're facing is a limitation in how LibreOffice handles text formatting in Heading styles, and it seems there isn't an easy way to combine both Small Caps and Capitalize Every Word in a single style at this time. However, by manually adjusting or tweaking the styles, you may be able to get around this issue, but it would require some extra work.

Submitting a feature request to LibreOffice could also help them address this in a future update.