[Thai script] combining marks

Hello Forum. I just started learning Glyphs not long ago specifically for my thesis, which I am currently designing Latin type and Thai script. However, I have a problem combining Thai marks. Thai alphabets consist of 44 letters which ALL of them can be combined with all of the marks (vowels and tones), and also able to stacked themselves on top of each other.

I have read Glyphs Handbook and also many articles about setting ‘anchors’ and ‘mark to mark/mark to base positioning’ but I still don’t quite get it because I don’t usually do encoding or writing any script and feel more comfortable with designing new letters instead.

Can anybody explain to me step by step please?

Hi Alongkorn, glad to hear you’re working on Thai!

Each Thai consonant will need two anchors, these are where the marks will attach to:

Then, each mark will need anchors. Each anchor with an underscore will match up with the corresponding non-underscore anchor on a consonant. So here we have _topright which tells Glyphs to position the saraIi by looking at the topright anchor on a consonant:

The topright anchor on the saraIi tells Glyphs where to put any tonemark.

I’d recommend using the ‘Mark Preview’ plugin so you can see the effect of moving anchors around:

Hello. Thank you so much for the reply. I have tried this method already but when I do the testing by typing a consonant ‘ก’ and vowel ‘ี’, these two glyphs are still not connected through anchors.

Do you have the Mark Preview plugin enabled?

The mark positioning is not applied in the edit view (for various reasons). So the “Mark preview” plugin can help. Or use the mark cloud when you select an anchor.

When I enable Mark Preview plugin, this is what it shows on my screen once I type consonant ‘ก’ and follow by vowel ‘ี’';

Apparently two saraI appear on my screen.

Ah-hah! You just totally clear all my doubts, thank you! At first I thought that this is possible, because once I export my design and use it in InDesign, it just works automatically;

So in this case, there’s only two options to view mark positioning; 1. use mark cloud 2. Mark Preview plugin. I only can use one of them at the time, right?

The black one is an outline you can edit, or reposition the anchors on. The purpley one shows where it will be positioned in the compiled font.

hehe how many options would you like? :slight_smile:

I think I start to understand the logic behind mark positioning now, and these two options are quite helpful in their own way. I ended up using both of them consequently actually.

I still have more questions regarding of marks though. Is it possible to adjust marks position for each individual glyphs? As you can see in this picture below, the stem of vowel saraUu is not in the same position as consonant khoKhai;

You can either move the bottomcenter anchor on khoKhai, or use bottomright anchors instead of bottomcenter anchors. I use bottomright (eg in my screenshots above) so that all marks align to the right hand stems of consonants.

So let’s say, if I want to have the mark saraUu(ู) align on the right stem of khoKhai, I basically have to move and use anchor ‘_bottomright’ on mark SaraUu and ‘bottomright’ on khoKhai as in picture.

However, if I want to have mark saraU(ุ) align on the center between two stems of khoKhai, I basically have to create another anchor that says ‘bottomcenter’ on khoKhai and ‘_bottomcenter’ on mark saraU. Is that correct?

If you want to have different marks aligning in different ways, you can use whatever anchor names you like. You could have a _saraU anchor on saraU and a saraU anchor on each consonant to allow you to control precisely where just that specific mark sits in relation to the base. The anchor strategy is up to you, depending on what results you want.

I have spent two days trying to find a strategy of my own (that fits the style of my font in this case) and finally, successfully mark-to-mark every Thai characters with Thai marks, however, once I export it and test it on InDesign and other variable font preview website, the marks are still not marked to their places.

I think I have done everything correctly, and all marks appear in all right positions on Glyphs, however, not when I export and test it. :\

1 Like

That’s great that you’ve figured out all the anchors to give the results you want! :smiley:

First thing to check would be your settings in InDesign: the option you need is the ‘South Asian’ composer, I believe. (On older versions of InDesign, it’s the World-Ready Composer). If other Thai fonts are working correctly in InDesign, it’s a bug in your font…

Check you have the correct Unicode ranges set for Thai in Glyphs’ Font Info, and that you have a languagesystem declaration DFLT thai.

