How to avoid overlapping between regular diacritics and Quranic signs (e.g. Small Alef and Maddah) in Arabic fonts?

Evening of creativity,

I’m developing an Arabic font that supports both basic phonetic diacritics (such as fatha, damma, shadda…) and special signs used in the Uthmani Quranic script, like the Small Alef (ٰ), Maddah (ٓ), and some Waqf (pause) signs.

The issue I’m facing is that these marks tend to overlap or conflict visually when more than one is applied to the same base letter.

For example, in the word “هَٰذَآ”:

The letter “ه” carries a fatha (basic diacritic).

The letter “ذ” has a fatha plus a Small Alef (a Quranic mark stacked above it).

The letter “ا” carries a Maddah mark.

When I implement these in the font using mark-to-base and mark-to-mark positioning, the stacking becomes inconsistent:

Sometimes the fatha disappears beneath the Small Alef.

Sometimes the Maddah appears too low or overlaps other marks.

I’m already using anchors like top, top2, etc., and applying GPOS features, but I’m not sure how to properly structure the anchors and lookup order to ensure clean positioning without visual clutter.

My questions are:

  1. What is the best way to separate regular diacritics from Quranic marks in the font’s logic?

  2. How should I set up anchors (e.g., top, top2) on base glyphs to accommodate multiple layers of marks?

  3. How can I structure the mark-to-base and mark-to-mark rules so that each mark stacks correctly without collision?

I would highly appreciate any guidance, best practices, or practical examples—especially since my aim is to support accurate Quranic rendering in the font.

Many thanks in advance!

Hello, my friend.
I encountered the same problem.
The reason was that I placed the anchors aligned with the graphics.
I placed a space between the diacritical marks and the top-arab And top-arab(M), bottom-arab bottom-arab(M), as shown in images 1 and 2.


I used the Sakkal Majalla Font as a reference and set the anchor as shown in images 3 and 4, and it worked very well for me.


The diacritical marks do not separate



1 Like

I have prepared the attached file for your benefit. It is a miniature version of the Sakkal Majalla Windows font.
https://drive.google.com/file/d/1_G41Vckm978rG3XZRTTrmrpveYJi3qF7/view?usp=sharing

1 Like

اسكركم عاليا سيدي منير مححاب.. ساطلع على هدا الملف… احترامي وتقديري