OTF font features (rand,calt,liga,dlig...) not working in v7.2.6.2 as in v6.4.3.2

After searching for open discussions about Opentype OTF font feature support I decided to create a new thread to get this solved.

In LibreOffice v6.4.3.2 it was possible to activate font features with:
Font:calt&dlig&liga&rand&kern
or in some other LibreOffice v6 versions
Font:calt&dlig&liga&rand=0&kern

In LibreOffice v7.2.6.2 it doesn’t seem to be able to activate the features the same way as in LibreOffice v6. What is the new way to get OTF fonts features activated? It does not work to select them in the check boxes, and rand feature (random versions of characters) is not even selectable.

Especially the randomized feature rand doesn’t seem to be supported any longer. What happened to it?

What is needed to get all OTF font features working in LibreOffice 7?

OpenType feature registry is:
https://www.microsoft.com/typography/otspec/featuretags.htm

Previous threads (closed):
https://ask.libreoffice.org/t/opentype-features-now-enabled-documentation/22136

As it depends so much on the font used, the actual OTF font that used to work the way you said but doesn’t now should be quoted, e.g. NimbusRomNo9L:aalt&liga&kern. (Incidentally, I don’t see any difference in this font with the features enabled but also ligatures are there regardless of whether they are enabled or not)

If I use another OTF font that I know uses discretionary characters, it works to change the appearance, Foglihten:calt&dlig&liga&onum. I can copy that string and paste it into another document Font Name box and the selected text will change to reflect the new characteristics.

Example font: Foglihten - http://www.glukfonts.pl
Cheers, Al

1 Like

In Writer 7.x, the font features are now enabled by pressing button Features in the Font tab of paragraph and character styles.

A sub-dialog pops up and you tick various check boxes. The dialog shows only the options configured in the font. Consequently the risk of errors is reduced.

2 Likes

A bit more information on what has been discovered since.

OTF features “isol”, “init”, “medi”, “fina”, “rand” and possibly others cannot be selected via the “Features” button although present in the font. harfbuzz and fontforge show these features, and LibreOffice 6.x.y showed the fonts the same way. Fonts that show correctly in harfbuzz (use hb-view to show the rendering) and fontforge metrics preview may not show correctly in LibreOffice 7.x.y. Why that happens would have to be investigated with a minimal example of the font that does not work the same way in all applications.

See this discussion about “isol”, “init”, “medi”, “fina”.

Some features, such as the “isol”, “init”, “medi”, “fina” were meant only for some languages, but designers of Latin fonts have also used them in handwriting fonts, such as Jena1330. Download OTF. Jena1330 does work in LibreOffice 7.6.4. It might be that “calt” feature with “isol”, “init”, “medi”, “fina” and “rand” have changed, which would call for a test font to be created to see what LibreOffice actually does with these features without additional programming in “calt” feature.

Is it possible to automatically create a fully randomized handwritten font?

What is wanted is often a fully randomized letter substitution which takes care of if the letter is in the beginning of a word, in the middle of the word, or at the end of a word, with many variations of these forms, positioned at different heights to simulate handwriting. Something like:

Priority

  1. Special handwriting effects, example: “#typing-effect#” replaced by a characteristic glyph which is likely never to occur unintended. (randomized)
  2. 4-letter ligatures (randomized)
    a. beginning of words (randomized)
    b. middle of words (randomized)
    c. end of words (randomized)
  3. 3-letter ligatures (randomized)
    a. beginning of words (randomized)
    b. middle of words (randomized)
    c. end of words (randomized)
  4. 2-letter ligatures (randomized)
    a. beginning of words (randomized)
    b. middle of words (randomized)
    c. end of words (randomized)
  5. single glyphs in the beginning of words (randomized)
  6. single glyphs in the middle of words (randomized)
  7. single glyphs at the end of words (randomized)

The best way to achieve this behavior, with any set of glyphs properly named to be identified by a python script running inside fontforge that ultimately will create all feature tables in the correct order and with the correct content is still not known. Some ideas for these scripts could be gathered from these scripts which would need to be adapted to fontforge and run in a sequence.

Other randomization algorithms

There are other clever substitutions made in advanced fonts such as can be tested on Liza renderer. Here is a PDF description of the inner workings of the font for the one who may be interested how handwriting simulation could be achieved with some programming behind the logic and automatic creation of all tables with python.

Some fonts use a 1-2-3 substitution looking 10 characters back to simulate “rand” feature. When the same character is found before, a replacement is made.

TT2020 OTF font uses a randomization algorithm and works in LibreOffice 7.6.4.

Punk Nova OTF uses the “rand” feature and works in LibreOffice 7.6.4.

“rand” feature is assumed to be set to “ON” by LibreOffice by default. Most probably, “isol”, “init”, “medi”, “fina” are also set to “ON”.

The feature can be controlled with “+rand” (=ON), “-rand” (=OFF), or “rand=0” (=OFF) or “rand=1”(=ON). It could be so that anything above zero means the feature is ON.

LibreOffice font selection example

If the feature cannot be selected by a click, it can still be accessed with something like:

MyFont:calt=255&-isol&+init&-midi&+fina&rand=0

MyFont:aalt=3

may work to select alternative 3 of a glyph.

This isn’t the place to ask for enhancements, see How to Report Bugs in LibreOffice - The Document Foundation Wiki