---
title: "Check Unicode East Asian Width in C#"
url: https://recursiveai.org/onefont/cookbook/classify-east-asian-width/
description: "Check whether each Unicode code point is Wide, Fullwidth, or Halfwidth in C# with OneFont. This Boolean does not measure terminal columns."
version: "1.4.0"
---

# Check Unicode East Asian Width 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/classify-east-asian-width/classify-east-asian-width.zip)

`IsEastAsianWide` checks a Unicode code point’s East Asian Width.

It returns `true` for Wide, Fullwidth, or Halfwidth and `false` otherwise. It doesn’t return the six-way category.

```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.Text;
using OneFont;
foreach (var rune in "AＡ漢ｶ".EnumerateRunes())
{
    bool match = TextSegmentation
        .IsEastAsianWide(rune.Value);
    Console.WriteLine($"{rune}: {match}");
}
```

Unzip [the example](https://recursiveai.org/onefont/cookbook/classify-east-asian-width/classify-east-asian-width.zip), then `dotnet run`.

Prints whether each code point in `AＡ漢ｶ` is Wide, Fullwidth, or Halfwidth.

```text
A: False
Ａ: True
漢: True
ｶ: True
```

## The full program

```csharp
using System;
using System.Text;
using OneFont;

foreach (Rune rune in "AＡ漢ｶ".EnumerateRunes())
{
    bool match = TextSegmentation
        .IsEastAsianWide(rune.Value);
    Console.WriteLine($"{rune}: {match}");
}
```

```text
A: False
Ａ: True
漢: True
ｶ: True
```

The method returns `false` for values outside the Unicode code point range; that result isn’t a validity check. Use `Rune` when the input is a Unicode scalar value.

## Variations

### Check a supplementary code point

Append this to check U+20000, a Han ideograph that takes two UTF-16 code units but only one `Rune`.

```csharp
var ideograph = new Rune(0x20000);
bool isWide = TextSegmentation
    .IsEastAsianWide(ideograph.Value);
Console.WriteLine($"U+{ideograph.Value:X}: {isWide}");
```

```text
U+20000: True
```

## Related recipes

[Find Unicode grapheme boundaries](https://recursiveai.org/onefont/cookbook/find-unicode-grapheme-boundaries/)

[Measure text width](https://recursiveai.org/onefont/cookbook/measure-text-width/)

---

## The short answer

Call `TextSegmentation.IsEastAsianWide(codePoint)` for a Boolean check. Despite the name, `true` means **Wide, Fullwidth, or Halfwidth**; it doesn’t mean strictly Wide. Use `EnumerateRunes()` for a string so you pass each Unicode scalar value once, rather than passing each UTF-16 `char`.

## What are the Unicode East Asian Width categories?

[Unicode Standard Annex #11](https://www.unicode.org/reports/tr11/tr11-44.html#Definitions) defines six default categories: Wide (`W`), Fullwidth (`F`), Halfwidth (`H`), Narrow (`Na`), Neutral (`N`), and Ambiguous (`A`). In the snippet, `漢` is Wide, `Ａ` is Fullwidth, and `ｶ` is Halfwidth. They all return `true`. ASCII `A` is Narrow and returns `false`. The Boolean doesn’t tell you which of the three matching categories you found or distinguish among the other three. If you need the six labels, look up the individual values in Unicode’s [EastAsianWidth.txt](https://www.unicode.org/Public/17.0.0/ucd/EastAsianWidth.txt) for the Unicode version you support.

This grouping is documented in [OneFont’s shaping and segmentation guide](https://recursiveai.org/onefont/docs/shaping/): “`IsEastAsianWide(codePoint)` is the East_Asian_Width Fullwidth, Wide or Halfwidth test.” It’s independent of which font you have installed and doesn’t tell you whether a specific font has a glyph for a character.

## Can you use East Asian Width to measure terminal columns?

Not with this check. Counting every `true` result as two columns treats halfwidth `ｶ` the same as fullwidth `Ａ`. Counting every `false` as one column also ignores how the terminal handles ambiguous-width characters and characters that combine. [Unicode’s scope note](https://www.unicode.org/reports/tr11/tr11-44.html#Scope) says the property isn’t an off-the-shelf solution for modern terminals. Use a width policy that matches your terminal for a character sequence, or use shaped advances when you need the width of text in a particular font rather than a column count.
