Help with OpenType handwriting font programming?

matt_desmond's picture

I'm working on a handwriting font that I would like to make semi-random. I alrady have glyphs for primary and alternate forms set up in fontlab. I tried to read through the Microsoft OpenType spec but it was like eating a box of rocks, a little hard to swallow. All I want to do is code the font so that "ss" and other dual characters that I set up will automatically be replaced with "s s.Alt" etc.

Can someone point me to an easy guide to the programming side of OTFs, or let me know which code sequence I should be using?

John Hudson's picture

Are you making the OpenType features with FontLab or VOLT or ? If we know what tools you are using, we can provide more precise advice.

Basically, though, you want to create a set of substitution lookups for the Contextual Alternates <calt> layout feature. I use VOLT for OpenType, so in VOLT syntax I would express your example in this way:

s -> s.alt
s |

The bar in the second line indicates the context, so this substitution would occur whenever preceded by s.

Someone else can probably explain the FontLab / Adobe FDK syntax better than I can. I always have to go and read the manual again whenever I do any OT work directly in FontLab.

andreas's picture

please try

feature calt {
sub s s' by s.alt;
} calt;

' indicates the glyph to be changed.

matt_desmond's picture

Thanks for your help. I'm using FontLab, but I think I'll download volt to check it out.

Thomas Phinney's picture

There are three types of substitutions that may be useful to you:

- ligatures
- contextual alternates
- contextual ligatures

Ligatures are easy as pie. For example, if you have an ss ligature with a glyph name of "s_s" (not to be confused with the German eszett), you could do:

feature liga {
sub s s by s_s;
} liga;

Or for a contextual substitution where you get a different ss ligature when ss comes after the letter "e"

feature clig {
sub e s' s' by s_s.alt;
} clig;

Note that you would want to put the clig feature ahead of the liga feature to make that work. Otherwise you'd already have the s_s ligature and that substitution wouldn't fire. To make clig work *after* liga, you'd do:

feature clig {
sub e s_s by s_s.alt;
} clig;

Hope this quick tutorial helps.

T

matt_desmond's picture

Awesome, thanks for all of your help. :-)

Now, my next goal is to make a completely random opentype font where there are 3 or 4 different glyphs for each character. ;-) I know there's a random feature that I need to figure out...

twardoch's picture

Matthew,

there is a "rand" OpenType feature registered in the spec, but it isn't supported by any application (to my knowledge). Therefore, you're best to try clig/calt as suggested above.

Adam

type's picture

I use VOLT for OpenType


what is VOLT?

John Hudson's picture

VOLT = Visual OpenType Layout Tool

This is a free, Windows-only tool provided by Microsoft for adding OpenType Layout functionality to TrueType fonts*. It has a number of advantages over current FontLab and the Adobe FDK, most importantly in supporting some lookup types that are not supported in the FDK code, particularly one-to-many substitutions and anchor attachment positioning. It also allows you to order lookups independently of features, which means you can stagger lookups from different features which can help efficiency. VOLT is pretty much essential for doing any work with complex scripts, so it has a large user base of Indian and Arabic font developers. I've been using it since 2000, and still prefer it to FontLab for this kind of work.

*It can also be used to add such functionality to CFF OT fonts, but VOLT does not have a CFF rasteriser, so you need to do your work in a dummy TT font and then import it to a CFF font.

pablohoney77's picture

I've wondered about the "rand" feature. Would it be set up like:
sub x from [x x.salt1 x.salt2 x.salt3 (etc.)]
and then the application would randomly pick from within that set? or is there a more ideal way that this would be set up?
unfortunately, i doubt any apps will support this feature anytime soon, but it'd be nice to know how this feature would be written in theory.

type's picture

VOLT = Visual OpenType Layout Tool

This is a free, Windows-only tool provided by Microsoft for adding OpenType Layout functionality to TrueType fonts*. It has a number of advantages over current FontLab and the Adobe FDK, most importantly in supporting some lookup types that are not supported in the FDK code, particularly one-to-many substitutions and anchor attachment positioning. It also allows you to order lookups independently of features, which means you can stagger lookups from different features which can help efficiency. VOLT is pretty much essential for doing any work with complex scripts, so it has a large user base of Indian and Arabic font developers. I've been using it since 2000, and still prefer it to FontLab for this kind of work.



Not too fast. Not too fast. I work with computers, but I'm not a computer whiz.


