Using the OpenType calt table
-
- Top Typographer
- Posts: 2038
- Joined: Tue Sep 14, 2004 6:41 pm
- Location: Worcestershire, England
- Contact:
Using the OpenType calt table
The OpenType calt table looks interesting.
http://www.microsoft.com/typography/ots ... e.htm#calt
I am thinking of starting from a copy of the Learning_ordn_001.otf font from the following thread, using a project file Learning_calt_001.fcp to produce a font.
viewtopic.php?f=3&t=4464
I would like to start by substituting a t with t.longbar if the t is followed by any of a c e g m n o p q s u v w x y z and by substituting a y with y.swashtail if the y follows any of a b c d e h k m n o s u v w x z.
How does one do that please?
William Overington
23 October 2013
http://www.microsoft.com/typography/ots ... e.htm#calt
I am thinking of starting from a copy of the Learning_ordn_001.otf font from the following thread, using a project file Learning_calt_001.fcp to produce a font.
viewtopic.php?f=3&t=4464
I would like to start by substituting a t with t.longbar if the t is followed by any of a c e g m n o p q s u v w x y z and by substituting a y with y.swashtail if the y follows any of a b c d e h k m n o s u v w x z.
How does one do that please?
William Overington
23 October 2013
-
- Posts: 694
- Joined: Mon Dec 07, 2009 10:26 am
- Location: De Bilt, Netherlands
- Contact:
Re: Using the OpenType calt table
The script below is one example on how to achieve this, but there are actually several ways to do it.
Please note that I also added the t.longbar back to the input for the "y". This will result in the combination of "ty" to be substituted by the alternates as well:
Please note that I also added the t.longbar back to the input for the "y". This will result in the combination of "ty" to be substituted by the alternates as well:
Code: Select all
script latn {
# Latin
feature ContextualAlternates1;
}
feature ContextualAlternates1 calt {
lookup LookupCalt1;
}
group @CaltTInput [a c e g m n o p q s u v w x y z];
group @CaltTMatch [t];
group @CaltYInput [a b c d e h k m n o s u v w x z t.longbar];
group @CaltYMatch [y];
lookup LookupCalt1 {
context @CaltTMatch (@CaltTInput);
sub 0 LookupCaltReplace;
context (@CaltYInput) @CaltYMatch;
sub 0 LookupCaltReplace;
}
lookup LookupCaltReplace {
sub t -> t.longbar;
sub y -> y.swashtail;
}
-
- Top Typographer
- Posts: 2038
- Joined: Tue Sep 14, 2004 6:41 pm
- Location: Worcestershire, England
- Contact:
Re: Using the OpenType calt table
Thank you.
William
William
-
- Top Typographer
- Posts: 2038
- Joined: Tue Sep 14, 2004 6:41 pm
- Location: Worcestershire, England
- Contact:
Re: Using the OpenType calt table
I have made a font and tried it in Serif PagePlus X5.
Here is the font.
It mostly works very well though the ty pair has a t.longbar yet not a y.swashtail.
Can readers possibly try this font in whatever OpenType-aware applications that they have available please and post their results?
I have tried adding t into the list just in case PagePlus X5 was using the underlying plain text, but it made no difference.
William Overington
25 October 2013
Here is the font.
It mostly works very well though the ty pair has a t.longbar yet not a y.swashtail.
Can readers possibly try this font in whatever OpenType-aware applications that they have available please and post their results?
I have tried adding t into the list just in case PagePlus X5 was using the underlying plain text, but it made no difference.
William Overington
25 October 2013
-
- Top Typographer
- Posts: 2038
- Joined: Tue Sep 14, 2004 6:41 pm
- Location: Worcestershire, England
- Contact:
Re: Using the OpenType calt table
I have been experimenting and a font with the following code and a few extra glyphs works well in Serif PagePlus X5.
Please note particularly the f.both glyph substitution accessed using three items in the context line of the code.
William Overington
4 November 2013
Please note particularly the f.both glyph substitution accessed using three items in the context line of the code.
Code: Select all
script latn {
# Latin
feature ContextualAlternates1;
}
feature ContextualAlternates1 calt {
lookup LookupCalt1;
}
group @CaltTInput [a c e g m n o p q s u v w x y z];
group @CaltTMatch [t];
group @CaltPInput [a e o u];
group @CaltPMatch [p];
group @CaltGInput [a b c d e h k m n o s t u v w x z t.longbar];
group @CaltGMatch [g];
group @CaltYInput [a b c d e h k m n o s t u v w x z t.longbar];
group @CaltYMatch [y];
group @CaltFMatch [f];
lookup LookupCalt1 {
context (@CaltYInput) @CaltFMatch (@CaltTInput);
sub 0 LookupCaltReplace2;
context @CaltTMatch (@CaltTInput);
sub 0 LookupCaltReplace;
context (@CaltYInput) @CaltYMatch;
sub 0 LookupCaltReplace;
context @CaltPMatch (@CaltPInput);
sub 0 LookupCaltReplace;
context (@CaltGInput) @CaltGMatch;
sub 0 LookupCaltReplace;
}
lookup LookupCaltReplace {
sub p -> p.swash;
sub t -> t.longbar;
sub g -> g.swashtail;
sub y -> y.swashtail;
}
lookup LookupCaltReplace2 {
sub f -> f.both;
}
4 November 2013
Re: Using the OpenType calt table
Interesting. Do you really need a separate function for the f.both glyph substitution?
By the way, I can confirm that (as per your previous post) León's 'ty' substitution doesn't give me a y.swashtail in PagePlus.
By the way, I can confirm that (as per your previous post) León's 'ty' substitution doesn't give me a y.swashtail in PagePlus.
-
- Top Typographer
- Posts: 2038
- Joined: Tue Sep 14, 2004 6:41 pm
- Location: Worcestershire, England
- Contact:
Re: Using the OpenType calt table
Yes.Alfred wrote:Interesting.
No. I have just tried it as follows and it works in PagePlus X5.Alfred wrote:Do you really need a separate function for the f.both glyph substitution?
Code: Select all
script latn {
# Latin
feature ContextualAlternates1;
}
feature ContextualAlternates1 calt {
lookup LookupCalt1;
}
group @CaltTInput [a c e g m n o p q s u v w x y z];
group @CaltTMatch [t];
group @CaltPInput [a e o u];
group @CaltPMatch [p];
group @CaltGInput [a b c d e h k m n o s t u v w x z t.longbar];
group @CaltGMatch [g];
group @CaltYInput [a b c d e h k m n o s t u v w x z t.longbar];
group @CaltYMatch [y];
group @CaltFMatch [f];
lookup LookupCalt1 {
context (@CaltYInput) @CaltFMatch (@CaltTInput);
sub 0 LookupCaltReplace;
context @CaltTMatch (@CaltTInput);
sub 0 LookupCaltReplace;
context (@CaltYInput) @CaltYMatch;
sub 0 LookupCaltReplace;
context @CaltPMatch (@CaltPInput);
sub 0 LookupCaltReplace;
context (@CaltGInput) @CaltGMatch;
sub 0 LookupCaltReplace;
}
lookup LookupCaltReplace {
sub p -> p.swash;
sub t -> t.longbar;
sub g -> g.swashtail;
sub y -> y.swashtail;
sub f -> f.both;
}
Thank you for checking that.Alfred wrote: By the way, I can confirm that (as per your previous post) León's 'ty' substitution doesn't give me a y.swashtail in PagePlus.
William Overington
5 November 2013
-
- Moderator
- Posts: 11160
- Joined: Fri Oct 04, 2002 12:41 am
- Location: Bilthoven, The Netherlands
- Contact:
Re: Using the OpenType calt table
It works perfectly in FontCreator's Font Test dialog and in Mozilla Firefox, so I suspect this is a bug within PagePlus. Maybe there is a work-around, but you'll have to try and experiment with the script yourself.Alfred wrote:By the way, I can confirm that (as per your previous post) León's 'ty' substitution doesn't give me a y.swashtail in PagePlus.
-
- Top Typographer
- Posts: 2038
- Joined: Tue Sep 14, 2004 6:41 pm
- Location: Worcestershire, England
- Contact:
Re: Using the OpenType calt table
I tried the following and it would not compile without error, which is not unreasonable considering the task for which calt is defined.
INCORRECT CODE IN THIS FRAME
However, is there any way, not necessarily using calt, to achieve the desired result?
For example, the word cabbages to have g.bigloop with the loop extending under the five letters from the second b through to s.
William Overington
7 November 2013
INCORRECT CODE IN THIS FRAME
Code: Select all
script latn {
# Latin
feature ContextualAlternates1;
}
feature ContextualAlternates1 calt {
lookup LookupCalt1;
}
group @CaltTInput [a c e g m n o p q s u v w x y z];
group @CaltTMatch [t];
group @CaltPInput [a e o u];
group @CaltPMatch [p];
group @CaltGInput [a b c d e h k m n o s t u v w x z t.longbar];
group @CaltGMatch [g];
group @CaltYInput [a b c d e h k m n o s t u v w x z t.longbar];
group @CaltYMatch [y];
group @CaltFMatch [f];
lookup LookupCalt1 {
context (@CaltYInput) (@CaltYInput) @CaltGMatch (@CaltYInput) (@CaltYInput);
sub 0 LookupCaltReplace3;
context (@CaltYInput) @CaltFMatch (@CaltTInput);
sub 0 LookupCaltReplace2;
context @CaltTMatch (@CaltTInput);
sub 0 LookupCaltReplace;
context (@CaltYInput) @CaltYMatch;
sub 0 LookupCaltReplace;
context @CaltPMatch (@CaltPInput);
sub 0 LookupCaltReplace;
context (@CaltGInput) @CaltGMatch;
sub 0 LookupCaltReplace;
}
lookup LookupCaltReplace {
sub p -> p.swash;
sub t -> t.longbar;
sub g -> g.swashtail;
sub y -> y.swashtail;
}
lookup LookupCaltReplace2 {
sub f -> f.both;
}
lookup LookupCaltReplace3 {
sub g -> g.bigloop;
}
However, is there any way, not necessarily using calt, to achieve the desired result?
For example, the word cabbages to have g.bigloop with the loop extending under the five letters from the second b through to s.
William Overington
7 November 2013
-
- Posts: 694
- Joined: Mon Dec 07, 2009 10:26 am
- Location: De Bilt, Netherlands
- Contact:
Re: Using the OpenType calt table
Should theoretically be possible, but I currently don't have the time to have a look at it.
-
- Moderator
- Posts: 11160
- Joined: Fri Oct 04, 2002 12:41 am
- Location: Bilthoven, The Netherlands
- Contact:
Re: Using the OpenType calt table
You can double-click the output line which starts with [Error] to jump to the specific line of your OpenType layout script.