How to make a contextual cursive font

Get help with FontCreator here. Please do not post feature requests or bug reports here.
Jonne Haven
Posts: 286
Joined: Wed Sep 30, 2015 12:02 pm
Location: Kaneohe, Hawaii, USA

How to make a contextual cursive font

Post by Jonne Haven » Wed Sep 30, 2015 12:18 pm

I've just purchased FontCreator 9, and it supposedly has "context" based options...can I use this to make a true cursive font? I've never used this program so I need simple instructions...but basically I need to be able to substitute letters that follow the "high tail" letters like b,o,v,w,r etc. I figure I need to make two alphabets for one but I've searched all the forums but found nothing that helps, perhaps someone has done this and can help me out. I don't know about grouping or classes or context menues, I can't seem to find them. I'm doing this for an elderly woman who was schooled in a special cursive that is just plain art and I wish to make a font to share and document her talents. Much appreciation from a noobie!

Jonne Haven

Oh, running windows 8.1 and though it would be nice, I don't require Connecting Uppercase letters though it would be nice if it's easy enough and I've already created two lower case alphabets, one for regular letters and one for high tail (b,o,v,w,r)

Erwin Denissen
Moderator
Moderator
Posts: 6659
Joined: Fri Oct 04, 2002 12:41 am
Location: De Bilt, The Netherlands
Contact:

Re: How to make a contextual cursive font

Post by Erwin Denissen » Wed Sep 30, 2015 1:55 pm

I've made a sample script that should get you started. Be sure the glyph names correspond with the names you provided. I named the lower case glyphs which will be placed after high tail characters ".aht".

If your font doesn't contain any OpenType layout features yet, then this is an easy way to add the script:

Within the OpenType Designer dialog, do click the Code Editor button located near the lower right corner. Now copy and paste this script:

Code: Select all

script latn {
  feature ContextualAlternates;
}

class @hightail [b o r v w];
class @lowercase [a b c d e f g h i j k l m n o p q r s t u v w x y z];
class @lowercaseaht [a.aht b.aht c.aht d.aht e.aht f.aht g.aht h.aht i.aht j.aht k.aht l.aht m.aht n.aht o.aht p.aht q.aht r.aht s.aht t.aht u.aht v.aht w.aht x.aht y.aht z.aht];

feature ContextualAlternates calt {
  lookup ChainingContextHighTail;
}

lookup ChainingContextHighTail {
  context (@hightail) @lowercase;
  sub 0 SingleSubstitutionHighTail;
}

lookup SingleSubstitutionHighTail {
  sub @lowercase -> @lowercaseaht;
}
Then click the OK button, so FontCreator compiles the script, and if successful will show it in the OpenType Designer. You can enable the "calt" feature in the preview area, and type text to confirm it is working.

You can also test the font in your web browser. Just close the OpenType Designer and select Test WOFF from the Font menu.

Do let us know your results.
Erwin Denissen
High-Logic
Proven Font Technology

Jonne Haven
Posts: 286
Joined: Wed Sep 30, 2015 12:02 pm
Location: Kaneohe, Hawaii, USA

Re: How to make a contextual cursive font

Post by Jonne Haven » Sat Oct 03, 2015 1:16 pm

Erwin,

Let me start by saying I was mucho impressed by your response time! There were a couple of changes I made to the script you gave me, minor ones, like I changed the regular @lowercase names from just "a" to "a.normal" because I plan to have four alphabets and it's easier to lookup. And I changed "*.aht" name to "*.high" because I didn't want to rename the .high alphabet. It took me some time to realize that in the code the class @hightail had to have the actual real codes. Once I changed that things started to work. The only problem is that when I type two of the "high" letters "b,o etc" in a row it doesn't substitute the second "o" to o.high. It seems to just repeat the regular "o". So I could use a few pointers in the direction of figuring out that little Piccadilly.

