New to Typophile? Accounts are free, and easy to set up.

Posted by Igor Freiberger in

12 Feb 2010 — 1:54pm

12 Feb 2010 — 1:54pm

I'm designing my first typeface, a contemporary serif family with four weights. I'd like to use massive contextual alternates (as in Kinescope or Vesper), but I have doubts about the limits to use this feature.

I plan to adopt contextual alternates through stylistic sets for these situations:

1. beginnings and endings;

2. glyphs collisions and undesired optical effects;

3. typesetting special symbols as arrows and flourishes;

4. Roman numerals;

5. chess notation with figurines (unsure about this one);

6. mathematical symbols and expressions.

Besides this, there would also be optional variations in some glyphs (typically, Q, R, f, a) which could also be set with stylistic sets.

So, is there any problem to set dozens or even hundreds of contextual alternates in OT tables? This may cause poor performance?

I understand some of the situations I listed could be addressed with GREP styles in InDesign (as Roman numerals and chess notation), but it would be nice if the font had all these features.

12 Feb 2010 — 1:59pm

There won't be any performance issues. Similarly, there could be, and usually are, tons of lookups in the GPOS kern feature which don't effect rendering performance.

Some of the alternates you plan to design may be better suited in other features, such as Stylistic Alternates and Discretionary Ligatures.

12 Feb 2010 — 2:13pm

Thanks, Terrance.

Which features do you consider to be best defined as Stylistic Alternates or Discricionary Ligatutes?

12 Feb 2010 — 2:16pm

Well, stylistic alternates are usually for the 'optional variations' as you described it, like a g, a, tail on Q, etc.

Be careful with ligatures too, try to resolve glyph collisions with sidebearings and kerning first.

Spend some time looking at the features and how they are used with other designs.

12 Feb 2010 — 2:21pm

Thanks again. I'll follow your advice!

12 Feb 2010 — 3:34pm

The only program I’ve run into that has problems with numerous lookups is Illustrator, which can lag as much as a second when I type in the characters from my font Black Monday. But in that case every single character is cycled by CALT.

12 Feb 2010 — 4:28pm

James, this may be an issue. Do the Illustrator delay occurs just when Contextual Alternates are turned on? Which IL version are you using? Mac or Windows?

12 Feb 2010 — 4:48pm

Just with CALT on, using CS3 on Mac.

12 Feb 2010 — 5:08pm

For what it's worth, I haven't noticed any performance hit on any of the fonts I've done that have "advanced" contextual stuff in them, in Illustrator or otherwise. They seem to display just as fast as any other font. Maybe they're not "advanced" enough.

12 Feb 2010 — 5:23pm

Thanks again for these valuable inputs.

I still did not saw the use of CALT to substitute Arabic/Roman numbers. As the font is (also) designed to be used in legal texts, the idea is to typeset something like 48 and to have XLVIII in an automatic way. Maybe the idea is very much strange...

The possibility to combine chess figurines or typical computing itens (keyboard shortcuts, icons) seems also uncommon. Hope this would not be excessively out of CALT purpose.

12 Feb 2010 — 7:43pm

The roman numeral thing has been done before:

http://new.myfonts.com/fonts/ihof/p22-operina/

No idea how it works. P22 has done some unusual things with calt, including a font that answers questions sort of like a Magic 8 Ball.

13 Feb 2010 — 7:07am

It's really hard to be original these days. :-)

The feature P22 built is very smart. I believe they used nested lookups to achieve the substitution to any number, starting with units and adding set of ten, hundreds and thousands in a hierarchical way. Need to learn further about this.

Thanks for the tip, Mark.

13 Feb 2010 — 8:21am

I put four versions of each character in Duffy Script, and they cycle character-by-character using the "calt" feature, for a pseudo-random effect. I did notice a slight delay when opening large multi-page documents, but not something that might be attributed specifically to a font. I should add that this an entirely subjective observation, I haven't made any measurements or calculations.

13 Feb 2010 — 10:46am

There is some performance hit, but very little, and mostly noticed on older computers and older computer systems.

In the Zapfino Extra LT Pro code that I developed in 2003, there are about 600+ contextual substitutions in about a dozen lookups. In applications such as InDesign CS2 and Notepad running on Windows XP, tested some 4-5 years ago, there was a performance hit, i.e. using a really long text (100 pages or so), it does take noticeably longer time to lay out the pages than when a "regular" font is used.

Though in InDesign, after the initial delay in laying out the pages, the performance is good, since InDesign caches the glyphs. In Notepad, such caching does not take place, so even scrolling up and down the pages was kind of slow.

But such complex fonts are rarely used for continuous text that has hundreds of pages. Plus, the computers and the applications have gotten faster in text processing. So the problem is going away. And the benefits of smart fonts are in my opinion worth paying the (small) price.