I can’t tell from your screenshot if you’re trying to substitute a small maiTho when it’s in the upstairs position, but maybe there’s a bug in your OpenType code. Do you have OT features being generated automatically?

Fist of all, I exported this font as Variable Fonts. Does it has something to do with that? I’m actually using Adobe InDesign 2020, however, there’s only button that says World-Ready. Do I also need to change the setting in Preference?

By the way, you don’t think that it has anything to do with maiTho-small and maiTho-narrow, right? Because I haven’t focused on it yet.


And yes, other Thai fonts in my computer work just fine.

In my earlier screenshot I try to mark maiTho in upstair position of saraI on top of koKai. And to be honest, right now I am quite lost when you mention ‘language system declaration DFLT Thai’. And what do you mean by ‘OT features being generated automatically’?

I am so sorry I’m asking so many questions right now as I am so, totally lost… :confused:

Does InDesign support variable fonts?

Looks like yes, the World-ready composer is what you need here. I can’t see any relevant options in the preferences.

The maiTho-thai.small is the upstairs version, so if you haven’t drawn it yet, the font only has the default (downstairs) version, which may be what we’re seeing in InDesign where it’s overlapping. I don’t know what anchors you have on the saraIi-thai, but if it’s missing a “top” anchor then we’d expect to see the maiTho just sitting on top like this. Sara Ii (and the others) need both “_top” to attach to bases and “top” to position upstairs marks onto.

[The maiTho-thai.narrow is in case you want to add a compressed version for poPla, foFa and foFan, so the marks don’t stretch too far out to the left on those base consonants.]

In your features, you’ll need a languagesystem prefix so that the font can tell apps what scripts it contains:

The OpenType features for Thai include the glyph substitions (using the upstairs tonemarks when there’s an abovevowel, using the .less versions of yoYing and thoThan when there’s a vowel below) and mark positioning. Mark positioning is generated automatically, but the substitutions can be handled by Glyphs, if you add a feature [contextual alternates] and set it to ‘generate feature automatically’.


Thank you so much for your help until this point. Yes, my InDesign also support Variable Fonts, however, I think I need to show you my mark-to-mark process so that we can tackle on the real problem I have now and to prevent problems that could occur (again) in future:

In order for me to adjust marks on each Thai consonants later individually (without interfering one another), I decided to set anchors (for every mark ) on every Thai consonants individually as you can see in this picture;

And then I do the same process on every mark, in this case I’m giving the example of ‘saraIi’ and ‘maiTho’;

According to the logic of ‘top’ and ‘_top’ anchors setting, this method should also work, right? Because once I use Mark Preview plugin to check in Glyphs, everything seems to work fine;

But once I export and test it in InDesign, only some marks (maiEk, maiTho, maiTri, maiChattawa, and thanthakhat) don’t appear on top of consonants. However, some marks (maiHanaKat, maitakhu, saraI, saraIi, saraUe, saraUee, and nikhahit) do;

But once I stack another mark on top of some marks (that actually appear), they happen to be overlapped;

One quite important thing.
In the base glyph, put the anchor to the edge of the glyph. And in the mark, give it the space you need. That way you can define the distance for each mark in the mark itself.

I’m not sure if you’re showing actual screenshots from Glyphs, if you want more than one anchor in the same position, AFAIK you can’t use one anchor two names separated by a comma, you need two separate anchors.

Why is there an anchor above the maiTho? AFAIK there’s never anything that can sit above maiTho, even in minority languages.

That’s odd. Are there any error messages when you export? Check the glyph properties for your tonemarks (Cmd-alt-i in the main tab). The default (non-small, non-narrow) versions should have Unicode values, and should be defined as nonspacing marks. Make sure they’re set as exporting glyphs.

I forgot to mention that I screenshot it and wrote the text over. So in that example, there’s more anchors in the same position.

It is true that there’s nothing can sit on top of tonal marks in Thai because it totally doesn’t make any sense or mean anything, however, I would love to test it out and see how it could look like in reality. It’s a part of my thesis topic in a way.

There’s no error messages once I export at all… And yes, all default version marks have their Unicode values, BUT all boxes are empty, so I ticked them like this. However, the outcome is still the same…