Now here's where I'm ambitious and the reason I bought this program. I wish to do some somewhat sophisticated things with this cursive.
#1 - Make it a true cursive with high letters ( which you're helping me with, thank you)
#2 - Make the first and last letters of word use a different version of the alphabet because the tails are beautiful and I wish to showcase them.
#3 - Learn how to do things with help but eventually learn how to extrapolate from what I've learned to utilize all the features this powerful software has to offer by learning code editor. (I'd like to know how to make "classes" for one.")

So thank for the help so far!! I was impressed with response time. Next I'd love your help in changing the first and last letters of each word substituted with an alternate glyph alphabet that has all the fancy tails.

I've been doing nothing but font work as I am grabbing the glyphs from a homemade cookbook, it's very time consuming using Photoshop and Illustrator and then importing glyphs into Fontcreator. I'm not even going to think about the nightmare of connecting glyphs yet.

Erwin You seem like you know this program backwards and forwards and I appreciate you helping out.

Oh one more thing, on occasion I need to make my own tails for certain letters but they show up transparent where the contours overlap. I read up on the problem, surely there is a way to use contours in v. 9. I'm kinda screwed if I can't add custom tails in this cursive font.

Again thanks for a great product and product support.

Jonne Haven

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

Re: How to make a contextual cursive font

Post by Bhikkhu Pesala » Sat Oct 03, 2015 4:46 pm

Jonne Haven wrote:Oh one more thing, on occasion I need to make my own tails for certain letters but they show up transparent where the contours overlap. I read up on the problem, surely there is a way to use contours in v. 9. I'm kinda screwed if I can't add custom tails in this cursive font.
If contours are in opposite directions, they will be transparent where they overlap. Use the Validation Toolbar (F7) to fix contour directions. It's usually best to use Get Union of Contours to join overlapping contours.

If Erwin doesn't know this program backwards and forwards, we're all in deep trouble, since he is the creator of FontCreator. :lol:

You can find some Tutorials on my Review Page and YouTube Channel.
My FontsReviews: MainTypeFont CreatorHelpFC11.0 Pro + MT7.0 @ Win10 1703

Erwin Denissen
Moderator
Moderator
Posts: 6659
Joined: Fri Oct 04, 2002 12:41 am
Location: De Bilt, The Netherlands
Contact:

Re: How to make a contextual cursive font

Post by Erwin Denissen » Sun Oct 04, 2015 2:19 pm

[UPDATE February 6, 2016] The approach is this post is not recommended as both init and fina features are not meant for Latin based text. An interesting topic about these features includes a proposal from John Hudson ("These features turned out to work almost exactly not as described, either in layout engines or in fonts.") which might clear things up in the future. Later posts to this topic do show a better way of implementing contextual cursive fonts.
Jonne Haven wrote:Let me start by saying I was mucho impressed by your response time! There were a couple of changes I made to the script you gave me, minor ones, like I changed the regular @lowercase names from just "a" to "a.normal" because I plan to have four alphabets and it's easier to lookup. And I changed "*.aht" name to "*.high" because I didn't want to rename the .high alphabet. It took me some time to realize that in the code the class @hightail had to have the actual real codes. Once I changed that things started to work. The only problem is that when I type two of the "high" letters "b,o etc" in a row it doesn't substitute the second "o" to o.high. It seems to just repeat the regular "o". So I could use a few pointers in the direction of figuring out that little Piccadilly.

Just add the high tail versions to the hightail class, so it looks like:

class @hightail [b.normal o.normal r.normal v.normal w.normal b.high o.high r.high v.high w.high];

Jonne Haven wrote:So thank for the help so far!! I was impressed with response time. Next I'd love your help in changing the first and last letters of each word substituted with an alternate glyph alphabet that has all the fancy tails.

There are specific features (Initial Form and Terminal Form) for this task, but not all software support these. I think Adobe Indesign and Recent versions of Word do support them.

The script below should get you started:

Code: Select all

