I am working on a special font that has to follow some rules:

  1. Two consecutive duplicate letters have to be removed. For example kk would become k.
  2. Some letters are “accents” so for example when you type ae (2 characters) it would automatically become æ (1 character).

There are no real limitations on what I can use to make the fonts. Is this possible to simply create a TTF or OTF file with these rules? If so, how do I do this? If it is not possible, are there any workarounds I could do with the font files?

Please keep your answers to simple English as I am new to this sort of thing.

  • What you are describing are ligatures. They are often a staple of Open Type fonts. I, personally, don't know how well true type fonts support ligatures. – Scott Jan 13 '18 at 16:20
  • @Scott: no worries there, any modern font that has the extension "TTF" is in fact an OpenType font. The plain old TrueType format itself does support ligatures (about as straightforward as it can), but using the proper OpenType feature should not lead to any problems in 21st century software. The OP should look into Adobe's and Microsoft's OTF specifications for the possibilities (Adobe describes the syntax) and in the font editor in use for how to add it to the font. – usr2564301 Jan 13 '18 at 18:01
  • When the user asks specifically about ".ttf and .otf" I considered that they were not referring to the Truetype format within the OpenType wrapper, but an actual .ttf formatted font. OpenType can support either the TrueType or Type1 format internally, yes. But in both those instances the suffix is .otf, not .ttf. – Scott Jan 13 '18 at 18:14
  • @Scott: What usr2564301 said applies to actual fonts with the canonical file ending .ttf. I would assume that anybody who actually wants to talk about plain TrueType would just say this and not use a file extension. – Wrzlprmft Jan 13 '18 at 19:51
  • 1
    If we go to the OpenType Specification, we can see that an OpenType font with TrueType Outlines can have any of the two extensions. In the end, what really matters is the presence of certain tables to declare a font OpenType. – Pepe Ochoa Jan 13 '18 at 23:35

I don't know which software you are using, but I recommend you read the FontLab Studio 5 manual. I am going to give you a quick answer on how to do both tasks you mention in FontLab Studio 5.

For this example, I drew 3 simple glyphs (f, i, n) and a fi ligature.

FLS5 Font Window

These are the glyphs in the preview panel:

Demo Glyphs

Now, if you click the OpenType Panel button:

enter image description here

the next panel appears, where you can enter you OpenType Layout Features:

enter image description here

The left side is the list of features, the upper right is where you define the features and the bottom right is where the global definition data goes. In the globals, let's add the following two lines:

languagesystem DFLT dflt;
languagesystem latn dflt;

Citing this site (which I recommend you to visit!):

[The first line] will register all rules for a fallback system in case an OpenType layout engine gets confused about which language or script your features apply to. Additionally, before you register a script with a specific language, you should register it with the default language for the same reason.

Now, clicking the [+] button in the bottom left part of the panel, you add an unnamed feature:

New feature in the OT Panel

Ignoring for the moment the languages, scripts, and for the sake of clarity, lets rewrite the feature like this:

feature liga {
  sub f i by fi;
  sub n n by n;
} liga;

Both lines are self-explanatory, and tell the OT Layout Engine to substitute a pair of glyphs for the one following the by. Of course, the removal of repeated characters is nonsense, but I suppose is for demonstration, and is thus included in the liga feature. Also, you have to know about lookups and can use classes. If you open the Preview panel and activate the liga feature, you get:

Ligature preview

BTW, all that writing can be entered as a separate feature file.

That's it.

Disclaimer: I'm new at this, and I hope my dear professional typographer friends won't kill me if I omitted something or wrote something wrong. Instead, I invite you to contribute. :)

  • 2
    Just curious, as OP did not specifically tell us: replacing two characters with one works, but it will "fail", in some sense, for three and more – nnn will become nn. Is it possible to replace any number of ns with a single one, without resorting to a long list of sub nnnnnn' with n? – usr2564301 Jan 14 '18 at 8:10
  • I have edited the question to disambiguate what I meant and this answer matches what I need. Thank you! – c3ypt1c Jan 14 '18 at 14:05
  • @usr2564301 as far as I know, it is not possible; I think there is no support for any kind of arbitrary looping or iterations. – Pepe Ochoa Jan 14 '18 at 15:20

Your Answer

