Adding OpenType features: Long GSUB Strings

Get help with FontCreator here. Please do not post feature requests or bug reports here.
William
Top Typographer
Top Typographer
Posts: 2001
Joined: Tue Sep 14, 2004 6:41 pm
Location: Worcestershire, England
Contact:

Adding OpenType features: Long GSUB Strings

Post by William » Thu Apr 25, 2013 9:13 am

I have just this morning noticed the recent updates to this thread and am interested to know that you are producing FontCreator 7 and the statement that "with that release FontCreator lets you add OpenType Layout Features.".

As it happens I have been thinking about the way to try to get my ideas about localizable sentences implemented and I was thinking yesterday about whether a GSUB in a liga table would be able to handle a sequence of seven characters and substitute a glyph.

So, recognising that answering this question does not imply an opinion at all one way or the other about my research ideas, can you say please if having a sequence of seven characters in a GSUB is possible (in the sense that, say, an ffi ligature has three characters in a GSUB - unfortunately I do not know the correct parlance for what I am trying to express here) and with FontCreator 7 in particular and will programs like the Firefox browser and Serif PagePlus handle such a long sequence even if it is in the font?

I know that this might be an extreme use of a GSUB in a liga table, but if it is possible to do this it would be helpful for my research.

William Overington

25 April 2013

Bhikkhu Pesala
Top Typographer
Top Typographer
Posts: 8774
Joined: Tue Oct 29, 2002 5:28 am
Location: Seven Kings, London UK
Contact:

Re: Adding OpenType features: Long GSUB Strings

Post by Bhikkhu Pesala » Thu Apr 25, 2013 10:48 am

Try it and see if it works — let us know your results.

Longer strings must come before shorter ones:

f f i -> ffi
will be processed before
f f - >

If the order is wrong, f f i will never get processed.

I tried it in FontCreator 7, and it worked in the Font Test window.

sub f a c s i m i l e -> uni213B

FontCreator 7 is awesome!
Font Test Long GSUB.png
Font Test Long GSUB.png (7.15 KiB) Viewed 5755 times
My FontsReviews: MainTypeFont CreatorHelpFC13 Pro + MT9.0 @ Win10 1909 build 18363.900

William
Top Typographer
Top Typographer
Posts: 2001
Joined: Tue Sep 14, 2004 6:41 pm
Location: Worcestershire, England
Contact:

Re: Adding OpenType features: Long GSUB Strings

Post by William » Thu Apr 25, 2013 1:07 pm

Thank you for trying a long GSUB string in FontCreator 7.

Excellent.

I wondered at first why there was a space between facsimil and e in the image.

Then I realized that if there had not been a space then it would have shown the FAX symbol!

So, I am thinking that, after the GSUB had been set up, in order to produce the diagram the text that was entered was

facsimil e -> facsimile

and the software did the conversion automatically using the information in the GSUB table.

That is great.

Thank you.

William

Erwin Denissen
Moderator
Moderator
Posts: 8820
Joined: Fri Oct 04, 2002 12:41 am
Location: Bilthoven, The Netherlands
Contact:

Re: Adding OpenType features: Long GSUB Strings

Post by Erwin Denissen » Thu Apr 25, 2013 4:04 pm

Erwin Denissen
High-Logic
Proven Font Technology

William
Top Typographer
Top Typographer
Posts: 2001
Joined: Tue Sep 14, 2004 6:41 pm
Location: Worcestershire, England
Contact:

Re: Adding OpenType features: Long GSUB Strings

Post by William » Mon Apr 29, 2013 9:18 am

I am trying to produce a glyph substitution, using FontCreator 7, evaluation version.

I have added glyphs for A through to Z and for a through to z to the font.

I noticed that the evaluation version allows only certain characters to be exported, so I am trying an experiment within those limits so as to try to produce a font so as to test if a substitution for a long GSUB string can be used satisfactorily in Serif PagePlus 5.

