How can I use Replace All to change the font size of a selected term in a document?

Using Control H to “replace all” of a certain term in a document, I want to change the font size of the term…But it doesn’t work? Can anyone tell me how? For example, I want to change all the instances of a particular word in the document from 12 pt to 11 pt and leave the rest of the document in 12 pt. But it never works…Is there a way to do it?

We don’t know what doesn’t work for you but this works for me. So to find He

  • Type He in Find
  • Type He in Replace. With the cursor still in Replace field
    • Click the + next to Other Options to display them
    • Click the button labelled Format
    • In the dialogue that opens select the Font tab and enter 11 in the size field and click OK
  • You should see 11pt written under the Replace field
  • Click Replace All

Try it on a new document. Type dt and press F3 (possibly Fn+F3). Then use the steps above as a test.

Note 1: If you tick Regular expressions box then you could have $0 or & in the Replace field rather than the text He, that is replace with the contents of the Find field.

Note 2: The format will remain selected for further finds so when finished click in the Replace field again and then click the button No Format

Thanks….I am doing exactly that, and the font size doesn’t change at all :frowning: It SAYS “replaced 6586 times” but nothing changes.

That’s a lot of instances. I should have said create a character style based on the existing text but modify to 11pt then do Find All and with all instances selected, double-click the new character style in the Styles sidebar. After that changing size or other attributes is just a matter of changing the character style.

What I suggested originally was direct formatting which takes precedence over styles. You might need to post a small anonymised sample

1 Like

Yes it’s a lot, they are only 1 syllable words. And Hmm…Unfortunately I don’t know how to “Create a character-based style”, nor how to “double click the new character style in the styles sidebar” or the rest of it. Nor am I aware of how post a small anonymised sample or what that means… But I’ll try my best to try to learn it and follow those instructions.

Maybe you should learn a few basic things first of all.

Professional text composition with Writer

Character Styles in Writer

Styles in Writer

English documentation


Nor am I aware of how post a small anonymised sample or what that means…

There is an assumption that you have a document that is too large to upload and may contain personal data, we don’t know.

A sample document then consists of you copying your document. Reduce the pages of this copy to max. 4-5 pages in which the problem (or function) must be present though. Then check this document for relevant data (e.g. personal data) that is not intended for publication and remove it.

Upload the finished sample file here.

Ah, since I only joined here 2 hours ago to ask this question I didnt realize you could do all that.
anonymised sample.odt (11.8 KB)

Here is the anonymised sample. THe characters I want to change font size of, are the Devanagari characters which have a font size that is disproportionate to the Roman characters so parts of the text on the lines above and below overwrite each other and it becomes unreadable

Then you might find This is the Guide… to be a useful resource.

1 Like

You have a complex document: it is bilingual and, more, uses an Asian script. This requires you markup your text with styles (paragraph and character styles at least) so that Writer is aware of language changes.

This means you must create a consistent set of styles and apply them to the document. Warning! A common pitfall is to name styles for their visual effects. This is wrong. Styles should be chosen for their semantic significance (Devanagari vs. English, emphasis, definition, explanation, comment, note, …). You assign typographical attributes in a second step. With such a scheme and consistent systematic use, you can tune Devanagari sequences independent from English sequences.

I suggest you stop working on your present document to learn styles and practice on scratch documents. This is not a loss of time, even if you have a deadline. You’ll be much more effective and efficient afterwards.

Remarks:

  • Enable Complex Text Layout (Hindi variant) in Tools>Options, Language Settings>Languages
  • Don’t use Default Paragraph Style for any text in the document; this style, which is the ancestor of all others, is reserved for setting common attributes shared by all styles; standard style for discourse is Text Body
  • Prohibit direct formatting, use exclusively styles; this is the only way to manage long complex document and avoid formatting hell
  • Don’t vertically space with empty paragraph; vertical space is a property of paragraph styles as part of the significance of the paragraph
  • Don’t try to align horizontally with spaces; it won’t never be perfect and is highly sensitive to formatting change in the same line
    Your sample text seems to be tabular; use a table
1 Like

Thank you…I Wonder why when I use Replace All, and specify the font size of the characters to be replaced, and the size of those to replace them with, that nothing changes…? I’m not sure how the “Character Styles” functions relate to the problem.

Or simply use Find All button to have all instances selected, and use normal controls (preferably style sidebar, but also possible to use toolbar direct formatting controls).

No one could see things happening on your system. You could provide a sample document, mention your version, and provide exact steps (clicks, keystrokes, etc.) that you use, so that others could literally follow locally and see the problem, to return with an advise.

ReplaceSize

1 Like

To find all Hindi text, Find All

([\u0900-\u097F]+[:space:]{1})*[\u0900-\u097F]+

with [x] Regular expressions.

EDIT: Replace All with Format 11 pt don’t works for me (7.2.7.2 on Windows 10.0).


Could it be this, because paragraph style is Default?

2 Likes

Close FIND&REPLACE (selection of Hindi characters remains as active) and then apply 11p or other size… (hard formatting).

Yes, I did it that way.
If I add Light Red font color, the color is applied when Replace All, but not the 11 pt font size.

[\u0900-\u097F] may be more expressively represented as either [:script=Devanagari:], or \p{script=Devanagari}.

{1} is redundant: it requires exactly one occurrence of the space (native syntax of ICU regex is \s, [:space:] is a Posix-like alternative); and when you use a (meta)character without any occurrence modifiers, it will match exactly once (though why? Maybe \s+ is more appropriate? It’s a frequent thing to see several spaces in a row).

The regex will not match the whole text anyway (it will break on punctuation, numbers, non-Devanagari text…), and will require a global replacement, or a repetitive replacement. So maybe this form would be enough: \p{script=Devanagari}+\s*

Had you set the size for Western text (only shown by default in locales not using complex scripts), or had you enabled CTL under Options|Language Settings|Languages , and defined the size in the respective CTL section?

2 Likes

IT turns out that program doesn’t recognize the difference in font sizes when it comes to Devanagari characters. For example, you can specifically search for only 50 pt Devanagari characters, or only for 2 pt characters, and it will bring up all of them in the document, irrespective of size, for example, they are all 12 pt. So this is why it cant find and replace all of a certain size with a specified new size, like you can with regular letters. I should have tested this before making the post. Obvious really. Sorry for wasting everyone’s time. But thank you for all replies.

It does. I just tested with your sample file.
Just do as @mikekaganski wrote: “enabled CTL under Options|Language Settings|Languages”.
image

See the outcome:

And specifically in the Format dialogue where cursor is. That is where to change the size for Devanagari

Okay Ill try.

Wait…I didnt tick “Diacritic-sensitive”…I ticked “diacritic-sensitive” and now it seems to have worked properly. THank you everyone for the help…it looks a lot better now.

1 Like