OpenType feature to flip between two sets

Primary tabs

18 posts / 0 new
Last post
Pieter van Rosmalen's picture
Joined: 3 Mar 2005 - 3:23am
OpenType feature to flip between two sets
0

Hi all,

I'm working on a typeface with two versions of each character. I made two sets and called them @set1 and @set2. Every set has five characters after which I like to 'swap' to the other set. The characters are C E J S Z and c e j s z.
For example. I like to go like this: ABCdeFGHIJklmnopqrsTUVWXYZabcDE etc
I can't get the code working, can somebody help me?
Thanks!

Pieter

Pieter van Rosmalen's picture
Joined: 3 Mar 2005 - 3:23am
0

This is the feature I wrote:


feature liga {
# Latin
sub C @set1' by @set2;
sub E @set1' by @set2;
sub J @set1' by @set2;
sub S @set1' by @set2;
sub Z @set1' by @set2;
sub c @set2' by @set1;
sub e @set2' by @set1;
sub j @set2' by @set1;
sub s @set2' by @set1;
sub z @set2' by @set1;
sub @set2 @set1' by @set2;
sub @set1 @set2' by @set1;
} liga;

Pieter

Stephen Rapp's picture
Offline
Joined: 17 Sep 2006 - 3:41pm
0

You might need to show us what your classes are, but from the get go this doesn't look like it belongs in the liga feature, but rather calt.

j's picture
j
Offline
Joined: 30 Jul 2004 - 1:49pm
0

Are you saying you want to use those letters as a switch to change all the letters that appear after them?

Pieter van Rosmalen's picture
Joined: 3 Mar 2005 - 3:23am
0

@ Stephen: I know, but I choose the liga feature because it's on at default in a few programs.

@ Jackson: Yes, that's what I like.

classes:

@set1 = [A B C D E F G H I J K L M N O P Q R S T U V W X Y Z];
@set2 = [a b c d e f g h i j k l m n o p q r s t u v w x y z];

Thanks!
Pieter

j's picture
j
Offline
Joined: 30 Jul 2004 - 1:49pm
0

The main problem is that the trigger glyphs were in the classes you were switching. Try this:

feature CALT {

@set1 = [A B D F G H I K L M N O P Q R T U V W X Y];
@set2 = [a b d f g h i k l m n o p q r t u v w x y];
@trip1 = [C E J S Z];
@trip2 = [c e j s z];

sub @trip1 @set1' by @set2;
sub @trip1 @set2 @set1' by @set2;
sub @set2 @set2 @set1' by @set2;
sub @set2 @set2 @trip1' by @trip2;

sub @trip2 @set2' by @set1;
sub @trip2 @set1 @set2' by @set1;
sub @set1 @set1 @set2' by @set1;
sub @set1 @set1 @trip2' by @trip1;

} CALT;

Pieter van Rosmalen's picture
Joined: 3 Mar 2005 - 3:23am
0

Hello Jackson,

Thanks for the code, but unfortunately it's not working: ABCdefghijklmnopqrstuvwxyz
It's not flipping back to @set1 anymore.

This is what I like to happen: ABCdeFGHIJklmnopqrsTUVWXYZabcDEfghijKLMNOPQRSTuvwxyzAB etc

Pieter

j's picture
j
Offline
Joined: 30 Jul 2004 - 1:49pm
0

feature CALT {

@set1 = [A B D F G H I K L M N O P Q R T U V W X Y];
@set2 = [a b d f g h i k l m n o p q r t u v w x y];

@trip1 = [C E J S Z];
@trip2 = [c e j s z];

sub @set1 @trip1 @set1' by @set2;
sub @set2 @trip2 @set2' by @set1;

sub @trip1 @trip1' by @trip2;
sub @trip2 @trip2' by @trip1;

sub @set2 @set1' by @set2;
sub @set2 @trip1' by @trip2;

sub @set1 @set2' by @set1;
sub @set1 @trip2' by @trip1;

} CALT;

I should've paid more attention to your string...

j's picture
j
Offline
Joined: 30 Jul 2004 - 1:49pm
0

Err.. needed one more thing:

feature CALT {

@set1 = [A B D F G H I K L M N O P Q R T U V W X Y];
@set2 = [a b d f g h i k l m n o p q r t u v w x y];

@trip1 = [C E J S Z];
@trip2 = [c e j s z];

sub @set1 @trip1 @set1' by @set2;
sub @set2 @trip2 @set2' by @set1;

sub @trip1 @trip1' by @trip2;
sub @trip2 @trip2' by @trip1;

sub @set2 @set1' by @set2;
sub @set2 @trip1' by @trip2;
sub @trip1 @set1' by @set2;

sub @set1 @set2' by @set1;
sub @set1 @trip2' by @trip1;
sub @trip2 @set2' by @set1;

} CALT;

j's picture
j
Offline
Joined: 30 Jul 2004 - 1:49pm
0

Err.. needed one more thing:

feature CALT {

@set1 = [A B D F G H I K L M N O P Q R T U V W X Y];
@set2 = [a b d f g h i k l m n o p q r t u v w x y];

@trip1 = [C E J S Z];
@trip2 = [c e j s z];

sub @set1 @trip1 @set1' by @set2;
sub @set2 @trip2 @set2' by @set1;

sub @trip1 @trip1' by @trip2;
sub @trip2 @trip2' by @trip1;

sub @set2 @set1' by @set2;
sub @set2 @trip1' by @trip2;
sub @trip1 @set1' by @set2;

sub @set1 @set2' by @set1;
sub @set1 @trip2' by @trip1;
sub @trip2 @set2' by @set1;

} CALT;

Thomas W Phinney's picture
Joined: 3 Sep 2002 - 11:00am
0

"@ Stephen: I know, but I choose the liga feature because it’s on at default in a few programs."

So is calt.

T

Pieter van Rosmalen's picture
Joined: 3 Mar 2005 - 3:23am
0

Hello Jackson,

It's working! Thank you very much! You made me a happy man.

Pieter

Pieter van Rosmalen's picture
Joined: 3 Mar 2005 - 3:23am
0

Hello Thomas,

I didn't know that. Thanks!

Pieter

Pieter van Rosmalen's picture
Joined: 3 Mar 2005 - 3:23am
0

Hello Jackson,

I like to thank you again! :) It's perfect!

Pieter

j's picture
j
Offline
Joined: 30 Jul 2004 - 1:49pm
0

No problem, that was a fun distraction on a lazy working day.
I'm curious how this is going to translate into a design, look forward to seeing it.

Pieter van Rosmalen's picture
Joined: 3 Mar 2005 - 3:23am
0

Hello Jackson,

I will show you later. It's for a client and I'm not allowed to show it before the official introduction.

Pieter

j's picture
j
Offline
Joined: 30 Jul 2004 - 1:49pm
0

Awesome, good luck!

Chris Lozos's picture
Offline
Joined: 25 Feb 2004 - 11:00am
0

...
ChrisL