script latn {
  feature InitialForms1;
  feature TerminalForms1;
  feature ContextualAlternates;
}

class @hightail [b o r v w b.high o.high r.high v.high w.high];
class @lowercase [a b c d e f g h i j k l m n o p q r s t u v w x y z];
class @lowercaseaht [a.high b.high c.high d.high e.high f.high g.high h.high i.high j.high k.high l.high m.high n.high o.high p.high q.high r.high s.high t.high u.high v.high w.high x.high y.high z.high];
class @lowercaseinit [a.init b.init c.init];
class @lowercaseterm [a.term b.term c.term];

feature ContextualAlternates calt {
  lookup ChainingContextHighTail;
}

feature InitialForms1 init {
  lookup SingleSubstitution1;
}

feature TerminalForms1 fina {
  lookup SingleSubstitution2;
}

lookup ChainingContextHighTail {
  context (@hightail) @lowercase;
  sub 0 SingleSubstitutionHighTail;
}

lookup SingleSubstitution1 {
  sub @lowercase -> @lowercaseinit;
}

lookup SingleSubstitution2 {
  sub @lowercase -> @lowercaseterm;
}

lookup SingleSubstitutionHighTail {
  sub @lowercase -> @lowercaseaht;
}
Please let us know your results, if possible with some work-in-progress screenshots!
Erwin Denissen
High-Logic
Proven Font Technology

Jonne Haven
Posts: 286
Joined: Wed Sep 30, 2015 12:02 pm
Location: Kaneohe, Hawaii, USA

Re: How to make a contextual cursive font

Post by Jonne Haven » Fri Oct 09, 2015 1:35 am

I've input the script and it works in the "preview" window but not in the Tester in Fontcreator, Word 2010,2013,2016. I'm at my wits and could use assistance. Attached is the font and a screen shot of my glyphs and a couple of words. Please help, this program is not of much value to me if i can't use it with a word processor.

Thanks for everything

Jonne
Last edited by Jonne Haven on Tue Aug 02, 2016 10:16 am, edited 2 times in total.

Jonne Haven
Posts: 286
Joined: Wed Sep 30, 2015 12:02 pm
Location: Kaneohe, Hawaii, USA

Re: How to make a contextual cursive font

Post by Jonne Haven » Fri Oct 09, 2015 1:41 am

Here's a better sample of my work so far...
Last edited by Jonne Haven on Tue Feb 23, 2016 10:34 am, edited 1 time in total.

Erwin Denissen
Moderator
Moderator
Posts: 6659
Joined: Fri Oct 04, 2002 12:41 am
Location: De Bilt, The Netherlands
Contact:

Re: How to make a contextual cursive font

Post by Erwin Denissen » Fri Oct 09, 2015 8:20 am

Jonne Haven wrote:I've input the script and it works in the "preview" window but not in the Tester in Fontcreator, Word 2010,2013,2016.
Contextual alternates should work inside FontCreator's Test dialog. Do send me the font project if this isn't working for you.

Word 2010 and up do support contextual alternates, but you will manually have to enable such support in your documents. Do open the Font dialog, and select the Advanced tab. Then check the option to "Use Contextual Alternates" and click OK. I'm not sure if more recent versions of Word also support init and fina for Latin based fonts.

Adobe Indesign has more advanced feature support.

You can also test the font in your web browser. In FontCreator select Font from the main menu, and then click Test WOFF. Firefox is my preferred browser for testing OpenType layout features. Other web browsers might have less support for OpenType layout features; Better avoid Safari as it enables a few features by default and completely ignores specified font-feature-settings values.
Erwin Denissen
High-Logic
Proven Font Technology

Jonne Haven
Posts: 286
Joined: Wed Sep 30, 2015 12:02 pm
Location: Kaneohe, Hawaii, USA

Re: How to make a contextual cursive font

Post by Jonne Haven » Mon Oct 12, 2015 3:57 pm

