Navigation Menu

Skip to content

nesterovsky-bros/BidiVisualConverter

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

6 Commits
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

BidiVisualConverter

Bidi visual to logical and vice versa converter.

Oftentimes we deal with Hebrew in .NET.
The task we face again and again is attempt to convert a Hebrew text from visual to logical representation. The latest demand of such task was when we processed content extracted from PDF. It's turned out that PDF stores content as graphic primitives, and as result text is stored visually (often each letter is kept separately).
We've solved this task with a small wrapper around an Uniscribe API:
namespace NesterovskyBros.Bidi
{
  /// <summary>
  /// An utility to convert visual string to logical.
  /// <summary>
  public static class BidiConverter
  {
    /// <summary>
    /// Converts visual string to logical.
    /// </summary>
    /// <param name="value">A value to convert.</param>
    /// <param name="rtl">A base direction.</param>
    /// <param name="direction">
    /// true for visual to logical, and false for logical to visual.
    /// </param>
    /// <returns>Converted string.</returns>
    public static string Convert(string value, bool rtl, bool direction);
    ...
  }
}

UnitTest.cs shows how to use this API.

About

C# BidiVisualConvrter that uses Windows Uniscribe

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages