Ordinals 1st 2nd 3rd etc as OpenType feature

Post questions about type and font design here.
Post Reply
Dinofore
Posts: 3
Joined: Mon Feb 07, 2022 7:57 am

Ordinals 1st 2nd 3rd etc as OpenType feature

Post by Dinofore »

Hi there

I’m quite a newbie when it comes to typography and type design but I have just finished my first font, and I’m just fine tuning kerning and open type features etc.

I want to substitute the “nd” of 2nd with a single glyph that is called “small_nd” which is way up in the private use register (E679) as suggested on another forum. I want to do this for 1st, 2nd, 3rd and 4th - replacing the suffix with a single glyph for each iteration that I have designed for the purpose. What is the easiest way of doing this, with some example code, as I’m having a real hard time with it and would be very grateful.

I wish for the nd, th, etc only to be substituted with their single glyph counterparts in the context of coming after a numeral.

I hope this all makes sense and I hope someone can assist! ❤️
Bhikkhu Pesala
Top Typographer
Top Typographer
Posts: 9873
Joined: Tue Oct 29, 2002 5:28 am
Location: Seven Kings, London UK
Contact:

Re: Ordinals 1st 2nd 3rd etc as OpenType feature

Post by Bhikkhu Pesala »

See the tutorial: Enrich your fonts with OpenType features and add an Ordinals feature to your font.

If I remember correctly, this expects to find superscript glyphs for d, h, n, r, and t. If you want nd, rd, th, to be single glyphs I am not sure how it would work.
My FontsReviews: MainTypeFont CreatorHelpFC15 + MT12.0 @ Win 10 64-bit build 19045.2486
PJMiller
Top Typographer
Top Typographer
Posts: 977
Joined: Tue Jun 16, 2015 8:12 pm
Location: Sheffield, South Yorkshire
Contact:

Re: Ordinals 1st 2nd 3rd etc as OpenType feature

Post by PJMiller »

If you want an example then download the Munson font and take a look at the open type features. :D
Dinofore
Posts: 3
Joined: Mon Feb 07, 2022 7:57 am

Re: Ordinals 1st 2nd 3rd etc as OpenType feature

Post by Dinofore »

Thank you both so much, I will have a look.

Using superscript N & D for example wouldn’t work in my scenarios, unfortunately, I really need to be able to replace the two characters with one single glyph in that particular context. If anyone knows if it is possible to do so at all, that would be handy as if it isn’t I can spare myself the pain of trying to do the impossible and just settle for having it as a special character, that can be manually triggered.
Dinofore
Posts: 3
Joined: Mon Feb 07, 2022 7:57 am

Re: Ordinals 1st 2nd 3rd etc as OpenType feature

Post by Dinofore »

That said if it can’t be done I guess I could make a cheap workaround with making the N super the ND glyph and the D super being just blank padding?
Bhikkhu Pesala
Top Typographer
Top Typographer
Posts: 9873
Joined: Tue Oct 29, 2002 5:28 am
Location: Seven Kings, London UK
Contact:

Re: Ordinals 1st 2nd 3rd etc as OpenType feature

Post by Bhikkhu Pesala »

Glyph substitutions of two glyphs with one glyph are certainly possible. I have never done ordinals in this way, so I don't know how to write the code for you. I use a 2 to 1 GSUB for my Ornaments feature, for Chess players. Typing bq with the feature enabled will replace bq with a black queen from Misc Symbols.
Two to One Subs.png
Two to One Subs.png (20.62 KiB) Viewed 9316 times
My FontsReviews: MainTypeFont CreatorHelpFC15 + MT12.0 @ Win 10 64-bit build 19045.2486
PJMiller
Top Typographer
Top Typographer
Posts: 977
Joined: Tue Jun 16, 2015 8:12 pm
Location: Sheffield, South Yorkshire
Contact:

Re: Ordinals 1st 2nd 3rd etc as OpenType feature

Post by PJMiller »

Munson uses four single glyphs for 'th', 'st', 'nd', and 'rd' so yes you can put a ligature substitution table into the ordinals feature and it works. Take a look, the first two subtables are for the 'o' and 'a' substitutions but the third subtable is for the British and American ordinals which I suspect will get more use than the European ordinals.

It is free and open source and the FC font project is included in the 'source' folder.
Post Reply