14 Feb 2010 — 1:33pm

Careful with Roman numerals.

I had set these up as regular ligatures of numbers (there is probably another node advising against this).

It worked well - however inDesign seems to have ligatures switched on as default so all numbers above 9 became Roman numerals when entering in un-styled raw text.

I have since learned the lesson had have made into a Stylistic Set!

14 Feb 2010 — 3:19pm

@ All: thank you very very much! It's an honor to receive advices from masters in type design. My plan is to use stylistic sets as this:

1. glyph alternates for lowercase (a, f, g, k, y);2. glyph alternates for uppercase (G, K, R);3. beginnings;4. endings;5. Roman numerals;6. alternates for undesired optical effects;7. arrows, flourishes and dingbats;8. math symbols and alternates for math expressions;9. figurine chess notation.Of course, now I have to discover how to do the Roman numerals substitution for all numbers using OT lookups. The other I believe I already discovered how to (although I did not tested all this as the design is just beginning).

Again, thank you all.

14 Feb 2010 — 3:54pm

See if this suits you..

Note - I have added roman numerals upto 16 in my fonts as this is an expected usage of numbering of the 1st section in a book. ie 16 pages in a section.

I notice I have not updated the code to reflect this, but will post as is so I don't mess up what I have already.

Note # The order is important :

I think I found through trial and error that this order seemed to work.

I still need to retest this, but I think it works...

Note #testing if ligatures work in SS:

Self fulfilling prophesy! Here I am testing it.

====

feature ss05 {

# Romansmall

# Ligatures

# The order is important

sub one' zero' zero' zero' by onethousandroman;

sub one' zero' zero' by onehundredroman;

sub five' zero' zero' by fivehundredroman;

sub one' zero' by tenroman;

sub one' one' by elevenroman;

sub one' two' by twelveroman;

sub one' three' by thirteenroman;

sub one' four' by fourteenroman;

sub one' five' by fifteenroman;

sub five' zero' by fiftyroman;

sub one by oneroman;

sub two by tworoman;

sub three by threeroman;

sub four by fourroman;

sub five by fiveroman;

sub six by sixroman;

sub seven by sevenroman;

sub eight by eightroman;

sub nine by nineroman;

#testing if ligatures work in SS

} ss05;

============

here is my swap from lowercase to uppercase Roman numerals:

@roman1 being lowercase

@roman2 being the Caps version

============

feature ss03 {

# Stylist Set: Roman Large

sub @roman1 by @roman2;

} ss03;

===========

14 Feb 2010 — 5:15pm

Thank you, Michael. Wonderful help! I'll try it later and then bring you back the results.

14 Feb 2010 — 5:22pm

One of my targets are legal texts. Brazilian Constitution has a sequence of itens numbered in Roman which goes until LXXVIII (!).

15 Feb 2010 — 1:51am

When ordering the Stylistic sets the set changing from lowercase to Capital Roman numeral style needs to come last.

In my example above I have changed the order so that what was SS03 is now SS06.

15 Feb 2010 — 2:03am

Actually converting a date like 2012 to a roman numerals as you are trying to do is difficult and will need further input.

I have settled for a compromise and am limiting use to automatically change two numbers to small roman numerals for folios, with an option to change the result to Large Roman Numerals.

I was considering a database or a modular approach but neither seemed workable.

If your usage was for current dates you could create glyphs for the next 10 years perhaps?

For me the limit is that OpenType allows for a string in, like f_f_l but can only out put a single glyph and not a composite of 2 or more glyphs (to my knowledge).

There might be a solution if you were able to set up conditions like "IF there are 4 numbers together treat the first one like this and the second like this... ex-cetera" but this is way beyond me.

Good luck.

15 Feb 2010 — 10:36am

One of my targets are legal texts. Brazilian Constitution has a sequence of itens numbered in Roman which goes until LXXVIII (!).

Shouldn't it be leaved to layout programs instead of fonts?

15 Feb 2010 — 1:19pm

You can map a single character to multiple glyphs using AFDKO, but many applications don't currently recognise this type of substitution. Moreover, I agree with riccardO that this really is more appropriate for the application to implement rather than the font.

15 Feb 2010 — 1:59pm

@ Michael: thanks again for the input.@ Riccard0 and Agisaak: sure, you're right. As I stated above, features like Roman numerals may be best suited for InDesign GREP styles. But the possibility to have automatic number substitution through OT hooked me. At least, it's an opportunity to learn more about OT tables and features.I'm testing a way to have this substitution for almost all numbers. Of course, this is just useful if does not cause hundreds of lines of code. If I get it done, I'll share here.

