Call GetJoiningKind to see how a letter or mark affects joining. No font is needed.
dotnet add package RecursiveAI.OneFontRequires .NET 10 (net10.0); .NET 9 and earlier aren’t supported.
using System; using OneFont; const string text = "\u0628\u064E\u0627"; foreach (var rune in text.EnumerateRunes()) { int cp = rune.Value; var kind = UnicodeProperties.GetJoiningKind(cp); Console.WriteLine($"U+{cp:X4}: {kind}"); }
The string contains beh, fatha (a vowel mark), and alef, in that order.
Paste the code above into Program.cs of a new dotnet new console project and dotnet run, or unzip the example and dotnet run.
U+0628: Dual U+064E: Transparent U+0627: Right
Out-of-range integers return None, so don’t use None to distinguish invalid input from a valid non-joining character.
Variations
Inspect join controls. Replace text with zero width joiner followed by zero width non-joiner:
const string text = "\u200D\u200C";U+200D: Causing U+200C: None
Related recipes
The short answer
Pass a Unicode code point as an int to UnicodeProperties.GetJoiningKind. For a C# string, iterate with EnumerateRunes() and pass each rune’s Value. The returned JoiningKind describes that code point’s ability to join; it doesn’t tell you which glyph a font will use in a particular word.
Which letters don’t connect in Arabic?
Some letters connect on only one side. For example, alef, dal, and reh are right-joining. In ordinary right-to-left Arabic, they can connect to a compatible letter before them in the stored text, which is displayed to their right, but not to the following letter on the left. Beh can join on either side. Hamza (U+0621) doesn’t join on either side. The Unicode Standard’s Arabic cursive joining section gives the rules and examples.
Right, Left, and Dual report the side or sides on which a character can connect. None means non-joining. Causing is for characters such as tatweel and zero width joiner that cause joining without changing their own shape. Transparent is different from None: a vowel mark such as fatha doesn’t form the connection itself or break the connection between the letters on either side. Keep that mark in the original text. It still needs to be rendered even though joining looks past it.
What are the Unicode code points for the Arabic letters and marks in the example?
U+0628 is beh (ب), U+064E is fatha (◌َ), and U+0627 is alef (ا). The dotted circle is only there to show the mark in isolation; it isn’t part of the input. The sample prints the numbers in hexadecimal so you can tell the letters and marks apart even when a console doesn’t render Arabic well. A C# char is a UTF-16 code unit, not always a whole Unicode character. Iterating over runes also works for code points that take two code units.
Use the lookup when you’re inspecting characters or explaining a joining decision. It doesn’t reorder mixed-direction text, select contextual glyphs, form ligatures, or position marks. For display, give the original text and a font to a shaping step; don’t substitute Arabic presentation forms based on the enum alone.