Adding OpenType features: Long GSUB Strings

Get help with FontCreator here. Please do not post feature requests or bug reports here.
Erwin Denissen
Moderator
Moderator
Posts: 8899
Joined: Fri Oct 04, 2002 12:41 am
Location: Bilthoven, The Netherlands
Contact:

Re: Adding OpenType features: Long GSUB Strings

Post by Erwin Denissen » Mon Apr 29, 2013 4:33 pm

I think Bhikkhu Pesala wants you to set the check boxes which are marked "yellow".
Erwin Denissen
High-Logic
Proven Font Technology

Alfred
Top Typographer
Top Typographer
Posts: 1028
Joined: Thu Apr 18, 2013 8:08 am

Re: Adding OpenType features: Long GSUB Strings

Post by Alfred » Mon Apr 29, 2013 5:28 pm

Erwin Denissen wrote:I think Bhikkhu Pesala wants you to set the check boxes which are marked "yellow".
I think you're right, but 'Format > Character... > Font > Ligatures' in PPX5 apparently only enables standard ligatures (liga), not discretionary ligatures (dlig), so although ff, fi, fl, ffi and ffl are all substituted, ct and st are not. For more options, we need to choose ''Format > Character... > OpenType > Details' and use the checkboxes there.
Attachments
PPX5_OpenType_dlig.png
PPX5_OpenType_dlig.png (40.57 KiB) Viewed 5294 times
FC11.5 Pro (Help) + MT8.0 Pro (Help) • Windows 10

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

Re: Adding OpenType features: Long GSUB Strings

Post by William » Wed May 22, 2013 1:43 pm

Since the previous posts in this thread I have now purchased a licence for FontCreator 7 professional edition and I am updated to version 7.0.0 (build 368).

I have gained a little experience of making OpenType fonts and I have gained experience of using Serif PagePlus X5 (which is not the latest version) to try the fonts in an application. Much of it from the great fun of the thread of last Monday, 20 May 2013.

viewtopic.php?f=3&t=4402

Earlier today I made a font Ligatures 004, which worked well on some ligatures but not on the longer extreme examples that I was trying for my research on communication through the language barrier.

So I made a copy of the project file as Ligatures 004a and added some extra lines so as to test what is happening.

Here is the font.
Ligatures 004.otf
(21.35 KiB) Downloaded 175 times

Here is the OpenType code copied from the project file.

Code: Select all

script latn {
  feature Ligatures;
}

feature Ligatures liga {
  lookup LigaLookup;
}

lookup LigaLookup {
  sub f f i -> ffi;
  sub f f l -> ffl;
  sub f f -> ff;
  sub f i -> fi;
  sub f l -> fl;
  sub longs t -> longst;
  sub s t -> st;
  sub c t -> c_t;
  sub f j -> f_j;
  sub d a -> d_a;
  sub colon colon 3 4 5 6 7 8 9 -> big9;
  sub colon colon 3 4 5 6 7 8 -> big8;
  sub colon colon 3 4 5 6 7 -> big7;
  sub colon colon 3 4 5 6 -> big6;
  sub colon colon 3 4 5 -> big5;
  sub colon colon 3 4 -> big4;
  sub colon colon 3 -> big3;
  sub colon colon 1 0 0 1 6 colon semicolon -> ls10016;
  sub colon colon 1 0 0 1 7 colon semicolon -> ls10017;
  sub colon colon -> lsmbob;
  sub colon semicolon -> lsmbcb;
}

I am wondering just how long a substitution the font will store and how long a substitution PagePlus X5 will accept.

I am still learning so I accept that I may not have got it all correct.

I managed to get the sub colon colon -> lsmbob; substitution to work in PagePlus X5 and the sub colon colon 3 -> big3; seems to have been recognized in some way as, although the big3 glyph did not become displayed on the screen in PagePlus X5 at first, when I was deleting something it suddenly became displayed and I do not know how!

I wonder if readers could test the font with whatever OpenType-aware applications they have please.

I appreciate that I am pushing the envelope on this, and I may need to just abandon the idea, but perhaps trying to understand what is happening might be of benefit to learning more about OpenType generally.

William Overington

22 May 2013

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

Re: Adding OpenType features: Long GSUB Strings

Post by Erwin Denissen » Wed May 22, 2013 3:57 pm

I'm not sure the above script compiles without errors, but still fails to work.

For now use the actual glyph names like:
sub colon colon three four five -> big5;
Erwin Denissen
High-Logic
Proven Font Technology

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

Re: Adding OpenType features: Long GSUB Strings

Post by Erwin Denissen » Wed May 22, 2013 4:50 pm

I just realized the numbers are glyph indexes... It is always best to use glyph names.
Erwin Denissen
High-Logic
Proven Font Technology

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

Re: Adding OpenType features: Long GSUB Strings

Post by William » Wed May 22, 2013 7:27 pm

Erwin Denissen wrote:I just realized the numbers are glyph indexes... It is always best to use glyph names.
Wow!

I put the computer on at about ten to eight and saw your posts.