VOLT is pretty much essential for doing any work with complex scripts


Scripts - typefaces? or programming issue?


so it has a large user base of Indian and Arabic font developers.

you design Indian and Arabic fonts?

John Hudson's picture

Scripts - typefaces? or programming issue?

Heh, sorry, neither. The term 'complex script' is used to refer to a writing system in which there is not a simple sequential rendering of glyphs relative to character codes. So Latin is typically considered a simple or non-complex script, because there is a one-to-one relationship between the characters that you type and the glyphs that appear on your screen, which are simply laid out in a line. Of course, once you start including ligatures, variant letters, dynamic accent positioning, etc. Latin ceases to be so simple, but it remains differentiated from complex scripts in the sense of writing systems that require complex processing simply in order to be readable. So, for example, Arabic is a complex script because individual letters may take different forms depending on where they occur in a word or what the adjacent letters are, and this is normative behaviour for the writing system.


you design Indian and Arabic fonts?

I have not designed any Indian typefaces yet, but I'm looking forward to it. I've done Thai (with Fiona Ross and Tim Holloway), which is related to the Indic writing systems. I've collaborated (again, with Fiona and Tim) on Arabic font development, although Tim does most of the actual design and I have the fun job of making the complex script stuff work with OpenType lookups. The most complex thing I've had to both design and build was the SBL Hebrew font for Biblical Hebrew.

type's picture

I've done Thai.... I've collaborated on Arabic font development...
The most complex thing I've had to both design and build was the SBL Hebrew font for Biblical Hebrew.



Interesting. Do you speak the language(s)? Did you know that you want to design non-latin typefaces?

I'm reading the book "Designing Typefaces" -now the story by Akira Kobayashi. That is why I'm asking.

Do you think it is wise to study/learn another language?
I'm asking that since of the thread "Breaking into the Industry"

Back to VOLT - In order to design non-latin typefaces you need VOLT? and PC?
Why you can't design non-latin typefaces with MAC?


Oh....what is "SBL"?

John Hudson's picture

I don't speak most of the languages for which I design type. Even if I spoke one language for each of the scripts for which I design, that would still be only a tiny percentage of the actual languages written in those scripts. Speaking or reading knowledge of a language is not necessary to design for 'foreign' scripts. It is important to have a good understanding of the history and development of the script, or to work closely with people who do. I try to understand scripts as systems, in terms of construction, relationship to language and grammar, etc. Most often, I arrange to have my work reviewed by an experienced typographer who is a native user of the script, unless I'm particularly confident in my knowledge of a script or can't find someone with the appropriate skills and experience.

I started designing for non-Latin scripts in 1997, when I tried my first Cyrillic design. At the time, I was mainly looking for a way to expand the number of shapes I got to draw: I was getting bored of Latin letters. Later I realised that I'd accidentally stumbled into one of the few growth areas in this business, and also one in which few of my colleagues were working.


You can make plenty of non-Latin typefaces without VOLT. You only need VOLT if the script requires OpenType Layout features that are not supported in FontLab yet, e.g. anchor attachment positioning. Since VOLT is a Windows tool, you need to either be running a Windows machine or VirtualPC to make complex script OT fonts. You can, of course, make AAT format complex script fonts using free tools from Apple, but the tools are ludicrously difficult and the format has only minimal application support and is not cross-platform compatible.

A lot of people who start out in Latin script type design come to it from a North American or European graphic design background, in which the Mac is still the most common tool. But for non-Latin font development and use Windows is a much more common platform. Personally, when I look at the range of font development applications and tools that are available on Windows, many of them free, I really can't see any point in using a Mac. Windows is simply a better font development environment. This is not to say that typical Latin font makers are missing out on anything by using a Mac: if everything you need to do can be done in FontLab, then it doesn't matter what platform you are on. But I have upwards of 20 font development and testing applications on my system, which perform a variety of functions including things that cannot be done in FontLab and which have no parallel on the Mac. Now, I should also point out that most of my clients are major software developers, who have very strict technical quality assurance requirements, so the kind of non-critical bug that might pass unnoticed in the average Latin retail font is not acceptable in my work. And if, for example, my client says they want a TT font to have a version 3 OS/2 table and a format 3 post table, I need to be able to deliver that, even if FontLab doesn't have these options yet.


SBL is the Society of Biblical Literature, a scholarly organisation that is one of my clients.

type's picture

More interesting!


