Page 1 of 1

Glyph Substitution

Posted: Thu May 08, 2014 2:52 am
by dougw4
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;
}

Re: Glyph Substitution

Posted: Thu May 08, 2014 6:21 am
by Bhikkhu Pesala
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?

Re: Glyph Substitution

Posted: Thu May 08, 2014 8:23 am
by William
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

Re: Glyph Substitution

Posted: Thu May 08, 2014 9:44 am
by León Fridsma
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.

Re: Glyph Substitution

Posted: Thu May 08, 2014 10:01 am
by William
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.
I just tried that and it works well with the test font that I made.

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

Posted: Sat May 10, 2014 11:34 pm
by dougw4
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.

Re: Glyph Substitution

Posted: Sat May 10, 2014 11:35 pm
by dougw4
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.
This worked for me. Thanks very much!