Thanks for another prompt response. I am aware of the advanced kern and contextual boxes and have them checked. I was ‘getting nowhere until I realized that the 'coded' glyphs must be called 'a' or 'b' I had been naming them ‘a.normal,’ ‘b.normal,’ etc., and that fouled things up.

So I"m basically cleaning house and researching, apparently Word does support different glyphs at the beginning and end of the word. YAY. So next step is to look at the code to see what's up? I will attach the project and anything else you need.

I really appreciate the individual attention

See you soon
Melanie Camille.fcp
Last edited by Bhikkhu Pesala on Mon Oct 12, 2015 8:15 pm, edited 1 time in total.

Erwin Denissen
Moderator
Moderator
Posts: 6659
Joined: Fri Oct 04, 2002 12:41 am
Location: De Bilt, The Netherlands
Contact:

Re: How to make a contextual cursive font

Post by Erwin Denissen » Sat Oct 17, 2015 6:06 pm

I've slightly removed the OpenType layout features, so it now only contains a calt feature which takes care of first and last letters of a word. I haven't fully tested it, so let us know your results.
calt.png
calt.png (105.81 KiB) Viewed 1726 times
This is the new script; makes changes as you like:

Code: Select all

script latn {
  feature ContextualAlternates;
}

class @hightail [b o q v w b.high o.high q.high v.high w.high b.init o.init q.init v.init w.init];
class @lowercase [a b c d e f g h i j k l m n o p q r s t u v w x y z];
class @lowercasehigh [a.high b.high c.high d.high e.high f.high g.high h.high i.high j.high k.high l.high m.high n.high o.high p.high q.high r.high s.high t.high u.high v.high w.high x.high y.high z.high];
class @lowercaseinit [a.init b.init c.init d.init e.init f.init g.init h.init i.init j.init k.init l.init m.init n.init o.init p.init q.init r.init s.init t.init u.init v.init w.init x.init y.init z.init];
class @lowercasefina [a.fina b.fina c.fina d.fina e.fina f.fina g.fina h.fina i.fina j.fina k.fina l.fina m.fina n.fina o.fina p.fina q.fina r.fina s.fina t.fina u.fina v.fina w.fina x.fina y.fina z.fina];
class @lowercase_all [A B C D E F G H I J K L M N O P Q R S T U V W X Y Z a b c d e f g h i j k l m n o p q r s t u v w x y z a.high b.high c.high d.high e.high f.high g.high h.high i.high j.high k.high l.high m.high n.high o.high p.high q.high r.high s.high t.high u.high v.high w.high x.high y.high z.high a.init b.init c.init d.init e.init f.init g.init h.init i.init j.init k.init l.init m.init n.init o.init p.init q.init r.init s.init t.init u.init v.init w.init x.init y.init z.init a.fina b.fina c.fina d.fina e.fina f.fina g.fina h.fina i.fina j.fina k.fina l.fina m.fina n.fina o.fina p.fina q.fina r.fina s.fina t.fina u.fina v.fina w.fina x.fina y.fina z.fina];

feature ContextualAlternates calt {
  lookup ChainingContextInit;
  lookup ChainingContextFina;
  lookup ChainingContextBetween;
  lookup ChainingContextHighTail;
}

lookup ChainingContextBetween {
  context (@lowercase_all) @lowercaseinit (@lowercase_all);
  sub 0 SingleSubstitutionInitToNormal;
}

lookup ChainingContextFina {
  context (@lowercase_all) @lowercase;
  sub 0 SingleSubstitutionFina;
}

lookup ChainingContextHighTail {
  context (@hightail) @lowercase;
  sub 0 SingleSubstitutionHighTail;
}

lookup ChainingContextInit {
  context @lowercase (@lowercase);
  sub 0 SingleSubstitutionInit;
}

lookup SingleSubstitutionFina {
  sub @lowercase -> @lowercasefina;
}

