Closed rayzchen closed 9 months ago
Hello!
This is not possible using OTF Ligatures... and, also, I don't think it's even needed. Ligatures are defined by a sequence of Characters, they cannot be defined by other ligatures.
So, in your case, as you type the word "panpa", you would have something like this:
p
(a single character)pa
(Ligature 1)pan
(Ligature 2)p
a
n
p
(you didn't list this as a ligature, so this would just be four characters)panpa
(Ligature 3)If you also typed "pana" it would look like this:
p
(a single character)pa
(Ligature 1)pan
(Ligature 2)pana
(Ligature 4)Ligatures 1,2,3,4 will all have a new character defined and will have their own set of unique character sequences to define them. The Visual Design (what shapes exist) for each Ligature can be whatever you want. For example, if you want pa
to look like p
+a
, then that is fine. If you want pa
to look totally new and different and unrelated to any other character, that is also fine. There is no limitation on the design of Ligature characters needing to look a certain way.
Many times, a Ligature for a sequence of character resembles the individual characters in some way. In Glyphr Studio you can use the "Copy Shapes" action, which lets you copy all the shapes from one glyph to another. Or you could use Components to make a link between Glyphs. These could help you get started - but again, the design of your Ligature is up to you, it doesn't have to look like the source characters that define it.
Let me know if you have any questions - I am going to mark this as closed because, like I said at the top, this isn't possible to achieve.
How can I make a font such that when I type the word panpa
, I get the two ligatures pan
and pa
, and when I type the word pana
, I get the two ligatures pa
and na
?
Oh, I see your problem. There is no simple way to do that. If you define pan
it will always replace the sequence p
a
n
. The OTF file has no way of knowing what you "want" in different situations. It can only read sequences of characters.
One of the more "advanced" solutions is to use a character called the "Combining grapheme joiner". It is a zero-width character with no shapes, and it's only purpose is to split two characters that would otherwise be combined: https://en.wikipedia.org/wiki/Combining_grapheme_joiner
So if you wanted to type the word "pana" and get pa
na
, you would actually have to type "pa|na" (here I'm using the | character to represent the combining grapheme joiner)
The combining grapheme joiner has the Unicode id of U+034F
is in between these two quotes: "͏͏"
If you are creating your own language, you can do something similar with an unused and more common character. For example, if your alphabet did not include the use of a quote, you could define ligatures for pa'
, na
, and pana
and then when you type you could just do "panpa" which would resolve to pan
pa
and if you type "pa'na" it would resolve to pa'
and na
. In this case, you could just design pa'
to look like pa, and use the quote to resolve the ligature conflict, while ignoring it visually. The quote character in this example could literally be any character, but hopefully one you are not already using.
I better understand your need now, thanks for explaining it. But, font files don't order their ligature definitions, they just look for sequences starting with longest ones first.
Ah, alright, thanks!
I would like to make a font with ligatures which have priority order.
For example:
panpa
should be comprised of the ligaturespan
andpa
, butpana
should be comprised of the ligaturespa
andna
, NOTpan
anda
. Therefore I wantna
to be higher priority thanpan
.