How do you substitute AA but not AAA, AAAA, AAAAA etc.?
Andreas Larsen
Posts: 22
ignore sub A' A' A;
sub A' A by A.alt;
sub A A' by A.alt;
Doesn't work for AAAA, AAAAAA etc
Tagged:
0
Comments
-
lookup ChainingContext1 {
ignore context (A.alt) A (A);
ignore context (A) A;
context A (A);
sub 0 Ligature1;
}
lookup Ligature1 {
sub A -> A.alt;
}
0 -
What is the desired result?0
-
The marked subrun (A' A') in the ignore statement differs from the subrun (A') in the sub statements. So the ignore does not apply to subs.0
-
If you only want to change the first two in a sequence, but not any subsequent repetitions, then this should work:
feature calt {
ignore sub A.alt A.alt A';
ignore sub A A';
sub A' A by A.alt;
sub A.alt A' by A.alt;
} calt;
But if you want to change two and only two, and not any member of a longer sequence, then you need to add another ignore sub:feature calt {
ignore sub A.alt A.alt A';
ignore sub A A';
ignore sub A' A A;
sub A' A by A.alt;
sub A.alt A' by A.alt;
} calt;
0 -
@ everyone: Sorry, I should have been clearer:)
What I want is:
A A -> A.alt A.alt
A A A -> A A A
A A A A -> A A A A
etc.
so not e.g.
A A A -> A.alt A.alt A
A A A A -> A.alt A.alt A A
Inspired by the answers I've played around a bit and not the prettiest solution but this seem to work:ignore sub A' A A;
ignore sub A A' A;
ignore sub A A A';
sub A' A by A.alt;
sub A A' by A.alt;0 -
that shouldn't work. The last substitution is not possible as the first A is already substituted to A.alt by the time this line will be applied.0
-
@Georg Seifert Sorry, typo. Should be
ignore sub A' A A;
ignore sub A A' A;
ignore sub A A A';
sub A' A by A.alt;
sub A.alt A' by A.alt;0 -
feature calt {lookup first {sub A A' by A.alt ;} first;lookup second {sub A A.alt' A by A ;} second;} calt;0
-
You have to understand that substitutions are done one after the other, so when the first substitution is done subsequent substitutions need to be aware of what was previously changed.0
-
@Adrien Tétar Yep, I know - I typed it wrong:) Did you see my updated reply to Georg?
0 -
@Nick Shinn Looks elegant but wouldn't that result in:
A A -> A A.alt
and not
A A -> A.alt A.alt
or am I missing something?0 -
I see it now, it should work.0
-
@Adrien Tétar Cheers. Figured that, since we posted at the same time:)0
-
Basically the same as my second example.
2 -
@Kent Lew it sure is. I'm new to this...
0
Categories
- All Categories
- 43 Introductions
- 3.7K Typeface Design
- 798 Font Technology
- 1K Technique and Theory
- 617 Type Business
- 444 Type Design Critiques
- 541 Type Design Software
- 30 Punchcutting
- 136 Lettering and Calligraphy
- 83 Technique and Theory
- 53 Lettering Critiques
- 483 Typography
- 301 History of Typography
- 114 Education
- 68 Resources
- 498 Announcements
- 79 Events
- 105 Job Postings
- 148 Type Releases
- 165 Miscellaneous News
- 269 About TypeDrawers
- 53 TypeDrawers Announcements
- 116 Suggestions and Bug Reports