OpenType Titling (titl) Feature?

lukelisi's picture

To preface, this is my first post to the forum and I've done a fair amount of digging on the issue, but haven't found any solution to my question. Apologies in advance if it has been answered somewhere else. And I must say, that the community here has been extremely invaluable so far!

I have designed Titling Alternates (labeled titling in OpenType Classes) for the Uppercase (upcs in OpenType Classes) glyphs in my font.

For this, my feature is as follows:

feature titl { sub @upcs by @titling; } titl;

I want to also vertically position the quotes (quotes in OpenType Classes) to match the height of the Titling Alternates when that feature is activated. Normally, this is done by creating duplicate glyphs and adjusting them manually, then calling to that respective OpenType Class. However, I want to avoid creating the duplicate glyphs. To do this, I've created a new feature for case and used something like:

feature case { pos @quotes <0 -100 0 0>; } case;

This is working great, however I want to make everything accessible through the Titling Alternates Feature and it currently isn't since the quotes are set up in the case feature.

My immediate solution was to simply do something like this...

feature titl {
sub @upcs by @titling;
pos @quotes <0 -100 0 0>;
} titl;

...but for some reason, it's compiling a duplicate feature of titl in my OpenType Feature Preview. And upon exporting the font for testing, the quotes position feature isn't working.

I'm a novice type designer and somewhat new to OpenType coding and syntax so I'm sure I'm doing something wrong. Any ideas on how to properly set this up so it's accessible in the Titling Alternates Feature?

Thanks in advance!

John Hudson's picture

What software are you using?

George Thomas's picture

What app are you testing your font in?

lukelisi's picture

Sorry about omitting that.: FontLab 5.

JanekZ's picture

http://www.adobe.com/devnet/opentype/afdko/topic_feature_file_syntax.html#4
A feature file "rule" is a statement that specifies glyph substitution or glyph positioning. A feature block may contain glyph substitution rules [§5], glyph positioning rules [§6], or both.
A lookup is a group of rules of the same type. See §4.e.

lookup titl0 {
sub @upcs by @titling ;
} titl0;

lookup titl1 {
pos @quotes <0 -100 0 0>;
} titl1;

feature titl {
script DFLT;
language dflt ;
lookup titl0;
lookup titl1;
} titl;

John Hudson's picture

FontLab 5 uses an old version of AFDKO that only compiles kern feature GPOS. You would probably need to compile the feature code directly in the font with AFDKO, or use one of the newer font tools that use the more recent AFDKO code (DTL OTMaster, Glyphs, RoboFont). Note that I've never tried combining GSUB and GPOS lookups in a single feature using any of these tools; I do all of my OpenType Layout work in VOLT.

JanekZ's picture

[edit]
That way or another the code works as described (ID5).
I would add the FontForge to your tools list.

erwindenissen's picture

You probably see two titl features in FontLab because internally the feature is split into GPOS and GSUB.

JanekZ's picture

Right
I opened the font created in FontForge and now FontLab generated new font without errors. Font works fine in ID5.
So it looks that FL uses AFDKO 2.5 syntax. [FL demo build 4868]
BTW the idea of feature split between GSUB and GPOS is a bit strange, but who cares, it works.

lukelisi's picture

I tried manually inserting the feature code Janek provided using RoboFont to test the idea, but it didn't seem to work as I had hoped (I'll caveat that by saying I'm probably doing something wrong).

However, using FontLab 5, the feature (of combining GPOS and GSUB) works in the exported OTF as anticipated using ID CC, but the feature does not work in Illustrator CC (or CS6). The OTF is only utilizing the GSUB glyphs in AI.

I understand that combining GPOS and GSUB into one feature is odd, but this is more of an experimental exercise. Right now, I'm happy with the results; however, I may just end up creating modified glyphs (repositioned), adding a class then using GSUB. This will probably produce the most predictable results among the design programs.

Thank you all for the great feedback!

Syndicate content Syndicate content