Wow! I then quickly checked the glyph names and saw that they are zero one two three etc not 0 1 2 3 etc.

I could hardly wait to get the OpenType text edited and find out what would happen!

Wow, the font works a treat, after keying two characters PagePlus X5 changed the displayed glyph as I keyed each of the following characters slowly in a sequence.

::3456789

Then the test using the actual examples that I wanted to use in the research.

::10016:;

::10017:;

This is now amazingly successful.

Thank you for spotting the problem.

Earlier I wrote as follows.
I managed to get the sub colon colon -> lsmbob; substitution to work in PagePlus X5 and the sub colon colon 3 -> big3; seems to have been recognized in some way as, although the big3 glyph did not become displayed on the screen in PagePlus X5 at first, when I was deleting something it suddenly became displayed and I do not know how!
I have now realized that glyph 3 is the space, so it looks like I had got colon colon space on the screen at some stage.

Here is the new font and the OpenType code.
Ligatures 004.otf
The corrected font! Wow!
(21.35 KiB) Downloaded 155 times

Code: Select all

script latn {
  feature Ligatures;
}

feature Ligatures liga {
  lookup LigaLookup;
}

lookup LigaLookup {
  sub f f i -> ffi;
  sub f f l -> ffl;
  sub f f -> ff;
  sub f i -> fi;
  sub f l -> fl;
  sub longs t -> longst;
  sub s t -> st;
  sub c t -> c_t;
  sub f j -> f_j;
  sub d a -> d_a;
  sub colon colon three four five six seven eight nine -> big9;
  sub colon colon three four five six seven eight -> big8;
  sub colon colon three four five six seven -> big7;
  sub colon colon three four five six -> big6;
  sub colon colon three four five -> big5;
  sub colon colon three four -> big4;
  sub colon colon three -> big3;
  sub colon colon one zero zero one six colon semicolon -> ls10016;
  sub colon colon one zero zero one seven colon semicolon -> ls10017;
  sub colon colon -> lsmbob;
  sub colon semicolon -> lsmbcb;
}
Thank you again.

William
Last edited by William on Wed May 22, 2013 7:32 pm, edited 2 times in total.

Bhikkhu Pesala
Top Typographer
Top Typographer
Posts: 8843
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 » Wed May 22, 2013 7:30 pm

Its better to attach the project file, then the opentype code is embedded in it — i.e. no need for anyone to copy/paste and create a project file. It also contains the font export settings, which as we learnt before, can stop a script from being used.

The forum accepts *.fcp files without zipping them. For large files or multiple projects, archive as *.7z with 7-Zip to reduce the size.
My FontsReviews: MainTypeFont CreatorHelpFC13 Pro + MT10.0 @ Win10 1909 build 18363.959

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

Re: Adding OpenType features: Long GSUB Strings

Post by Erwin Denissen » Wed May 22, 2013 7:43 pm

Excellent. I'm glad it works!

We've thought about automatically setting the export settings to use the custom script as soon as one defines it, but we haven't implemented it yet.
Erwin Denissen
High-Logic
Proven Font Technology

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

Re: Adding OpenType features: Long GSUB Strings

Post by William » Wed May 22, 2013 7:55 pm

I have just tried the original font in PagePlus X5.

I got it to work doing exactly precisely what I had told it to do! Although that was not what I had thought that I had told it to do!

I keyed colon colon space exclamation

Then it did not work with the double quote so I had to turn off the autocorrecting to smart quotes.

Then it worked!

Then numbersign dollar percent ampersand

An interesting experience!

William

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

Re: Adding OpenType features: Long GSUB Strings

Post by Erwin Denissen » Wed May 22, 2013 8:21 pm

Funny, but it also shows how powerfull the new OpenType layout features are!
Erwin Denissen
High-Logic
Proven Font Technology

Bhikkhu Pesala
Top Typographer
Top Typographer
Posts: 8843
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 May 23, 2013 8:51 am

It does show how easy it is to test OpenType features and debug scripts using FontCreator. I already prefer it to the OpenType Compiler, in spite of it not yet supporting some features that are supported in the OT Compiler. It is a lot more efficient to be able to correct the glyph names or scripts, and retest the changes in the Font Test Window, or use the WOFF test in Firefox, and see how the OT features interact with each other.

A warning: Experimental stuff like this is fine to test FontCreator and see what it can do, but don't add features just for the sake of it. Give some thought to how practical it is, and how well your font will work if someone is using it in an application that doesn't support OpenType.
My FontsReviews: MainTypeFont CreatorHelpFC13 Pro + MT10.0 @ Win10 1909 build 18363.959

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

Re: Adding OpenType features: Long GSUB Strings

Post by William » Fri May 24, 2013 9:47 am

Bhikkhu Pesala wrote: A warning: Experimental stuff like this is fine to test FontCreator and see what it can do, but don't add features just for the sake of it. Give some thought to how practical it is, and how well your font will work if someone is using it in an application that doesn't support OpenType.

In a post in this thread, timestamped at 25 Apr 2013 09:13 I wrote as follows.
William wrote: 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.

