Ask Your Question
0

Search-replace and opentype font features

asked 2018-05-18 16:02:42 +0200

David gravatar image

updated 2018-06-16 14:44:24 +0200

Since v. 5.3, LibO Writer happily supports use of opentype features, using the feature tags with the fontname in one of two forms:

  • Fontname:onum=1
  • Fontname:+onum

Both of those would give you the "Oldstyle Figures" while using "Fontname".

I seem to have run into a sort of "gotcha". I prefer to use oldstyle figures with Cambria in my "normal" documents. However, when I want to get rid of the :+onum feature ... I can't! Regular CTRL+H search and replace is quite irregular in finding Cambria:+onum as the Format > Font search field, and the venerable AltSearch fails for me on this as well.

My workaround at the moment is to assign a different document template which does not make use of opentype features. However, it ought to be possible (I would assume) to do some kind of automated search/replace on these feature tags. Is it?

I'm using LibO Version: 6.0.3.2; Build ID: 1:6.0.3-0ubuntu1 (also equivalent on OSX); AltSearch 1.4.2-3/2017.


Update [20180516] - It seems as if this commit, for 6.2.0 series adds this functionality for LibreOffice. I'm not 100% clear on that, though, so if anyone can confirm, that would be great.

edit retag flag offensive close merge delete

Comments

1

While that commit is a step in the right direction I do not see anything there which helps here.
That commit is simply adding code to read the OpenType features from the font files.
There is a later commit which adds an interface to work with OpenType features.
But that just automates adding the codes to the font name (same as now).
Does not seem to affect search functions.

LibreTraining gravatar imageLibreTraining ( 2018-06-16 21:29:18 +0200 )edit

2 Answers

Sort by » oldest newest most voted
1

answered 2018-05-19 12:44:54 +0200

RGB-es gravatar image

I have no problems with searching for fonts with OpenType tags: just write the tag when you select the font to be searched!

(sorry for the Spanish screenshot!)

image description

I tested this on 6.0.4 and it works as intended.

But... always use styles!!!! ;)


A technical point: the "=1" is for Graphite fonts, it gets ignored on OpenType fonts. On LibO, for OpenType fonts and multiple tags you can use either

Font Name:+TAG1&+TAG2

or

Font Name:TAG1&TAG2

To disable OT features you use the first notation with a "-" instead of a "+"

edit flag offensive delete link more

Comments

  • Yes, I always use styles. ;)
  • And this works for me on the laptop I'm now using (OSX, with Collabora Vanilla LibO, v. 6.0.3.2. It was not working on my main desktop (in the office -- will check again on Monday) which is running LibO 6.0.3.2 under Ubuntu.
  • Both forms of opentype tagging seem to work, and oddly, you can even mix them!
David gravatar imageDavid ( 2018-05-19 15:42:50 +0200 )edit
1

answered 2018-05-18 17:04:19 +0200

ajlittoz gravatar image

IMHO, this a semantic markup issue. The numbers in "oldstyle" have a particular meaning for you, whereas other occurrences may be formatted "normal" because of a different meaning.

As a consequence I'd suggest to create a specific character style for your "oldstyle" numbers, forcing Fontname:+onum in the Font tab.

For this to be effective, the opentype feature must not be activated in any of your paragraph styles.

Now, you may object that regular Ctrl+H does not search on character style. This does not matter once the character markup has been done. You no longer need to search for your occurrences, you just change the character style et voilà.

Of course, marking up an existing document is boresome but it will lighten maintenance burden.

Since you're a respectable guru, I won't make the offence of adding the traditional stance about question etiquette. Cheers.

edit flag offensive delete link more

Comments

;) +1 for another approach to the problem ... of course (like my own "workaround") it doesn't directly address the issue of doing search/replace on opentype features, as they have been implemented for Writer (which you realize, of course!). Hopefully we'll get yet more clarity on this one, then.

David gravatar imageDavid ( 2018-05-19 10:45:03 +0200 )edit
Login/Signup to Answer

Question Tools

1 follower

Stats

Asked: 2018-05-18 16:02:42 +0200

Seen: 203 times

Last updated: Jun 16 '18