lookup SingleSubstitutionHighTail {
  sub @lowercase -> @lowercasehigh;
}

lookup SingleSubstitutionInit {
  sub @lowercase -> @lowercaseinit;
}

lookup SingleSubstitutionInitToNormal {
  sub @lowercaseinit -> @lowercase;
}
Erwin Denissen
High-Logic
Proven Font Technology

Jonne Haven
Posts: 286
Joined: Wed Sep 30, 2015 12:02 pm
Location: Kaneohe, Hawaii, USA

Re: How to make a contextual cursive font

Post by Jonne Haven » Mon Oct 19, 2015 2:51 am

Erwin,

Thanks so much for persevering through my project, I know it's not a common request. I will check out the new code ASAP and let you know of it's results. It may be that Word 2013 doesn't support init and term even though documentation says it does and doing contextual alternates is the answer as I assume you deduced.

Thanks again, I have nothing but good things to tell people about your service.

Jonne

Jonne Haven
Posts: 286
Joined: Wed Sep 30, 2015 12:02 pm
Location: Kaneohe, Hawaii, USA

Re: How to make a contextual cursive font

Post by Jonne Haven » Mon Oct 19, 2015 10:39 am

Erwin,

Success, first and last letters work in Word 2013 and the Fontcreator tester!

I don't mean to fix something if it's not broke, but I noticed in my registry that it thinks that my font, "Melanie Camille" is a truetype font. Would this have any bearing on why init and term features did not work, and if so how do I change this to an open type font? Or am I being naive in thinking that a truetype font could even support 'calt'? Attached is a screen shot of my registry and my font folder with properties of the font. As you can see, my registry conflicts. Do you have any insight?

Thanks again,
Screenshot 2015-10-19 00.20.40.jpg
Screenshot 2015-10-19 00.20.40.jpg (992.85 KiB) Viewed 1704 times

Erwin Denissen
Moderator
Moderator
Posts: 6659
Joined: Fri Oct 04, 2002 12:41 am
Location: De Bilt, The Netherlands
Contact:

Re: How to make a contextual cursive font

Post by Erwin Denissen » Mon Oct 19, 2015 10:50 am

Jonne Haven wrote:Success, first and last letters work in Word 2013 and the Fontcreator tester!
Excellent news!
Jonne Haven wrote:I don't mean to fix something if it's not broke, but I noticed in my registry that it thinks that my font, "Melanie Camille" is a truetype font. Would this have any bearing on why init and term features did not work, and if so how do I change this to an open type font? Or am I being naive in thinking that a truetype font could even support 'calt'? Attached is a screen shot of my registry and my font folder with properties of the font. As you can see, my registry conflicts. Do you have any insight?
No worries, the font is an OpenType font, and Windows will use it that way. The font registry has a lot of legacy, so that is probably why it is still called a TrueType font internally. It is most likely also an easy way to distinct between the two flavours of OpenType fonts; the TrueType vs CFF based outlines. But again, no need to worry about this, the font is an OpenType font!
Erwin Denissen
High-Logic
Proven Font Technology

Jonne Haven
Posts: 286
Joined: Wed Sep 30, 2015 12:02 pm
Location: Kaneohe, Hawaii, USA

Re: How to make a contextual cursive font

Post by Jonne Haven » Mon Oct 19, 2015 10:58 am

Erwin,

If it helps I have the Font Export Settings as "Outline Format" = CFF (Postscript)
Opentype Layout Features = Yes.

Jonne

Jonne Haven
Posts: 286
Joined: Wed Sep 30, 2015 12:02 pm
Location: Kaneohe, Hawaii, USA

Re: How to make a contextual cursive font

Post by Jonne Haven » Mon Oct 19, 2015 11:00 am

Erwin,

Just saw you're reply, you're dammity fast!

Thanks for putting up with my ignorance!

Jonne

Post Reply

Who is online

Users browsing this forum: No registered users and 1 guest