Using OpenType Features in LibreOfiie
David J. Perry
Ver. 1.2 updated August 4, 2017
Note: Part I provides background for those who have litle or no experience using OpenType. If youare already familiar with OpenType features and just want to learn how to access them in LibreOffice, you can go directly to Part II. tou might also need to read Part Ii if you have worked withOT features through a graphical interface rather than by using four-character codes.
N.B.: names of keys on the keyboard are shown in small capitals (enter, tab, etc.).

I. About OpenTypeA. Introduction
OpenType (abbreviated OT hereafer) is a font technology that enables the appearance ofcharacters to be changed without altering the underlying text. Why would one want such athing?
In some languages, characters may need to be reshaped depending on context. In Arabic, forinstance, leters have diferent shapes depending on whether they come at the beginning of aword, in the middle, or at the end. Te user types a leter and the appropriate shape is displayed. In languages like Arabic, the operating system automatically applies the needed OTfeatures without intervention by the user. Windows and Linux use OT to support such complex scripts (Mac OS X uses a diferent technology for this).
In languages that do not require reshaping, OT provides access to many refnements traditionally used in high-quality typography. In the remainder of this article we will focus on such typographic features that users may wish to apply to their text. Here is one example.
Numerals can be lining 0123456789 or oldstyle 0123456789. Te later are designed to ft beter
among words in running text. Each numeral can be designed to take up the same width as theothers, which makes numbers in tables line up nicely, or numerals can be proportional, where(for instance ) ‘1’ is narrower than ‘0’.
He was born on June 10, 1781 in a small village.
He was born on June 10, 1781 in a small village.
He was born on June 10, 1781 in a small village.

Lining tabular numerals
Oldstyle tabular numerals
Oldstyle proportional numerals

OpenType includes features for lining, oldstyle, tabular and proportional numerals. Most fonts
use lining tabular numerals as the default, although some feature oldstyle unless liningnumerals are specifcally requested.
Font designers use four-character codes to specify OT features, such as the following:
lnum = lining numerals
onum = oldstyle numerals
tnum = tabular numeralspnum = proportional numerals

B. Using the four-character codes
Some programs include a user interface with pull-down menus, checkboxes, and so forth toaccess OT features. Illustration 1 shows how OT features are accessed in the open-source
publishing program Scribus.1 At this time (May 2017), LibreOfce does not have this kind ofinterface, although it may in the future. Instead, you need to use the four-character codes
mentioned above. Part II explains how to do this.
Here are the codes for some common OT features.
smcp
liga
fracsmall capitals2
common ligatures
diagonal fractions

capitals changed to small capitals
discretionary ligatures

c2sc
dlig

A more complete list is found in the Wikipedia list of typographic features. §§1.4, 1.6, and 1.7of this article deal with features that are relevant to scripts such as Latin and Greek.
You should consult the documentation thatcame with your font to fnd out which OTfeatures are included. (Documentation may
not include the four-character codes, under
the assumption that users will have a graphical interface available; the Wikipedia article
can help you locate the codes if needed.) If
there is no documentation, you can try a feature and see if it works; if it doesn’t, noharm is done. Tis document is set in thefont Libertinus Serif, an open-source fontwith many OT features; all examples makeuse of this font unless otherwise noted.
Libertinus is an ofshoot of Linux Libertine,
and the Linux Libertine website shows examples of the various features and is a good
way to learn about OT if you are new to it.

II. Using OpenType in LibreOfiie
Most testing for this article was done withLO Writer. Limited testing with Impress andDraw indicates that the OT features also
work in those programs.
A. Turning single features on or of
Most OT features are turned of unless you
explicitly turn them on. If a feature is lef

Illustration 1: A graphical interface for OT features.

1 Tis screenshot is from ver. 1.3.5, a development version; hopefully this will be ofcially released soon.
2 OT fonts can contain properly designed small capitals. Some programs display small caps by shrinking thefull-sized leters, but these ofen look spindly and badly spaced. True small caps can have slightly thicker
stems to work beter at small sizes and have the spacing between leters optimized.
OpenType Features in LibreOfiieversion 1.2