15 Feb 2010 — 3:12pm

Well, without using one to many substitutions, this would be fairly straightforward provided you included ligatures for roman numerals 2, 3, 4, 6, 7, 8, 9, 20, 30, 40, 60 and 70 (assuming you only want to go as high as LXXVIII). To produce larger numbers you'd need more ligatures, but it would remain manageable. A simple ignore statement could be used to prevent the feature from applying to numbers which fall outside of the range.

I'll leave the actual code as an exercise for the reader.

André

15 Feb 2010 — 7:39pm

Automatic Roman numerals from Arabic onesI created a code to apply automatic substitution to any number from 1 to 9999. With just 37 substitutions, the code seems to be fair. But as I'm a novice, it may be improved by more experienced designers.

To proceed all substitutions, the font needs 30 additional glyphs. And the principle behind all these substitution could be used in other similar procedures.

Firstly, you need a class which brings together all numeric figures in the font:

`@NUMBERS=[@ONE @TWO @THREE @FOUR @FIVE @SIX @SEVEN @EIGHT @NINE @ZERO];`

Then, you create a Stylistic Set with four lookups of substitutions, ordened this way: thousands, hundreds, sets fo ten and units:

`feature ss09 {`

lookup

THOUSANDS{sub one' @NUMBERS @NUMBERS @NUMBERS by M.sc;

sub two' @NUMBERS @NUMBERS @NUMBERS by twothousand.rm;

sub three' @NUMBERS @NUMBERS @NUMBERS by threethousand.rm;

sub four' @NUMBERS @NUMBERS @NUMBERS by fourthousand.rm;

sub five' @NUMBERS @NUMBERS @NUMBERS by fivethousand.rm;

sub six' @NUMBERS @NUMBERS @NUMBERS by sixthousand.rm;

sub seven' @NUMBERS @NUMBERS @NUMBERS by seventhousand.rm;

sub eight' @NUMBERS @NUMBERS @NUMBERS by eightthousand.rm;

sub nine' @NUMBERS @NUMBERS @NUMBERS by ninethousand.rm;

} THOUSANDS;

lookup

HUNDREDS{ignore substitute @NUMBERS' @NUMBERS @NUMBERS @NUMBERS;

sub one' @NUMBERS @NUMBERS by C.sc;

sub two' @NUMBERS @NUMBERS by twohundred.rm;

sub three' @NUMBERS @NUMBERS by threehundred.rm;

sub four' @NUMBERS @NUMBERS by fourhundred.rm;

sub five' @NUMBERS @NUMBERS by D.sc;

sub six' @NUMBERS @NUMBERS by sixhundred.rm;

sub seven' @NUMBERS @NUMBERS by sevenhundred.rm;

sub eight' @NUMBERS @NUMBERS by eighthundred.rm;

sub nine' @NUMBERS @NUMBERS by ninehundred.rm;

} HUNDREDS;

lookup

TENS{ignore substitute @NUMBERS' @NUMBERS @NUMBERS;

sub one' @NUMBERS by X.sc;

sub two' @NUMBERS by twoten.rm;

sub three' @NUMBERS by threeten.rm;

sub four' @NUMBERS by fourten.rm;

sub five' @NUMBERS by L.sc;

sub six' @NUMBERS by sixten.rm;

sub seven' @NUMBERS by seventen.rm;

sub eight' @NUMBERS by eightten.rm;

sub nine' @NUMBERS by nineten.rm;

} TENS;

lookup

UNITS{ignore substitute @NUMBERS' @NUMBERS;

sub one' by I.sc;

sub two' by two.rm;

sub three' by three.rm;

sub four' by four.rm;

sub five' by V.sc;

sub six' by six.rm;

sub seven' by seven.rm;

sub eight' by eight.rm;

sub nine' by nine.rm;

} UNITS;

lookup

ZEROS{sub zero' by zero.rm;

} ZEROS;

} ss09;

Note the last lookup is a trick: to remove the zeros I applied a general substitution to a glyph zamed zero.rm. This glyph is empty and has zero width. So, all the zeros are hidden.

It's running OK in the tests I made.

15 Feb 2010 — 9:08pm

A PDF with code and comments is available here:

http://if.pro.br/RomanNumerals.pdf

A font for test, based on FreeFontPro, is here:

http://if.pro.br/FreeRoman.otf

24 Feb 2010 — 5:58pm

The serif project I did mention could be previewd in the Critique section:

http://typophile.com/node/67787

24 Mar 2010 — 10:52am

@riccard0 and @agisaak

