Converting Legacy mark to Combining mark

Hi, I am working on a Tamil font. I am aware that Glyphs does not generate several ligatures by default.

However I was wondering if there is a way to convert Legacy marks as Combining marks. The reason I ask is as follows:

Let’s say I want to create ka-tamil + pulli-tamil = kku (Tamil character), it appears by default once you label the Anchor points correctly.

However let’s say I want to create ka-tamil + iMatra-tamil (to create ki character), I am unable to do it just by labeling the Anchor points. Instead I have to resort to Kerning or creating a new combination and adding it to psts list in the Features tab.

If there is a simple way to convert Legacy marks to Combining mark, things might get simplified. Please let me know if this is possible.

Are there ligatures missing every font needs to have? Perhaps @m_nedumaran can chime in. If so, we can add them to the built-in list.

The edit view does not preview mark positioning. You can do that with:

  • the plug-in Show Mark Preview
  • via Window > Text Preview with instances set up in File > Font Info > Export

Not sure what you mean by converting to combining mark, and what a legacy mark would be in Tamil. Have there ever been non-combining marks? In theory all you have to do is stick to the naming convention (see Window > Glyph Info and search for ‘tamil’), so perhaps you need to rename the glyphs, and remove any overrides from the respective glyph information (Edit > Info for Selection).

The only precomposed ligatures we absolutely need for base+i/iiMatra-tamil are for tta. The rest can be handled using contextual forms. You may need to create several versions of iMatra-tamil. I typically use about 3. One for nga, pa, va, ya. One for ka, nya, ta, na and one for the rest. Sometimes ma, rra, la, sa may need separate ones. All these will depend on your design. You then need to add GSUB lookups to substitute them accordingly.

In some cases, I even create wider forms for nga, pa, va, ya when attaching an iMatra or iiMatra.

For iiMatra, I usually create two. One for nga, pa, va, ya and one more for the rest.

Here’s a sample GSUB lookup that does the substitution. This also substitutes wider forms of nga, pa, va, ya to accommodate the i and iiMatras.

sub [nga-tamil pa-tamil ya-tamil va-tamil]' lookup wide_pavaya [iMatra-tamil iiMatra-tamil]' lookup imatra_pavaya;
sub [ka-tamil nya-tamil ta-tamil na-tamil] [iMatra-tamil]' by [iMatra-tamil.002];
lookup wide_pavaya {
	lookupflag 0;
	sub nga-tamil	by nga-tamil.001;
	sub pa-tamil 	by pa-tamil.001;
	sub ya-tamil 	by ya-tamil.001;
	sub va-tamil	by va-tamil.001;
} wide_pavaya;

lookup imatra_pavaya {
	lookupflag 0;
	sub iMatra-tamil	by iMatra-tamil.001;
	sub iiMatra-tamil	by iiMatra-tamil.001;
} imatra_pavaya;

Hope this helps.


@mekkablue and @m_nedumaran Thank you so much for taking the time to respond.

@m_nedumaran I understand what you are saying and this is super useful!!
I have a basic question regarding the substituted characters.

Lets say you want to create ka-tamil+iMatra-tamil = ki and ya-tamil+iMatra-tamil = yi, do you make separate glyphs for ki and yi though you use the same iMatra-tamil?
Is there a way to generate ki, yi by defining unique anchor points on ka-tamil, ya-tamil (as well as iMatra-tamil) to make the substitution using a command?

@sgangaprasath, good question. Unlike iiMatra-tamil, iMatra-tamil is a spaced mark most of the time. I do have designs that use non-spacing iMatra forms. But those are unique cases. In those cases, I use anchor points for iMatra in Tamil - but rare. If you use GSUBs as I suggested earlier, the LSBs of the iMatra forms can be fixed. So there will not be a need for anchor points.

For some display typefaces, I create unique glyphs for each ligature. This is to prevent overlaps when we use their outlines in apps like Illustrator etc. If you want a unique ligature for ka-tamil + iMatra-tamil, then add a new glyph called ka_iMatra-tamil. Then create an entry in post table lookup like this:

sub ka-tamil iMatra-tamil by ka_iMatra-tamil;

You can do the same for all other base + matras.

@mekkablue I haven’t tried this yet: if I add a ka_iMatra-tamil glyph, is there a way to make GlyphsApp automatically generate the substitution? I think I need to add a postfix, like .hist for historical ligatures, but I’m not quite sure :wink:

1 Like

@m_nedumaran Thank you again for clarifying. I will give this a try and get back if I have more queries!

Hi @m_nedumaran , the suggestions you had given worked out. Thanks!!!

I have a small issue when I implement it in Glyphs.
When I would like to add a variant of [nga-tamil, va-tamil] + iMatra-tamil.001, I use the following code in the Features section (inspired by your GSUB code)

@list1 = [nga-tamil va-tamil];

@list1Sub = [nga-tamil.001 va-tamil.001];
@list2 = [iMatra-tamil iiMatra-tamil];
@list2Sub = [iMatra-tamil.001 iiMatra-tamil.001];
lookup subSt {
	sub @list1 by @list1Sub;
	sub @list2 by @list2Sub;
} subSt;

lookupflag IgnoreMarks;
sub [@list1]' lookup subSt
	[@list2]' lookup subSt;

It seems to rightly give the substitution for nga-tamil and va-tamil. However Glyphs seems to modify all the iMatra-tamil occurrences to iMatra-tamil.001. Here is an example of lla-tamil+iMatra-tamil for which there is supposed to be no substitution. However Glyphs makes the substitution and gives

Screenshot 2023-04-07 at 7.19.31 PM

Is there something I am missing?

Glyphs is doing the right thing. Your substitution is missing context. Here’s what I think you want to do:

# Add these lookups in prefix
lookup wide_forms {
   sub nga-tamil by nga-tamil.001;
   sub va-tamil by va-tamil.001;
} wide_forms;

lookup imatra001 {
   sub iMatra-tamil by iMatra-tami.001;
   sub iiMatra-tamil by iiMatra-tamil.001;
} imatra001;

# In post
sub [nga-tamil va-tamil]'  lookup wide_forms [iMatra-tamil iiMatra-tamil]' lookup imatra001;

Hope this helps.

Wow! Thank you so much!!!