I thought that I would start with a string of 4 characters so as to make sure that I can first carry out the FontCreator 7 part of the process satisfactorily before thrying a longer string.

I have added a glyph for z to the fi ligature cell at uniF001.

I then used

Font
OpenType Layout Features

and added the following to the upper panel

sub t e s t -> uniF001

I am trying to making it so that keying the word test will display a glyph for z instead,

Using the menu commands

Action
Compile

gives

[Error] (1,1): Syntax error: Unexpected keyword "sub"

When I tried to look in the documentation, I used, from the main menu bar,

Help
Contents and Index...
Contents
Editing Fonts
Format
OpenType Layout Features

I could only get a blank page headed OpenType Layout Features.

I am wondering if somewhere I need to include an indication that I am using the liga table or something like that.

William Overington

29 April 2013

Bhikkhu Pesala
Top Typographer
Top Typographer
Posts: 8774
Joined: Tue Oct 29, 2002 5:28 am
Location: Seven Kings, London UK
Contact:

Re: Adding OpenType features: Long GSUB Strings

Post by Bhikkhu Pesala » Mon Apr 29, 2013 9:48 am

William wrote:I then used, Font, OpenType Layout Features

and added the following to the upper panel

sub t e s t -> uniF001
Its not that simple, and as you discovered the help file is not complete yet. Please read the tutorial thread first, or look at the example scripts on my FontCreator Review page.

First you need to define the feature, then the lookup tables, then the substitutions. The syntax must be correct too:

script latn {
feature Ligatures;
}
feature Ligatures liga {
lookup ligaSub;
} lookup ligaSub {
sub t e s t -> zero;
}

Even then, I am not sure uniF001 will be exported, so try with

sub t e s t -> zero;

That compiles correctly.
My FontsReviews: MainTypeFont CreatorHelpFC13 Pro + MT9.0 @ Win10 1909 build 18363.900

León Fridsma
Posts: 694
Joined: Mon Dec 07, 2009 10:26 am
Location: De Bilt, Netherlands
Contact:

Re: Adding OpenType features: Long GSUB Strings

Post by León Fridsma » Mon Apr 29, 2013 9:58 am

The help files will be fixed by a maintenance release later today but this should get you started

Code: Select all

script latn {
  feature Ligatures;
}

feature Ligatures liga {
  lookup LigaLookup;
}

lookup LigaLookup {
  sub t e s t -> fi;
}
Edit: Seems Bhikkhu Pesala beat me to it again :D

William
Top Typographer
Top Typographer
Posts: 2001
Joined: Tue Sep 14, 2004 6:41 pm
Location: Worcestershire, England
Contact:

Re: Adding OpenType features: Long GSUB Strings

Post by William » Mon Apr 29, 2013 10:28 am

Many thanks to both of you.

I tried the script by Bhikkhu Pesala and it compiled.

I then exported a font and opened it in fontviewer so as to install it temporarily and then tried it in Serif PagePlus X5 (which is not the latest version).

I cannot get the ligature substitution to work at the present time.

Does the evaluation version export the OpenType feature, or have I not used the font correctly in Serif PagePlus X5?

William

León Fridsma
Posts: 694
Joined: Mon Dec 07, 2009 10:26 am
Location: De Bilt, Netherlands
Contact:

Re: Adding OpenType features: Long GSUB Strings

Post by León Fridsma » Mon Apr 29, 2013 10:39 am

it will only work when mapped to the fi or fl substitutes in the trial version. Also, some applications require you to explicitly enable certain features for a selected piece of text.

If you are on Windows Vista or 7, you can also use the font test dialog (F5) to test your ligature.

William
Top Typographer
Top Typographer
Posts: 2001
Joined: Tue Sep 14, 2004 6:41 pm
Location: Worcestershire, England
Contact:

Re: Adding OpenType features: Long GSUB Strings

Post by William » Mon Apr 29, 2013 11:18 am