You are both right in saying this *should* be managed through the software. [I'm not aware that it is currently available] Please write to Adobe and request it!

Until that time, I am pretty hyped by this solution.

@Freiberger. I got back on this today. Perhaps I can push this on a little further?

I notice that the code in your pdf and the code in the Font are handled slightly differently. Both will work I believe.

Keeping close to what was used in the font and therefore relying on the @ordn1 rather than @numbers I did the following - but updated the naming of the glyphs to reflect the fact that I see this code for the capitalised versions of the Roman Numerals.

Also because there are existing names and unicodes for some of the Roman Numerals – I am using these.

Though using small caps letters x.sc is an elegant shortcut, I have decided to have actual numbers used. Traditionally Roman numerals are not letters but are their own expression, I am creating new glyphs for the M, C, L and D.

feature ss09 { # Stylistic Set 9

# Latin

# Advanced Roman Numerals Converter

# 1-9999

lookup THOUSANDS {

sub one' @ordn1 @ordn1 @ordn1 by Onethousandroman;

sub two' @ordn1 @ordn1 @ordn1 by Twothousandroman;

sub three' @ordn1 @ordn1 @ordn1 by Threethousandroman;

sub four' @ordn1 @ordn1 @ordn1 by Fourthousandroman;

sub five' @ordn1 @ordn1 @ordn1 by Fivethousandroman;

sub six' @ordn1 @ordn1 @ordn1 by Sixthousandroman;

sub seven' @ordn1 @ordn1 @ordn1 by Seventhousandroman;

sub eight' @ordn1 @ordn1 @ordn1 by Eightthousandroman;

sub nine' @ordn1 @ordn1 @ordn1 by Ninethousandroman;

} THOUSANDS;

lookup HUNDREDS {

ignore sub @ordn1' @ordn1 @ordn1 @ordn1;

sub one' @ordn1 @ordn1 by Onehundredroman;

sub two' @ordn1 @ordn1 by Twohundredroman;

sub three' @ordn1 @ordn1 by Threehundredroman;

sub four' @ordn1 @ordn1 by Fourhundredroman;

sub five' @ordn1 @ordn1 by Fivehundredroman;

sub six' @ordn1 @ordn1 by Sixhundredroman;

sub seven' @ordn1 @ordn1 by Sevenhundredroman;

sub eight' @ordn1 @ordn1 by Eighthundredroman;

sub nine' @ordn1 @ordn1 by Ninehundredroman;

} HUNDREDS;

lookup TENS {

ignore sub @ordn1' @ordn1 @ordn1;

sub one' @ordn1 by Tenroman;

sub two' @ordn1 by Twentyroman;

sub three' @ordn1 by Thirtyroman;

sub four' @ordn1 by Fourtyroman;

sub five' @ordn1 by Fiftyroman;

sub six' @ordn1 by Sixtyroman;

sub seven' @ordn1 by Seventyroman;

sub eight' @ordn1 by Eightyroman;

sub nine' @ordn1 by Nintyroman;

} TENS;

lookup UNITS {

ignore sub @ordn1' @ordn1;

sub one' by Oneroman;

sub two' by Tworoman;

sub three' by Threeroman;

sub four' by Fourroman;

sub five' by Fiveroman;

sub six' by Sixroman;

sub seven' by Sevenroman;

sub eight' by Eightroman;

sub nine' by Nineroman;

} UNITS;

lookup ZEROS {

sub zero' by zeroroman;

} ZEROS;

} ss09;

25 Mar 2010 — 8:20am

.

25 Mar 2010 — 4:16pm

Michael,

when I built up this solution I was unaware about Unicode glyphs to Roman Numerals. Of course, I think they must be used and also determines the name format to other glyphs created to Romans.

I'll remain to small caps instead of creating new glyphs to I, V, X, L, C, D and M. My choice is because the font has 1,600 glyphs now (and counting!), even without Greek and Cyrillic support. So I'm trying to keep it less huge.

As long as I can see, our code is the same. The difference resides on the class you used and the glyph naming criteria, no?

This Roman Numerals question gave me some other ideas – as to simulate ink variations found in old metal type prints. Probably I'll never use them (as the 'palimpsest project' is the only font I plan to create) but OT possibilities are great.

25 Mar 2010 — 4:33pm

A roman font should have no space character...or replace it with a centered period.

25 Mar 2010 — 5:34pm

Sorry Nick, but I did not understand. No space character? Are you referring to Classic Latin, when word separation was made with centered periods and diamonds?

25 Mar 2010 — 6:33pm

@Freierger Again thanks for working on this. I have now dropped this in one of my fonts, which also has small roman ligatures from i to xvi (i.e to cover the first signature in a book).

Roman and Unicode: Check: Fileformat Unicode Page

Ink effect: interesting challenge!

Randomised characters are talked about elsewhere on this board in a couple of places. @Nick might know?