Page 1 of 1

How to create a large number of composites

Posted: Fri Apr 23, 2021 6:45 am
by Dan Kreider
Hi,

I need to create a large number of composites, since I am limited to using only standard ligatures to produce things like this:

Image

I'm planning on accomplishing it by something like this:

Image

...where each of the three positions could be a number, a line, or a space. I would make an @ prefix for each ligature, so user would input:

at_seven_five_three.liga
at_hyphenminus_hyphenminus_hyphenminus.liga, etc
@---
@-4-
@6!- (! for a space)
@!!2

but obviously there are a lot of combinations, since each position could be a number up to 9, a line, or a space! That's more than a thousand combinations. Ugh...

Is there a way I could batch this process? I need to use composites, but generate ligatures from them automatically.

Re: How to create a large number of composites

Posted: Fri Apr 23, 2021 9:31 am
by Erwin Denissen
You could try Insert Glyphs by Name and then provide a formula for each new glyph like:

at_seven_five_three.liga=at+seven+five+three

Etc.

Then the feature generator available from the upper left toolbar in the OpenType Designer should be able to create the ligature (if all glyph components within the glyph name exist in the font). Here is the generated fea code:

Code: Select all

lookup latn_liga { # GSUB lookup type Ligature
    sub at seven five three by seven_five_three.liga;
} latn_liga;

Re: How to create a large number of composites

Posted: Fri Apr 23, 2021 12:16 pm
by Dan Kreider
Is it correct that the glyphs themselves can be named whatever I want? So they could be 7, 5, 3, etc, and I would then type

at_seven_five_three.liga=@753

?

That would be faster...

Re: How to create a large number of composites

Posted: Fri Apr 23, 2021 12:47 pm
by Dan Kreider
Another question: when I try to create a composite, the glyphs don't stack... they are sequential from left to right. How do I make them superimposed?

Thanks!

Re: How to create a large number of composites

Posted: Fri Apr 23, 2021 12:49 pm
by Erwin Denissen
If your glyph names are literally @, 7, 5, and 3, then these should both work:

@_7_5_3.liga=@+7+5+3

at_seven_five_three.liga=@+7+5+3

However be aware the at sign is a special characters in feature code syntax, so it is best to not avoid it in your glyph names.
Dan Kreider wrote: Fri Apr 23, 2021 12:47 pm Another question: when I try to create a composite, the glyphs don't stack... they are sequential from left to right. How do I make them superimposed?
To make them stack, you need to provide cursive attachment anchors.

Re: How to create a large number of composites

Posted: Fri Apr 23, 2021 1:01 pm
by Dan Kreider
Well, I don't think (if I remember correctly) that I can use 7, 5, 3, etc in the actual .liga code. Those have to be written out in full. But the glyphs the ligature is referencing can be named anything.

Thanks, I will look into anchors again. That part is still confusing for me.

Re: How to create a large number of composites

Posted: Fri Apr 23, 2021 3:28 pm
by Erwin Denissen
Dan Kreider wrote: Fri Apr 23, 2021 1:01 pm Well, I don't think (if I remember correctly) that I can use 7, 5, 3, etc in the actual .liga code. Those have to be written out in full.
Sure, by default the digit glyphs have names like one, two, etc, and you have to use those (or change the glyph name, but that is not recommended).

Re: How to create a large number of composites

Posted: Fri Apr 23, 2021 7:34 pm
by Dan Kreider
Sorry to be dense, but I can't figure it out. I combined superior 7, baseline 5, and subscript 3, and got this:

Image

But I want them to be stacked. I tried to add a cursive anchor, but I couldn't figure it out. Also, is this an OT feature? If so, the software this will be used with can only use standard ligatures. Thanks...

Re: How to create a large number of composites

Posted: Fri Apr 23, 2021 7:45 pm
by Dan Kreider
Ok, I added a bottom anchor (base) below the 7, and a top (mark) anchor above the 5, and got this:

Image

...which is progress, but I was expecting the 7 and the 5 would be lined up! What am I missing now? Thanks.

Re: How to create a large number of composites

Posted: Fri Apr 23, 2021 7:47 pm
by Erwin Denissen
Sorry, but in my speedy reply I mixed up cursive with regular anchors. Even though it might also be possible with cursive (entry and exit) anchors, it is probably easiest to work with regular anchors. Your way of making glyphs is rather unusual, but this tutorial might help:
https://www.high-logic.com/font-editor/ ... ont-design

To make base to mark work, the second glyph should be a Mark glyph.

Re: How to create a large number of composites

Posted: Fri Apr 23, 2021 8:45 pm
by Dan Kreider
Just a quick note to say it's solved, thanks... I needed my anchors to be the same name: one base, one mark.