Ask Your Question
0

set an only "italic + language" character style

asked 2020-10-20 16:23:10 +0100

fbertoldi gravatar image

updated 2020-10-20 16:58:52 +0100

I wish to set a character custom style only with these two "features": italic and a given language (f.e. italic + German, or italic+French), leaving (keeping) preexisting font-size and font-type (Times, Arial and the like).
So far I'm not be able to do so, because when I set a custom character style I have to choose a particular font(type) and a particular (font-)size.
Thanks

EDIT
I know that with a macro it is possible

sub set_selection_deutsch
rem ----------------------------------------------------------------------
rem define variables
dim document   as object
dim dispatcher as object
rem ----------------------------------------------------------------------
rem get access to the document
document   = ThisComponent.CurrentController.Frame
dispatcher = createUnoService("com.sun.star.frame.DispatchHelper")

rem ----------------------------------------------------------------------
dim args1(0) as new com.sun.star.beans.PropertyValue
args1(0).Name = "Language"
args1(0).Value = "Current_German (Germany)"

dispatcher.executeDispatch(document, ".uno:LanguageStatus", "", 0, args1())

rem ----------------------------------------------------------------------
dim args2(0) as new com.sun.star.beans.PropertyValue
args2(0).Name = "Italic"
args2(0).Value = true

dispatcher.executeDispatch(document, ".uno:Italic", "", 0, args2())

end sub

But with a style?

edit retag flag offensive close merge delete

Comments

Have you read my answer? It gives the recipe to create a character style which will change only the font style and language when applied. It is strictly equivalent to your macro with the advantage the style has a name, meaning you can change all so-styled sequences from a single location (the style definition).

ajlittoz gravatar imageajlittoz ( 2020-10-20 17:53:01 +0100 )edit

1 Answer

Sort by » oldest newest most voted
1

answered 2020-10-20 16:51:05 +0100

ajlittoz gravatar image

The parameters for these settings are in the Font tab of character style definition.

Since you want to only change font variant and language, I recommend you press first the Standard buttons to set all attributes (in this tab) to "transparent" state (i.e. none will cause a change against those in the paragraph style).

After that click on a Style like Italic and select a language from the Language drop-down menu.

In case you clicked on an undesired attribute, e.g. font family or size, don't click again on what you think to be the default because you'll create a "forcing" attribute instead of reverting to "transparent" state. Press again Standard and reconfigure the tab.

Don't click on any attribute you don't want to set. Unclicked, they inherit from the paragraph style.

To show the community your question has been answered, click the ✓ next to the correct answer, and "upvote" by clicking on the ^ arrow of any helpful answers. These are the mechanisms for communicating the quality of the Q&A on this site. Thanks!

In case you need clarification, edit your question (not an answer which is reserved for solutions) or comment the relevant answer.

edit flag offensive delete link more

Comments

It works! Thank you very much!

fbertoldi gravatar imagefbertoldi ( 2020-10-20 18:59:53 +0100 )edit
Login/Signup to Answer

Question Tools

1 follower

Stats

Asked: 2020-10-20 16:23:10 +0100

Seen: 32 times

Last updated: Oct 20