I am a Newbie. I am trying to teach myself how to do glyph substitution. Nothing I try works. So I made a simple test font. The font contains two glyphs: an "a" and a "b". I'm trying to write a custom script that will substitute a "b" every time I type an "a". My custom script is below. Can anyone tell me what I'm doing wrong? Thanks very much!
script latn {
# Latin
feature GlyphCompositionDecomposition;
}
feature GlyphCompositionDecomposition ccmp {
# Glyph Composition / Decomposition
lookup Lookup1;
}
lookup Lookup1 {
# Referenced by feature "GlyphCompositionDecomposition"
sub a -> b;
}
Glyph Substitution
-
- Top Typographer
- Posts: 9889
- Joined: Tue Oct 29, 2002 5:28 am
- Location: Seven Kings, London UK
- Contact:
Re: Glyph Substitution
There's a lot to learn, so if we know your final aim we can direct you to the best place to start. I am self-taught, not an expert on OpenType features, so I had to learn by trial and error.
The simplest one to one substitutions used by Stylistic Alternates or Scientific Inferiors might be a good place to start, rather then glyph decomposition.
Which program are you using to test the font?
The simplest one to one substitutions used by Stylistic Alternates or Scientific Inferiors might be a good place to start, rather then glyph decomposition.
Which program are you using to test the font?
-
- Top Typographer
- Posts: 2038
- Joined: Tue Sep 14, 2004 6:41 pm
- Location: Worcestershire, England
- Contact:
Re: Glyph Substitution
Welcome to the forum.
I have just made a test font using your script and tried it in Serif PagePlus X6.
It works correctly.
So now we need to find out why you are not achieving the same result.
Did you set the Export settings to Custom Script?
In whatever application you are testing the font, did you turn the ccmp table on, so that the application uses the ccmp table?
If either of the above questions are not understood, please say and I can go into detail.
William Overington
8 May 2014
I have just made a test font using your script and tried it in Serif PagePlus X6.
It works correctly.
So now we need to find out why you are not achieving the same result.
Did you set the Export settings to Custom Script?
In whatever application you are testing the font, did you turn the ccmp table on, so that the application uses the ccmp table?
If either of the above questions are not understood, please say and I can go into detail.
William Overington
8 May 2014
-
- Posts: 694
- Joined: Mon Dec 07, 2009 10:26 am
- Location: De Bilt, Netherlands
- Contact:
Re: Glyph Substitution
Not all applications support opentype features, or they may not be enabled by default. If you want to test your script, I recommend testing it in your webbrowser as a webfont. Simply press CTRL+F5 from within fontcreator to create a demo page to view and test your features.
-
- Top Typographer
- Posts: 2038
- Joined: Tue Sep 14, 2004 6:41 pm
- Location: Worcestershire, England
- Contact:
Re: Glyph Substitution
I just tried that and it works well with the test font that I made.León Fridsma wrote:Not all applications support opentype features, or they may not be enabled by default. If you want to test your script, I recommend testing it in your webbrowser as a webfont. Simply press CTRL+F5 from within fontcreator to create a demo page to view and test your features.
One point: I usually use the screen at 800 pixels by 600 pixels and I needed to resize the screen resolution to 1024 by 768 to get everything on the screen at the left.
That was no problem, I am not complaining.
I am just mentioning it in case anyone else is using the screen usually at 800 pixels by 600 pixels.
William
Re: Glyph Substitution
Thanks for your suggestions! It seems like my problem all along has been that I'm using MS Word 2007 as my font client. When I tried the CTRL-F5 technique my font worked!
I have just made a test font using your script and tried it in Serif PagePlus X6. It works correctly.
Thanks William! I've got it working now.
I have just made a test font using your script and tried it in Serif PagePlus X6. It works correctly.
Thanks William! I've got it working now.
Re: Glyph Substitution
This worked for me. Thanks very much!León Fridsma wrote:Not all applications support opentype features, or they may not be enabled by default. If you want to test your script, I recommend testing it in your webbrowser as a webfont. Simply press CTRL+F5 from within fontcreator to create a demo page to view and test your features.