Options

Help to make a connecting font

So I have characters I'm trying to connect together, something that will change depending on the previous character and following character. For the example I'm posting, I have the character b. Separated, they would look like the top line (assuming spaces inbetween each character). If they were typed together (bbb), they would need to look like the second row's example. I know this would need three different glyphs, and more, depending on other characters. I would like it to be that if I were to continue this indefinitely, they would work out like the third line's example, so that there's basically capped characters at the beginning and end. I've managed to work out using single substitution to get the entrance and end characters to connect, but not a middle glyph. How would I go about accomplishing this?

Comments

  • Options
    Craig EliasonCraig Eliason Posts: 1,400
    This Glyphs tutorial can help (even if you’re using a different editor).
  • Options
    Hi Calico,
    Graig points to the right and excellent tutorial from Glyphs.
    I used it to create the calt feature to settle the alternates in my "Abecedary" connected font (you can find it on daFont).
    But your problem could be harder to resolve as there is no connector at all on your base glyphs. So every character will need 3 versions, at least following the examples you give.

  • Options
    I don't know if it's me, or that code, but I'm generally confused by what it's stating. I'm not using Glyphs, so maybe that's a problem too. I'm using FontCreator, and I guess I'm just confused in general as to how I would do this at all.
  • Options
    Craig EliasonCraig Eliason Posts: 1,400
    Another, editor-agnostic, resource that might help is the OpenType Cookbook, which tries to start explanation from scratch and eventually gets to word-boundary detection. 
  • Options
    This feature code should get you started. Just make sure you have 3 alternates for the lower case letters a-z, the start, between, and end alternates.

    ###
    # OpenType Layout feature definitions
    # Format: OpenType Feature File Specification version 1.25.1
    # Generated by: FontCreator
    #
    
    languagesystem latn dflt; # Latin default
    
    @letter = [a-z];
    @letter.start = [a.start-z.start];
    @letter.between = [a.between-z.between];
    @letter.end = [a.end-z.end];
    
    lookup SingleSubstitutionStart { # GSUB lookup type SingleSubstitution
        sub @letter by @letter.start;
    } SingleSubstitutionStart;
    
    lookup SingleSubstitutionEnd { # GSUB lookup type SingleSubstitution
        sub @letter by @letter.end;
    } SingleSubstitutionEnd;
    
    lookup SingleSubstitutionBetween { # GSUB lookup type SingleSubstitution
        sub @letter by @letter.between;
    } SingleSubstitutionBetween;
    
    feature calt { # Contextual Alternates
        lookup ChainingContextStart { # GSUB lookup type ChainingContext
            ignore sub @letter.start @letter';
            ignore sub @letter.between @letter';
            ignore sub @letter @letter';
            sub @letter' lookup SingleSubstitutionStart @letter;
        } ChainingContextStart;
    
        lookup ChainingContextBetween { # GSUB lookup type ChainingContext
            sub @letter.start @letter' lookup SingleSubstitutionBetween @letter;
            sub @letter.between @letter' lookup SingleSubstitutionBetween @letter;
        } ChainingContextBetween;
    
        lookup ChainingContextEnd { # GSUB lookup type ChainingContext
            ignore sub @letter' @letter;
            sub @letter.start @letter' lookup SingleSubstitutionEnd;
            sub @letter.between @letter' lookup SingleSubstitutionEnd;
        } ChainingContextEnd;
    } calt;
    

    You can use FontCreator's proofing tool inside the OpenType Designer to debug the feature code:



  • Options
    This feature code should get you started. Just make sure you have 3 alternates for the lower case letters a-z, the start, between, and end alternates.

    ###
    # OpenType Layout feature definitions
    # Format: OpenType Feature File Specification version 1.25.1
    # Generated by: FontCreator
    #
    
    languagesystem latn dflt; # Latin default
    
    @letter = [a-z];
    @letter.start = [a.start-z.start];
    @letter.between = [a.between-z.between];
    @letter.end = [a.end-z.end];
    
    lookup SingleSubstitutionStart { # GSUB lookup type SingleSubstitution
        sub @letter by @letter.start;
    } SingleSubstitutionStart;
    
    lookup SingleSubstitutionEnd { # GSUB lookup type SingleSubstitution
        sub @letter by @letter.end;
    } SingleSubstitutionEnd;
    
    lookup SingleSubstitutionBetween { # GSUB lookup type SingleSubstitution
        sub @letter by @letter.between;
    } SingleSubstitutionBetween;
    
    feature calt { # Contextual Alternates
        lookup ChainingContextStart { # GSUB lookup type ChainingContext
            ignore sub @letter.start @letter';
            ignore sub @letter.between @letter';
            ignore sub @letter @letter';
            sub @letter' lookup SingleSubstitutionStart @letter;
        } ChainingContextStart;
    
        lookup ChainingContextBetween { # GSUB lookup type ChainingContext
            sub @letter.start @letter' lookup SingleSubstitutionBetween @letter;
            sub @letter.between @letter' lookup SingleSubstitutionBetween @letter;
        } ChainingContextBetween;
    
        lookup ChainingContextEnd { # GSUB lookup type ChainingContext
            ignore sub @letter' @letter;
            sub @letter.start @letter' lookup SingleSubstitutionEnd;
            sub @letter.between @letter' lookup SingleSubstitutionEnd;
        } ChainingContextEnd;
    } calt;
    

    You can use FontCreator's proofing tool inside the OpenType Designer to debug the feature code:




    Is there any way you can show me how the chaining context would look like in the gui? Not every character is going to have the same connection as what I've shown in my example, due to lining up with glyphs, so I'm going to need to do everything individually for possible patterns. If I could get just the example with the b character, I'm sure I could figure the rest out.
  • Options
    To make the feature code only work for b, just change the glyph classes to:
    @letter = [b];
    @letter.start = [b.start];
    @letter.between = [b.between];
    @letter.end = [b.end];



    You can test it online:


  • Options
    To make the feature code only work for b, just change the glyph classes to:
    @letter = [b];
    @letter.start = [b.start];
    @letter.between = [b.between];
    @letter.end = [b.end];



    You can test it online:



    Any time I try to put in code directly it tells me that it fails to compile the code. It's always done this, and I don't know why. I'm trying to rebuild the rule set from scratch, but I'm confused by it.
  • Options
    Erwin DenissenErwin Denissen Posts: 291
    edited August 2022
    CalicoStonewolf said:
    Any time I try to put in code directly it tells me that it fails to compile the code. It's always done this, and I don't know why. I'm trying to rebuild the rule set from scratch, but I'm confused by it.
    Within the OpenType Designer, click the Code Editor button at the bottom. FontCreator supports OTLFD, FEA, and VOLT, so make sure you have selected the FEA compiler before pasting the feature code.
Sign In or Register to comment.