---
title: "Get the Unicode Arabic joining type in C#"
url: https://recursiveai.org/onefont/cookbook/read-arabic-character-joining-type/
description: "Use OneFont to look up the Unicode joining type of an Arabic character in C#. Distinguish joining letters, transparent marks, and join controls without a font."
version: "1.4.0"
---

# Get the Unicode Arabic joining type in C#

**onefont** is a free, open-source font and text-shaping library for .NET from Recursive AI. MIT or Apache-2.0, no native dependencies.

[NuGet](https://www.nuget.org/packages/RecursiveAI.OneFont) · [GitHub](https://github.com/recursive-ai-oss/onefont-csharp) · [Docs](https://recursiveai.org/onefont/docs/) · [Download example (.zip)](https://recursiveai.org/onefont/cookbook/read-arabic-character-joining-type/read-arabic-character-joining-type.zip)

Call `GetJoiningKind` to see how a letter or mark affects joining. No font is needed.

```shell
dotnet add package RecursiveAI.OneFont
```

Requires [.NET 10](https://dotnet.microsoft.com/download/dotnet/10.0) (net10.0); .NET 9 and earlier aren’t supported.

```csharp
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](https://recursiveai.org/onefont/cookbook/read-arabic-character-joining-type/read-arabic-character-joining-type.zip) and `dotnet run`.

```text
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:

```csharp
const string text = "\u200D\u200C";
```

```text
U+200D: Causing
U+200C: None
```

## Related recipes

- [Lay out right-to-left text](https://recursiveai.org/onefont/cookbook/right-to-left-text/)
- [Shape text into glyphs](https://recursiveai.org/onefont/cookbook/shape-text/)

---

## 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](https://www.unicode.org/versions/Unicode17.0.0/core-spec/chapter-9/) 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](https://recursiveai.org/onefont/cookbook/shape-text/); don’t substitute Arabic presentation forms based on the enum alone.