Later in the same post I wrote as follows.
William wrote:
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.

I refer to the following post in another thread.

viewtopic.php?p=18889#p18889

Now, as it happens, I have been informed that encoding has been declined and I have been advised to use markup.

I do not want to use xml as I think, though I am not totally sure, that that would require the whole document to become an xml document.

I want a markup bubble within a plain text document.

I feel that using special characters would be the best, yet that has been declined, so I am now thinking about using a markup format of two colons followed by five (or more if needed) digits followed by a colon and a semicolon.

That way, the coding can be displayed in plain text.

I am now thinking of having a liga table for the markup bubble brackets and dlig for whole glyphs, which would require a total of nine characters to be glyph substituted, maybe more if the system expands, though nine will be enough for now.

I have not yet tested this out in a font, but I note that dlig is before liga in the default template.

Also, if the system is ever implemented, the markup bubbles would not usually be displayed as each markup bubble would become replaced at the receiving computer by a sentence localized into the local language.

I would prefer standardization of the list of localizable sentences to be done by a standards body, though that might not be possible.

William Overington

24 May 2013

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

Re: Adding OpenType features: Long GSUB Strings

Post by William » Fri May 24, 2013 4:01 pm

William wrote: I am now thinking of having a liga table for the markup bubble brackets and dlig for whole glyphs, which would require a total of nine characters to be glyph substituted, maybe more if the system expands, though nine will be enough for now.

I have not yet tested this out in a font, but I note that dlig is before liga in the default template.
I have now made a font Ligatures 006 with the following OpenType code.

Code: Select all

script latn { 
    feature DiscretionaryLigatures;
    feature Ligatures;
}

feature DiscretionaryLigatures dlig {
    lookup dligSub;
}  

lookup dligSub {
    sub c t -> c_t;
    sub s h -> s_h;
    sub s t -> s_t;
    sub colon colon one zero zero one six colon semicolon -> ls10016;
    sub colon colon one zero zero one seven colon semicolon -> ls10017;
}

feature Ligatures liga {
    lookup ligaSub;
}

lookup ligaSub {
    sub f f i -> f_f_i;
    sub f f l -> f_f_l;
    sub f f -> f_f;
    sub f i -> fi;
    sub f j -> f_j;
    sub f l -> fl;
    sub d a -> d_a;
    sub longs t -> longs_t;
    sub colon colon -> lsmbob;
    sub colon semicolon -> lsmbcb;
}

I then tested the font using Serif PagePlus X5.
ligatures_006_test.png
ligatures_006_test.png (10.61 KiB) Viewed 5209 times
This graphic shows the display when three lines of the same text are formatted as follows.

upper line: dlig and liga both turned off
middle line: dlig turned off and liga turned on.
lower line: dlig and liga both turned on

Please note that dlig substitution has taken place before liga substitution.

William Overington

24 May 2013

Bhikkhu Pesala
Top Typographer
Top Typographer
Posts: 8843
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 » Fri May 24, 2013 4:23 pm

A quick tip for changing the order of precedence of features.

My fonts have a bug in that if Standard Ligatures are enabled (which they are by default), Petite Capitals are broken, e..g.

firefox will be displayed as fiREFOX instead of FIREFOX.

To fix this, there is no need to edit the entire script. Just change the order of features so that the Small Capitals or Petite Capitals appear before the ligatures:

Code: Select all

script latn { 
    feature PetiteCapitals;
    feature PetiteCapitalsFromCapitals;
    feature DiscretionaryLigatures; 
    feature Ligatures; 
} 
My FontsReviews: MainTypeFont CreatorHelpFC13 Pro + MT10.0 @ Win10 1909 build 18363.959

Alfred
Top Typographer
Top Typographer
Posts: 1028
Joined: Thu Apr 18, 2013 8:08 am

Re: Adding OpenType features: Long GSUB Strings

Post by Alfred » Fri May 24, 2013 4:25 pm

William wrote:I have now made a font Ligatures 006 with the following OpenType code.

Code: Select all

script latn { 
    feature DiscretionaryLigatures;
    feature Ligatures;
}

feature DiscretionaryLigatures dlig {
    lookup dligSub;
}  

lookup dligSub {
    sub c t -> c_t;
    sub s h -> s_h;
    sub s t -> s_t;
    sub colon colon one zero zero one six colon semicolon -> ls10016;
    sub colon colon one zero zero one seven colon semicolon -> ls10017;
}

feature Ligatures liga {
    lookup ligaSub;
}

lookup ligaSub {
    sub f f i -> f_f_i;
    sub f f l -> f_f_l;
    sub f f -> f_f;
    sub f i -> fi;
    sub f j -> f_j;
    sub f l -> fl;
    sub d a -> d_a;
    sub longs t -> longs_t;
    sub colon colon -> lsmbob;
    sub colon semicolon -> lsmbcb;
}

My copy of Ligatures 004 seems to lack a glyph for the 'sh' ligature. Have you added some new glyphs since then?
FC11.5 Pro (Help) + MT8.0 Pro (Help) • Windows 10

Post Reply