Later I realised that I'd accidentally stumbled into one of the few growth areas in this business, and also one in which few of my colleagues were working.

Now I have a challenge!


In your opinion - to buy a PC? Is there a good PC? Windows or XP? ( I don't know if I'm going to do that this year...)

if everything you need to do can be done in FontLab, then it doesn't matter what platform you are on

I don't know what I want to do, or can do, or "can be done with FontLab"

John Hudson's picture

If you want to buy a Windows PC, I suggest a Dell machine running Windows XP Pro. Some of the Toshiba Satellite laptops are quite good too. I should also note that I don't know much about current PC desktop hardware, as I've only used laptops for the past five years.

type's picture

Thank you John.

(By the way, I have Toshiba Satellite laptop , but with Windows 98)

hrant's picture

> Speaking or reading knowledge of a language is
> not necessary to design for 'foreign' scripts.

As I expressed in my recent Spatium magazine article, with proper help from natives (like in proofing legibility), linguistic analysis and a general sensitivity to cultural authenticity and functionality, a non-native can produce very good type in scripts he doesn't even know the elemental sounds for! But one thing you can't do without nativity is push the cultural boundaries, to express things beyond what historical precedent will encourage.

hhp

type's picture

But one thing you can't do without nativity is push the cultural boundaries, to express things beyond what historical precedent will encourage.

cultural boundaries - such as....?

hrant's picture

For example let's say you need to make a dual-script system with Latin and a non-Latin font. To know how much and in what directions you can "push" the non-Latin component to match the Latin requires a sensitivity that goes way beyond what a non-native can usually muster.

hhp

type's picture

<font class="dontLookLikeCrap">let's say you need to make a dual-script system with Latin and a non-Latin font

any good sample? your work? I see that you are dealing with non-latin, no ( and came from Russia. Do you speak Russian?)


By the way - do you any good source to learn/study: Russian, Arabic, Hebrew, Latin, Greek -

like Alexander Lawson, Alexander & Nicholas Humez (Alpha to Omega - Greek history as seen through the development of its language & alphabet)</font>

hrant's picture

Got $15? Buy the current issue of Spatium magazine - all is explained. :->

Russian: I just learned to pronounce all the letters, but that's about it. I've heard it's a hard language.

Resources: I saw that other thread of yours - give me a day or two.

hhp

type's picture

You're fast. Thanks.

Got $15? Buy the current issue of Spatium magazine

From ?

dezcom's picture

Hrant,
My copy of Spatium just came in the mail today. Hmmmm, ah, let me see here. . .ah, YES, page 10 "Latinization: Prevention and Cure, by Hrant H. Papazian. :-)

Bravo Hrant!

ChrisL

hrant's picture

I love cross-polination. I also love cultural variety. The degree to which these two things can coexist positively depends on the "security" of the scripts/cultures in question. What I mean is that for example Latinization of Armenian is much worse than that of Cyrillic or Arabic. And things like the Arabization of Latin is downright great - and I'm not saying this due to some cultural prejudice, but simply because Latin is too strong to be hurt by it - it can only get richer thanks to cross-polination.

Also, a big on-the-ground problem with cross-polination is that it's almost never done with the subtlety necessary in the realm of text design. Virtually all Latinized non-Latin fonts reduce readability through blind fealty to formalism (eg matching x-heights), and pretty much every single Latin face that's made to look like some non-Latin script or other can only ever be a cute, naive display face. We need to clearly understand the qualitative difference between text and display before we can apply typographic cross-polination well. But even then sometimes it's a bad idea.

hhp

hrant's picture

> I recently came across [http://www.p22.com/pavilion/index.html] at p22

Wow, now I know the real meaning of Unicase: the PTAF font (in the first set).
Dude, you could like base an entire 20th century design ideology on that, dude.

hhp

Christian Robertson's picture

In response to Hrant's comment on cultural boundaries:

I've found that a little cultural cross polination is the perfect way to push cultural boundaries. For example, Latin alphabets done in Japan are very interesting. (I recently came across these at p22). Even from a linguistic standpoint, non-native speakers often use expressive transliterations that, because they are different from common idioms, communicate beautifully.

Now, Hrant may argue that becuase so many Roman-native type designers do non-roman fonts, the cross-polination has gone out of control--an invasive species out-competing the native fauna, as obrusive as non-native sucker fish, sqeezing out the native trout in my state. This may very well be the case.

Syndicate content Syndicate content