Skip to content

Instantly share code, notes, and snippets.

@adiabatic
Created July 8, 2013 16:41
Show Gist options
  • Save adiabatic/5950411 to your computer and use it in GitHub Desktop.
Save adiabatic/5950411 to your computer and use it in GitHub Desktop.
The character sequence "roe it" (two Quikscript letters) gets turned into "roe.s2 it.2s".
# Glyph names and lookup names must be:
# - up to 31 characters
# - be comprised of A-Z a-z 0-9 . _
# - must not start with a digit or period (underscores OK)
# glyph names and lookup names can be 31 characters;
# glyph class names (lists) max out at 30.
##############################################################
## Glyph Classes
##
## Connects at Short
@can_2s = [ may-qs no-qs it-qs utter-qs ];
@can_s2 = [ no-qs it-qs et-qs roe-qs awe-qs ];
@does_2s = [ may-qs.2s no-qs.2s it-qs.2s utter-qs.2s ];
@does_s2 = [ no-qs.s2 it-qs.s2 et-qs.s2 roe-qs.s2 awe-qs.s2 ];
@can_s2s = [ no-qs ];
@does_s2s = [ no-qs.s2s ];
## Connects at baseline
@can_2b = [ tea-qs no-qs it-qs eat-qs et-qs awe-qs ];
@can_b2 = [ tea-qs no-qs it-qs eat-qs utter-qs roe-qs ];
@does_2b = [ tea-qs.2b no-qs.2b it-qs.2b eat-qs.2b et-qs.2b awe-qs.2b ];
@does_b2 = [ tea-qs.b2 no-qs.b2 it-qs.b2 eat-qs.b2 utter-qs.b2 roe-qs.b2 ];
@can_b2b = [ no-qs eat-qs ];
@does_b2b = [ no-qs.b2b eat-qs.b2b ];
## Diagonal Connections
@can_s2b = [ it-qs awe-qs ];
@can_b2s = [ it-qs utter-qs ];
##############################################################
## Single-Glyph Substitutions
##
lookup plain_to_2s {
sub may-qs by may-qs.2s;
sub no-qs by no-qs.2s;
sub it-qs by it-qs.2s;
sub utter-qs by utter-qs.2s;
} plain_to_2s;
lookup plain_to_s2 {
sub no-qs by no-qs.s2;
sub it-qs by it-qs.s2;
sub et-qs by et-qs.s2;
sub roe-qs by roe-qs.s2;
sub awe-qs by awe-qs.s2;
} plain_to_s2;
lookup s2_to_s2s {
sub no-qs.s2 by no-qs.s2s;
} s2_to_s2s;
lookup _2s_to_s2s {
sub no-qs.2s by no-qs.s2s;
} _2s_to_s2s;
## at baseline
lookup plain_to_2b {
sub tea-qs by tea-qs.2b;
sub no-qs by no-qs.2b;
sub it-qs by it-qs.2b;
sub eat-qs by eat-qs.2b;
sub et-qs by et-qs.2b;
sub awe-qs by awe-qs.2b;
} plain_to_2b;
lookup plain_to_b2 {
sub tea-qs by tea-qs.b2;
sub no-qs by no-qs.b2;
sub it-qs by it-qs.b2;
sub eat-qs by eat-qs.b2;
sub utter-qs by utter-qs.b2;
sub roe-qs by roe-qs.b2;
} plain_to_b2;
lookup b2_to_b2b {
sub no-qs.b2 by no-qs.b2b;
sub eat-qs.b2 by eat-qs.b2b;
} b2_to_b2b;
lookup _2b_to_b2b {
sub no-qs.2b by no-qs.b2b;
sub eat-qs.2b by eat-qs.b2b;
} _2b_to_b2b;
## crossovers
lookup b2_to_b2s {
sub it-qs.b2 by it-qs.b2s;
sub utter-qs.b2 by utter-qs.b2s;
} b2_to_b2s;
lookup s2_to_s2b {
sub it-qs.s2 by it-qs.s2b;
sub awe-qs.s2 by awe-qs.s2b;
} s2_to_s2b;
lookup _2b_to_s2b {
sub it-qs.2b by it-qs.s2b;
sub awe-qs.2b by awe-qs.s2b;
} _2b_to_s2b;
lookup _2s_to_b2s {
sub it-qs.2s by it-qs.b2s;
sub utter-qs.2s by utter-qs.b2s;
} _2s_to_b2s;
##############################################################
## 'calt' Passes
##
# Possibly useful lookupflags: IgnoreBaseGlyphs, IgnoreLigatures (defined in GDEF table)
### Connects the unconnected.
lookup calt_pass_1 {
sub @can_2b' lookup plain_to_2b
@can_b2' lookup plain_to_b2;
sub @can_2s' lookup plain_to_2s
@can_s2' lookup plain_to_s2;
sub @can_s2' lookup plain_to_s2
@can_2s' lookup plain_to_2s;
sub @can_b2' lookup plain_to_b2
@can_2b' lookup plain_to_2b;
} calt_pass_1;
### Connects what's connected on one side already.
lookup calt_pass_2 {
sub @does_b2' lookup b2_to_b2b # 5
@can_2b' lookup plain_to_2b;
sub @does_b2' lookup b2_to_b2s # 6
@can_s2' lookup plain_to_s2;
sub @does_s2' lookup s2_to_s2b # 8
@can_b2' lookup plain_to_b2;
sub @does_s2' lookup s2_to_s2s # 9
@can_s2' lookup plain_to_s2;
sub @does_b2' lookup b2_to_b2b # 5
@does_2b' lookup _2b_to_b2b;
sub @does_b2' lookup b2_to_b2s # 6
@does_2b' lookup _2b_to_s2b;
sub @does_s2' lookup s2_to_s2b # 8
@does_2b' lookup _2b_to_b2b;
sub @does_s2' lookup s2_to_s2s # 9
@does_2b' lookup _2b_to_s2b;
sub @does_b2' lookup b2_to_b2s # 5
@does_2s' lookup _2s_to_b2s;
sub @does_b2' lookup b2_to_b2s # 6
@does_2s' lookup _2s_to_s2s;
sub @does_s2' lookup s2_to_s2b # 8
@does_2s' lookup _2s_to_b2s;
sub @does_s2' lookup s2_to_s2s # 9 (responsible for nnnnnnn failures?)
@does_2s' lookup _2s_to_s2s;
} calt_pass_2;
##############################################################
## Features
##
feature calt {
lookup calt_pass_1;
# lookup calt_pass_2;
} calt;
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment