fontlab - dealing with alt# versions

clankill3r's picture

Atm i got this code, i only need it 26 times (A to Z) and also with a lot more @all betweens it in case a 'j' is for example 100 chars away from the last 'j'.
Also i got 100 alt versions for each letter.
This would mean 26x100x100 = 260.000 rules of code..

Atm the code looks like this and it works:

[code]feature salt {
lookup rotate {

sub A.alt2 A' by A.alt3;
sub A.alt2 @all A' by A.alt3;
sub A.alt2 @all @all A' by A.alt3;
sub A.alt2 @all @all @all A' by A.alt3;
sub A.alt2 @all @all @all @all A' by A.alt3;
sub A.alt2 @all @all @all @all @all A' by A.alt3;
sub A.alt2 @all @all @all @all @all @all A' by A.alt3;
sub A.alt2 @all @all @all @all @all @all @all A' by A.alt3;

sub A.alt1 A' by A.alt2;
sub A.alt1 @all A' by A.alt2;
sub A.alt1 @all @all A' by A.alt2;
sub A.alt1 @all @all @all A' by A.alt2;
sub A.alt1 @all @all @all @all A' by A.alt2;
sub A.alt1 @all @all @all @all @all A' by A.alt2;
sub A.alt1 @all @all @all @all @all @all A' by A.alt2;
sub A.alt1 @all @all @all @all @all @all @all A' by A.alt2;

sub A A' by A.alt1;
sub A @all A' by A.alt1;
sub A @all @all A' by A.alt1;
sub A @all @all @all A' by A.alt1;
sub A @all @all @all @all A' by A.alt1;
sub A @all @all @all @all @all A' by A.alt1;
sub A @all @all @all @all @all @all A' by A.alt1;
sub A @all @all @all @all @all @all @all A' by A.alt1;
sub A @all @all @all @all @all @all @all @all A' by A.alt1;

sub B.alt2 B' by B.alt3;
sub B.alt2 @default4 B' by B.alt3;
sub B.alt2 @default4 @default4 B' by B.alt3;
sub B.alt2 @default4 @default4 @default4 B' by B.alt3;
sub B.alt2 @default4 @default4 @default4 @default4 B' by B.alt3;

sub B.alt1 B' by B.alt2;
sub B.alt1 @default4 B' by B.alt2;
sub B.alt1 @default4 @default4 B' by B.alt2;
sub B.alt1 @default4 @default4 @default4 B' by B.alt2;
sub B.alt1 @default4 @default4 @default4 @default4 B' by B.alt2;

sub B B' by B.alt1;
sub B @default4 B' by B.alt1;
sub B @default4 @default4 B' by B.alt1;
sub B @default4 @default4 @default4 B' by B.alt1;
sub B @default4 @default4 @default4 @default4 B' by B.alt1;

} rotate;

lookup rotate;

} salt;[/code]

clankill3r's picture

Damnit post was incomplete

what i would like is something like this cuase it requeres a lot less code:


feature salt {
lookup rotate {

sub @alt3 @AN' by @alt4;
sub @alt3 @all @AN' by @alt4;
sub @alt3 @all @all @AN' by @alt4;
sub @alt3 @all @all @all @AN' by @alt4;
sub @alt3 @all @all @all @all @AN' by @alt4;
sub @alt3 @all @all @all @all @all @AN' by @alt4;
sub @alt3 @all @all @all @all @all @all @AN' by @alt4;
sub @alt3 @all @all @all @all @all @all @all @AN' by @alt4;

sub @alt2 @AN' by @alt3;
sub @alt2 @all @AN' by @alt3;
sub @alt2 @all @all @AN' by @alt3;
sub @alt2 @all @all @all @AN' by @alt3;
sub @alt2 @all @all @all @all @AN' by @alt3;
sub @alt2 @all @all @all @all @all @AN' by @alt3;
sub @alt2 @all @all @all @all @all @all @AN' by @alt3;
sub @alt2 @all @all @all @all @all @all @all @AN' by @alt3;

sub @alt1 @AN' by @alt2;
sub @alt1 @all @AN' by @alt2;
sub @alt1 @all @all @AN' by @alt2;
sub @alt1 @all @all @all @AN' by @alt2;
sub @alt1 @all @all @all @all @AN' by @alt2;
sub @alt1 @all @all @all @all @all @AN' by @alt2;
sub @alt1 @all @all @all @all @all @all @AN' by @alt2;
sub @alt1 @all @all @all @all @all @all @all @AN' by @alt2;

sub @AN @AN' by @alt1;
sub @AN @all @AN' by @alt1;
sub @AN @all @all @AN' by @alt1;
sub @AN @all @all @all @AN' by @alt1;
sub @AN @all @all @all @all @AN' by @alt1;
sub @AN @all @all @all @all @all @AN' by @alt1;
sub @AN @all @all @all @all @all @all @AN' by @alt1;
sub @AN @all @all @all @all @all @all @all @AN' by @alt1;
sub @AN @all @all @all @all @all @all @all @all @AN' by @alt1;

} rotate;

lookup rotate;

} salt;

where @all contains all chars
@AN has chars A to Z
@alt1 has A.alt1 B.alt1 C.alt1 etc.
@alt2 has A.alt2 B.alt2 C.alt2 etc.

only problem is that if i type ABAB for example then the preview is:

A/B.alt1/A.alt2/B.alt3

but i want it to be
A/B/A.alt1/B.alt1

Is it possible to fix the problem?

Syndicate content Syndicate content