page 2

of, you see the default character shape that the designer put into the font; if a feature is turned
on, an alternate shape appears. To turn on oldstyle numerals, go the box on the toolbar wherethe font name is displayed (Libertinus Serif, in this document), put the cursor at the end ofname, and type a colon followed by the four-character code:
Libertinus Serif:onum

Ten hit enter to apply the change. Illustration 2 shows this control. Here the Cardo font isin use and we are applying an OT feature called Stylistic Set 1, whose four-leter code is ss01.
If the font name is long,it may be difcult toplace the cursor at theend; in this case, place
it anywhere in thename and hit end oruse the right arrow
key. You also canempty the box and typethe font name plus thecolon and the feature,
although it’s usuallymore accurate to use
the existing name.

Illustration 2: An OT feature specified in LO’s font control.

If you wish to apply an OT feature to text already entered, select the text before editing thefont name. If you don’t select any text and specify an OT feature, any text typed thereafer will
have this feature active until you turn it of.
Some features are turned on by default in LibreOfce, such as standard ligatures. If for somereason you wish to turn such a feature of, type =0 afer the feature name, like this:(default)

Libertinus Serif:liga=0

Te efcient fsh ooats with ligatures.

The3 less efficient fish floats without ligatures.

In fact, technically you should type =1 to turn a feature on ( liga=1), but 1 is the default value so
you don’t need to specify it. =0 turns a feature of.
B. Using more than one feature at once
You can turn on more than one feature at once by placing an ampersand between featurenames, as in the following which turns on proportional oldstyle numerals:
Libertinus Serif:onum&pnumNot all combinations of features are designed to work together, and some font makers takegreater care in this regard than others. So use common sense and experiment as needed.
Sometimes it maters which feature you specify frst and sometimes it doesn’t.
3 Libertinus Serif includes the T-h ligature in the Common Ligatures feature, so it is turned of here. Many
fonts put this combination under Discretionary Ligatures. Variations like this are ofen found with certain OTfeatures, which is why font designers should provide documentation and users need to consult it.
OpenType Features in LibreOfiie

version 1.2

page 3

You can also use a hyphen/minus sign to turn a feature of. For instance, if you had previously
turned on tabular numerals and now wished to change to proportional ones, you could use:
Libertinus Serif:-tnum&pnum

C. Features with multiple variants
A few OT features provide more than the typical on/of arrangement. One such is Character
Variants, which provides multiple alternate shapes for a character. A font may contain up to99 CV features, numbered cv01-cv99.
Te font EB Garamond, an open-source version of Garamond with many OT features, provides
three variants of the leter ‘v’ in italics. Te font manual tells us that these v-alternates areaccessed through cv05. Here is how you would use this feature. (Te actual name of the fontis ‘EB Garamond 12’ since there is a version ‘EB Garamond 8’ for use at small point sizes.)

vanvanvanvanvan

EB Garamond 12
EB Garamond 12:cv05
EB Garamond 12:cv05=1
EB Garamond 12:cv05=2
EB Garamond 12:cv05=3

default (cv05 turned of)v-variant 1 ORv-variant 1
v-variant 2
v-variant 3

Remember that typing cv05 is the same as cv05=1; =1 is the default and normally turns thefeature on, but can be omited. With a feature like Character Variants, typing only the fourcharacters selects the frst option; you could type cv05=01 if you wish. Subsequent variants are
selected by entering =2, =3, etc.
Two fonts of interest to scholars that include the Character Variants feature are Italica Vetus,
for the Old Italic script, and Athena Ruby, for Byzantine inscriptions. Here is an example withthe later. First enter an Alpha (+00391; not the same in +nicode as a Latin capital A). Te
Alpha variants are accessed through cv01, so highlight the Alpha you typed and then enter thefollowing in LO Writer’s font selection box to get the 18th variant, shown below:

ΑAthena Ruby:cv01=18

