How to automatically enable an opentype feature?

sepp88's picture

Hey guys,

i'm pretty new to Open-Type-Scripting and I'm doing an experiment for a university project where I'm trying to substitute Characters.

For Instance in my font I don't need Uppercase Characters so I do stuff like this

sub A by alpha;
sub N by eng;
sub I by dotlessi;

So this makes it possible that I can type an dotlessi character on my regular keyboard.

I'm currently doing this stuff in Glyphs.app but have no idea how to enable this in my exported .oft font.
Moreover for my "experiment" I created my own OTF-Feature called "phon"

So, since I'm new to this I have no idea how to enable this substitution of this characters in my final font.
E.g. I'm talking about the fact that when I give this font to anybody I want it to automatically work with the subsitution stuff, without enabling any features in InDesign or whatsoever.

Can you guys give me feedback or some insights on that?
E.g. I've also tried adding my scripts to the "liga" feature, that works in Glyphs, but when I export the font as opentype and enable ligatures in InDesign it still doesn't replace my characters.

Thank you in advance,
sepp

Mark Simonson's picture

You can't make up your own feature tags (such as "phon"). There is no support for that in OpenType. You have to use one of the existing ones.

I would suggest reading the documentation on OpenType feature tags: http://partners.adobe.com/public/developer/opentype/index_tag5.html

cerulean's picture

If you want it always, and you're making the font, you should just put the eng outline in the N character. Opentype substitution is meant to preserve the original plaintext, so even if you made it work, it would be essentially the same as that. If you wanted the plaintext to be altered while you type, such that if you then changed it to Times New Roman it would still contain the new characters, a font can't do that.

Mark Simonson's picture

If you put the eng in the N character slot and type N, you get and eng. But if you change the font, it's going to revert to an N because it's still encoded as an N, regardless of what's displayed.

Also, I don't think there is any OpenType feature for simple substitutions like that which is also enabled by default.

sepp88's picture

Thank you for your Feedback.
First off, I get now that I can't make up my own feature! However I wonder if there are OTF Features that are "on" by default?

Imagine this: I'm buying a font and ligatures like f f are always replaced by ff automatically, right? At least that's how I have it in mind. I don't have to enable this feature in any way. It just works.

I wonder where I could put my character substitutions so the work automatically when I hand my font to somebody?

I always understood that OTF substituion doesn't replace the actual character, just displays a different one. but that is exactly what I want.

For your better understanding:
I'm working on a kind of phonetic alphabet where I'm trying to create logic inputs for weird diacritics and stuff. E.g. sub degree u by uring; which is a u with a little ring on top.

Mark Simonson's picture

liga (ligatures) is on by default, but I'm not sure if one-to-one substitutions are supported with it. It's designed for many-to-one substitutions (e.g., f i > fi or f l > fl). It should work for the example you give in the last paragraph. I've many other fonts that use liga in this way.

cerulean's picture

If ligatures already work in the software you're using, it's because the feature is on by default in that particular software. Other users may have turned it off, or use something that doesn't support it (fortunately liga is the most commonly supported feature). You are making a font that will have to be distributed with a set of instructions anyway, so those instructions should include what features to have on.

Michel Boyer's picture

I can do it with FontForge which allows me do add a required feature. Here is a grab of the tool I used to add the feature:


and here is what I get in Word if I activate ligatures (I modified a STIX general font) and type Affaire Itinéraire.

charles ellertson's picture

For Instance in my font I don't need Uppercase Characters so I do stuff like this

sub A by alpha;
sub N by eng;
sub I by dotlessi;

So this makes it possible that I can type an dotlessi character on my regular keyboard.

and

I wonder where I could put my character substitutions so the work automatically when I hand my font to somebody?

Don't ever do this. What you do in the privacy of your bedroom is your business. But don't ever make up a font that will (1) have any distribution, and (2) has erroneous character encodings. And that seems to be what you're proposing. The glyphs will be accurate only when your font is used, at the expense that the characters are all wrong in your file. As soon as someone changes fonts with your text file -- to any other font -- the wrong character will appear.

We've been all through this with PostScript Type 1. The result was (1) errors, and (2) a lot of extra time and money spent getting things right. Whythehell do you think Unicode is necessary, anyway?!

As an experiment, fine. To print out something where the underlying *file* will never see the light of day, fine too. (Though it would be better just to program a custom keyboard, and use proper Unicode in the font itself). But to let such a font loose in the world, no.

Edit: Here's an analogy. I'm your professor. I'm going to give you an "A" for your work. But on a keyboard, the "A" is way over on the left, where my weak little pinky finger is. For my ease, so that I can use my strong pointer finger when giving grades, I'm going to switch "A" and "F" in my font (rather than make up a custom keyboard).

When I print out your grade for you, it's an "A". But when I turn my files in to the university for your permanent grade records...

Michel Boyer's picture

Here is a Sinhalese site where the text is written using the latin script and rendered with Sinhalese glyphs using a special font, samagana.woff.

http://www.lovatasinhala.com/index.php#

When you click on « Latin Script » and « Singhala Script », you simply change the font that renders the text.

Of course, since the underlying text uses the latin alphabet, if you copy some Sinhalese text from that page and paste it in TextEdit, Word, etc, you get the text it the latin script, unless you have the right font to render it. Also, if you search for a word in the Sinhalese text, you need to type it in the latin script, else it is not found. Since the font used in the search window cannot be easily changed, you can hardly avoid that inconsistency, else a properly modified keyboard layout might be useful.

For young people that grew up in America and know Sinhala because it is spoken at home, but have had no education in the language, that may not be a bad choice.

Syndicate content Syndicate content