NepaliFontConverter 0.1.0-preview.2
dotnet add package NepaliFontConverter --version 0.1.0-preview.2
NuGet\Install-Package NepaliFontConverter -Version 0.1.0-preview.2
<PackageReference Include="NepaliFontConverter" Version="0.1.0-preview.2" />
<PackageVersion Include="NepaliFontConverter" Version="0.1.0-preview.2" />
<PackageReference Include="NepaliFontConverter" />
paket add NepaliFontConverter --version 0.1.0-preview.2
#r "nuget: NepaliFontConverter, 0.1.0-preview.2"
#:package NepaliFontConverter@0.1.0-preview.2
#addin nuget:?package=NepaliFontConverter&version=0.1.0-preview.2&prerelease
#tool nuget:?package=NepaliFontConverter&version=0.1.0-preview.2&prerelease
NepaliFontConverter
A correct, dependency-free .NET library for converting legacy Nepali fonts (Preeti, Kantipur) to Unicode Devanagari. Built around a longest-match tokenizer and a separate i-matra reordering pass — the two things existing converters most often get wrong.
Status — v0.1.0 (preview): the architecture is complete and tested. The mapping tables are intentionally stubbed; the API surface and behavior will not change before the full tables land.
Install
dotnet add package NepaliFontConverter
Quick start
Static method:
using NepaliFontConverter;
var unicode = NepaliFontConverter.PreetiToUnicode("/fd");
// → "राम"
DI-friendly instance:
INepaliFontConverter converter = new NepaliFontConverter();
var unicode = converter.ToUnicode("/fd", LegacyFont.Preeti);
Extension method:
using NepaliFontConverter.Extensions;
var unicode = "/fd".PreetiToUnicode();
Supported fonts
| Font | Status |
|---|---|
| Preeti | ✅ (stub table in v0.1.0; full port in progress) |
| Kantipur | ✅ (stub table in v0.1.0; full port in progress) |
| Sagarmatha | ⏳ planned |
| PCS Nepali | ⏳ planned |
Unicode → legacy (reverse direction) is on the roadmap; v1 is one-way only.
Options
var opts = new ConversionOptions
{
ConvertNumerals = true, // 1234 → १२३४
ConvertPunctuation = true, // . → ।
PreserveUnmappedCharacters = true, // English letters pass through
};
| Property | Default | Effect |
|---|---|---|
ConvertNumerals |
true |
Map ASCII digits to Devanagari digits. |
ConvertPunctuation |
true |
Map . to । (purna viram). |
PreserveUnmappedCharacters |
true |
Unmapped chars pass through unchanged; otherwise dropped. |
Why this package
- Correct i-matra reordering. Preeti types the i-matra (ि) BEFORE the consonant; Unicode encodes it AFTER. Implemented as a separate, well-tested post-tokenization pass — not stitched into the tokenizer.
- Longest-match tokenization. Multi-character glyph sequences (half-letters, conjuncts like क्ष) are mapped as single tokens, not via naive
string.Replaceloops. - Multi-target.
netstandard2.0for broad reach,net8.0for modern apps. - Zero dependencies. Pure text — no third-party packages in the production graph.
Acknowledgments
The mapping tables to be ported in upcoming releases are based on prior open-source work:
nepali-unicode-converter(npm)preeti-unicode(PyPI)- The Ashesh.com.np converter
Each ported table will carry an inline citation of its source, license, and pinned version.
Contributing
Issues, PRs and golden-pair contributions welcome. Run dotnet test from the repo root to verify your changes.
License
MIT. See LICENSE.
| Product | Versions Compatible and additional computed target framework versions. |
|---|---|
| .NET | net5.0 was computed. net5.0-windows was computed. net6.0 was computed. net6.0-android was computed. net6.0-ios was computed. net6.0-maccatalyst was computed. net6.0-macos was computed. net6.0-tvos was computed. net6.0-windows was computed. net7.0 was computed. net7.0-android was computed. net7.0-ios was computed. net7.0-maccatalyst was computed. net7.0-macos was computed. net7.0-tvos was computed. net7.0-windows was computed. net8.0 is compatible. net8.0-android was computed. net8.0-browser was computed. net8.0-ios was computed. net8.0-maccatalyst was computed. net8.0-macos was computed. net8.0-tvos was computed. net8.0-windows was computed. net9.0 was computed. net9.0-android was computed. net9.0-browser was computed. net9.0-ios was computed. net9.0-maccatalyst was computed. net9.0-macos was computed. net9.0-tvos was computed. net9.0-windows was computed. net10.0 was computed. net10.0-android was computed. net10.0-browser was computed. net10.0-ios was computed. net10.0-maccatalyst was computed. net10.0-macos was computed. net10.0-tvos was computed. net10.0-windows was computed. |
| .NET Core | netcoreapp2.0 was computed. netcoreapp2.1 was computed. netcoreapp2.2 was computed. netcoreapp3.0 was computed. netcoreapp3.1 was computed. |
| .NET Standard | netstandard2.0 is compatible. netstandard2.1 was computed. |
| .NET Framework | net461 was computed. net462 was computed. net463 was computed. net47 was computed. net471 was computed. net472 was computed. net48 was computed. net481 was computed. |
| MonoAndroid | monoandroid was computed. |
| MonoMac | monomac was computed. |
| MonoTouch | monotouch was computed. |
| Tizen | tizen40 was computed. tizen60 was computed. |
| Xamarin.iOS | xamarinios was computed. |
| Xamarin.Mac | xamarinmac was computed. |
| Xamarin.TVOS | xamarintvos was computed. |
| Xamarin.WatchOS | xamarinwatchos was computed. |
-
.NETStandard 2.0
- No dependencies.
-
net8.0
- No dependencies.
NuGet packages
This package is not used by any NuGet packages.
GitHub repositories
This package is not used by any popular GitHub repositories.
| Version | Downloads | Last Updated |
|---|---|---|
| 0.1.0-preview.2 | 87 | 5/14/2026 |
| 0.1.0-preview.1 | 67 | 5/14/2026 |