D. Making Tings asier
Typing codes for the OT features is not difcult, but can be a nuisance if you need to do it
frequently – especially if the font name is long. Be aware that a font name with OT codes
atached is a standard part of character formating, as far as LO is concerned, uust like boldface,
font size, etc. Because of this:• If you format text with an OT tag such as onum or cv05 and copy that text, theformating is included when you paste the text elsewhere in your document.
• You can include font names with OT tags when you create or edit styles; this can be aneasy way to apply formating.
• You can include formating in search and replace operations. For instance, if your text
contains many instances of the acronym NATO in all caps, you could change it to small
caps by searching for NATO with the font atribute Liberation Serif (or whatever

OpenType Features in LibreOfiie

version 1.2

page 4

font your document is in) and replacing it with NATO with the font atribute
Liberation Serif:c2sc (that’s the OT tag for capitals to small capitals).
◦ To do this, open the Find & Replace dialog (ctrl-h), then click on Other Options,then Format. Tis will open a dialog where you can format the font atributes asusual.
In particular, if you are not accustomed to working with styles, you will fnd that they can be
an easy way to format text easily and consistently. Furthermore, if you update a style thechange will take efect throughout your document, which can avoid a lot of manual updating.
You can leave the styles panel open in LO’s Sidebar or open it easily with the hotkey F11.
As an example, I took Writer’s Default paragraph style and modifed it by changing the fontfrom Liberation Serif to Linux Libertine O with the oldstyle numerals feature turned on. Ten
I saved it under the style name Default Oldstyle (see Illustration 3 below). By basing my newstyle on the default, I kept all the seting such as line spacing, indents, etc. the same. See theLibreOfce help fle for much more information about working with styles.

Illustration 3: LibreOffice Writer's dialog for modifying paragraph styles.

. OpenType and Graphite Features
Tere are two ssmart font technolgies in addition to OpenType: Graphite and AAT (AppleAdvanced Typography). A font can contain code to enable more than one of these to work.
If a font contains both OT and Graphite tables with the same features, LO uses the Graphite
rendering in preference to the OT one. Tere are very few such fonts, mainly those producedby SIL International, but if you happen to use one of these and don’t understand how theywork in LO it can be confusing. Te SIL font Gentium Plus, for instance, contains a verticalbar variant Ħ of the character Ħ. Using Gentium Plus:cv28 (the OT syntax for this feature)
does not work, but Gentium Plus:Hstk (the Graphite syntax) does. Consult the fontdocumentation for details about such features.

OpenType Features in LibreOfiie

version 1.2

page 5

F. Applying OT Features to Part of a Word
Tis section will apply mostly to advanced users but is included for the sake of completeness.
Let’s say you type a word like AVERSION and then apply an OT feature, maybe a swash form,to the frst leter. If the font were called sLongTail, you would highlight the A and format it as
LongTail:swsh. Doing so might break the kerning (depending on the font’s construction) soyou would get unatractive space between the frst two leters: A VERSION. To deal with such
issues, you can apply a feature to specifc leter(s) within the word. By doing so LO still sees
the word as a single unit, so features such as kerning will operate on the whole word.
Highlight AVERSION and format it as LongTail:swsh[:1]. Te ‘:1’ tells LO to apply theswash feature only to the frst character of the word. Here are the ways to use this with thekern feature as an example:
kern[4:]kern[:4]
kern[2:4]
kern[4]

turn feature on starting with the fourth character until the end of the word
turn feature on from the beginning and ending with the fourth character
turn feature on for the second through fourth charactersturn feature on for the fourth character onlyTo apply the feature Character Variant 5 to the third through seventh leters of a word, using
the second variant defned in the feature, you would type, afer the font’s name::cv05[3:7]=2.

Change Log
August 4, 2017
July 4, 2017

Version 1.2
Version 1.1

OpenType Features in LibreOfiie

Added example with Athena Ruby; various small edits.
Included with Italica Vetus release and posted separately on the web site.

version 1.2

page 6