León Fridsma wrote:it will only work when mapped to the fi or fl substitutes in the trial version. Also, some applications require you to explicitly enable certain features for a selected piece of text.

Thank you for your reply.

I note that your script mentions fi whereas the postscript name in use in the font is uniF001.

The OpenType rule will not compile as it stands.

I am trying to change the postscript name of the glyph but it does not seem to be by the same method as in FontCreator 5.6 and I cannot find how to change the postscript name from uniF001 to become fi.

I am using Windows xp.

William
Last edited by William on Mon Apr 29, 2013 11:20 am, edited 1 time in total.

León Fridsma
Posts: 694
Joined: Mon Dec 07, 2009 10:26 am
Location: De Bilt, Netherlands
Contact:

Re: Adding OpenType features: Long GSUB Strings

Post by León Fridsma » Mon Apr 29, 2013 11:20 am

You can edit the name in the Glyph Properties Toolwindow (F3). Don't forget to click the apply button after entering the new name.

William
Top Typographer
Top Typographer
Posts: 2001
Joined: Tue Sep 14, 2004 6:41 pm
Location: Worcestershire, England
Contact:

Re: Adding OpenType features: Long GSUB Strings

Post by William » Mon Apr 29, 2013 11:33 am

Thank you.

I changed the glyph name to fi, and the OpenType rule then compiled alright.

I exported the font and then opened the font in fontviewer and then I started PagePlus X5.

Well it still did not work in PagePlus X5, though PagePlus X5 was listing the glyph as in liga.

So, on a hunch, I keyed fi and a z glyph was displayed.

William

William
Top Typographer
Top Typographer
Posts: 2001
Joined: Tue Sep 14, 2004 6:41 pm
Location: Worcestershire, England
Contact:

Re: Adding OpenType features: Long GSUB Strings

Post by William » Mon Apr 29, 2013 12:04 pm

There appears to be an override in PagePlus X5 so as to give an fi and an ffi ligature automatically, even from a TrueType font. I have just found that, when ligatures are turned on, PagePlus X5 substitues glyphs for fi and ffi when I am using my Sonnet to a Renaissance Lady font that is a TrueType font that I have not altered for some time.

When I tried Quest Text, which is a TrueType font and has ligature glyphs that are designed to show that they are ligature glyphs by having a joining line in them, I found that ff fi fl ffi ffl are all supported in that way, though st is not. So it appears that PagePlus X5 has an internal override to give some liga facilities even if the font is TrueType, as long as the font has the glyphs in the right places!

That is good in general, but it appears that I cannot carry out the test in PagePlus X5, unless deep within the options is some way to turn the override off and use the rules that are in the font.

William

Bhikkhu Pesala
Top Typographer
Top Typographer
Posts: 8774
Joined: Tue Oct 29, 2002 5:28 am
Location: Seven Kings, London UK
Contact:

Re: Adding OpenType features: Long GSUB Strings

Post by Bhikkhu Pesala » Mon Apr 29, 2013 3:57 pm

William wrote:That is good in general, but it appears that I cannot carry out the test in PagePlus X5, unless deep within the options is some way to turn the override off and use the rules that are in the font.
Its not very deep — just look at the Format, Character dialogue.
OpenType Features.png
OpenType Features.png (7.4 KiB) Viewed 5674 times
My FontsReviews: MainTypeFont CreatorHelpFC13 Pro + MT9.0 @ Win10 1909 build 18363.900

William
Top Typographer
Top Typographer
Posts: 2001
Joined: Tue Sep 14, 2004 6:41 pm
Location: Worcestershire, England
Contact:

Re: Adding OpenType features: Long GSUB Strings

Post by William » Mon Apr 29, 2013 4:29 pm

I am reminded of the saying that was used as a subtitle to a work by Chaucer, perhaps not by him but by a scribe, of "Bread and milk for children".

So, having found that page before and tried various combinations, though perhaps not all of the combinations that are possible, could you possibly say what exactly I would need to do please?

William

Post Reply