jason's picture

I wonder if someone would be kind enough to walk me through setting up the .fina OT feature. The font I'm building, a revival of a 16th-century italic, has a variety of word-ending glyphs, and while I'm familiar with the basic OT features (liga, calt, c2sc, frac, etc.), I've never set up .fina before. My uncertainty is how to set up a substitution based on the end of a word (followed by space/punctuation/etc.). Any help will be greatly appreciated.

Kristians Sics's picture

feature fina { # Terminal Forms
# Latin
sub Q by Q.end; # Changes a glyph from midword to a terminal
sub @k_mid by @k_end; # The same with class (k kcommaaccent to k.end kcommaaccent.end)
language TRK ;
language ROM ;
language MOL ;
script grek; # Greek
sub sigma by sigma1; # changes midword sigma to a terminal form
} fina;

if you use calt feature that may affect the terminal form, then undo it in fina and don't forget to place fina below calt in open type features window.

jason's picture

Thanks Kristins, that's simple enough.

Is it simply the feature itself (fina) that determines only the final glyph in a word should be subbed?

What about punctuation? Is there a way for .fina to work even if the word is followed by a comma, period, hyphen, etc.? From the test I just ran, it doesn't seem so.

Kristians Sics's picture

I have three "Q"s - one before U, other before any other capital letter (.calt), one for the end (.fina). Just checked - remains final also before period, comma or hyphen.

sub Q' @calt_noU by Q.alt;

sub Q by Q.alt1;

calt_noU: Adieresis Amacron Aogonek Aring Atilde AE AEacute B C Cacute Ccaron Ccedilla Ccircumflex Cdotaccent D Dcaron Dcroat E Eacute Ebreve Ecaron Ecircumflex Edieresis Edotaccent Egrave Emacron Eogonek F G Gbreve Gcircumflex Gcommaaccent Gdotaccent H Hbar Hcircumflex I Iacute Ibreve Icircumflex Idieresis Idotaccent Igrave Imacron Iogonek Itilde IJ J Jcircumflex K Kcommaaccent K.alt Kcommaaccent.alt L Lacute Lcaron Lcommaaccent Ldot Lslash M N Nacute Ncaron Ncommaaccent Ntilde O Oacute Obreve Ocircumflex Odieresis Ograve Ohungarumlaut Omacron Oslash Oslashacute Otilde OE P Q Q.alt R Racute Rcaron Rcommaaccent S Sacute Scaron Scedilla Scircumflex Scommaaccent T Tbar Tcaron Tcommaaccent T_h V W Wacute Wcircumflex Wdieresis Wgrave X Y Yacute Ycircumflex Ydieresis Ygrave Z Zacute Zcaron Zdotaccent C_K S_T W.alt S.alt D.alt E.alt M.alt M.alt1 C.alt Eth.alt T.alt Scaron.alt Sacute.alt Scedilla.alt Dcroat.alt Ecaron.alt Emacron.alt Edotaccent.alt Eogonek.alt Tcommaaccent.alt Ccedilla.alt Eacute.alt Egrave.alt Ecircumflex.alt Edieresis.alt J.alt1 Dcaron.alt Ncommaaccent.alt Ntilde.alt Nacute.alt Ncaron.alt Tcaron.alt Scircumflex.alt Scommaaccent.alt Cacute.alt Ccircumflex.alt Cdotaccent.alt Ebreve.alt Eth Thorn

jason's picture

Based on the sample you attached, it looks like it does not remain final before punctuation: your Q in the sample is the short-tailed variety before punctuation. I'd like mine to use the final form before punctuation. In the sample below you can see that when the .fina sub is followed by a period, the feature shuts off. Will I need to build a separate .calt feature including a punctuation class in order for this to work?

Kristians Sics's picture

The short tailed one is the final form, and it remains short tailed before a comma or a period. The screen shot is from indesign so I hope the feature works. But I still do not consider myself a great programmer, perhaps anybody else knows better.

twardoch's picture


indeed, in the "fina" feature, it is the application that is responsible to determine the context where the feature should be applied, not the font. (In "calt", it is the font.) So the "fina" feature will always be applied at what the application considers "the end of the word". You don't need to check for that in your OT code. Note, however, that your "fina" code is free to make further checks, e.g. try to differentiate whether the final form is being applied before a space, a punctuation sign, or at the end of the line. The "fina" code can check for *additional* context (beyond the mere "end of word") but should not check for the end-of-word context.

Also, note that there is a bug in InDesign that prevents the application from differentiating the end of a word and the end of a line effectively. I've discussed this here:


PabloImpallari's picture

My Lobster free font has a "fina" features that replaces the last letter of each word with their non-connecting alternate.
I included it under the "liga" feature, so it's ON by default.

Download the font and have a look at the OT code.

Hope it helps

Syndicate content Syndicate content