Options
All
  • Public
  • Public/Protected
  • All
Menu

Namespace UnicodeUtils

Namespace containing useful information when dealing with Unicode's code points.

Index

Variables

Const neutralBidirectionalRanges

neutralBidirectionalRanges: number[][] = [[0x0020, 0x002f],[0x003a, 0x0040],[0x005b, 0x0060],[0x007b, 0x007e]]

ASCII punctuation is considered to have neutral direction: https://en.wikipedia.org/wiki/Basic_Latin_(Unicode_block)#Table_of_characters

Const newLineRanges

newLineRanges: number[][] = [[0x000a, 0x000d],[0x0085, 0x0085],[0x2028, 0x2029]]

Range of Unicode code points considered as NewLine. https://en.wikipedia.org/wiki/Newline#Unicode

Const nonPrintableRanges

nonPrintableRanges: number[][] = [[0x0000, 0x001f],[0x007f, 0x009f]]

Range of Unicode code points considered as non-printable. https://en.wikipedia.org/wiki/Unicode_control_characters

Const rtlBlocks

rtlBlocks: string[] = ["Hebrew","Alphabetic Presentation Forms","Arabic","Arabic Supplement","Arabic Extended-A","Arabic Presentation Forms-A","Arabic Presentation Forms-B","Arabic Mathematical Alphabetic Symbols","Indic Siyaq Numbers","Rumi Numeral Symbols","Syriac","Syriac Supplement","Samaritan","Mandaic","Thaana","Mende Kikakui","NKo","Adlam","Hanifi Rohingya"]

Unicode Blocks which have inherent RTL direction. These blocks correspond to the scripts described here: https://en.wikipedia.org/wiki/Right-to-left#List_of_RTL_scripts

Const rtlMirroredCodePoints

rtlMirroredCodePoints: number[] = [0x0028,0x0029,0x003c,0x003e,0x005b,0x005d,0x007b,0x007d]

Some punctuation characters (like: (, ), <, >, [,], {, }) need to be mirrored when rendering a RTL string to preserve their intrinsic meaning. https://en.wikipedia.org/wiki/Basic_Latin_(Unicode_block)#Table_of_characters

Const weakBidirectionalRanges

weakBidirectionalRanges: number[][] = [[0x0030, 0x0039],[0x0660, 0x0669],[0x06f0, 0x06f9]]

Const whiteSpaceRanges

whiteSpaceRanges: number[][] = [[0x0009, 0x0009],[0x0020, 0x0020],[0x1680, 0x1680],[0x2000, 0x2006],[0x2008, 0x200a],[0x205f, 0x3000],[0x180e, 0x180e],[0x200b, 0x200d]]

Range of Unicode code points considered as white space. https://en.wikipedia.org/wiki/Whitespace_character

Functions

getDirection

  • getDirection(codePoint: number, block: string): Direction

isNewLine

  • isNewLine(codePoint: number): boolean

isPrintable

  • isPrintable(codePoint: number): boolean

isRtlMirrored

  • isRtlMirrored(codePoint: number): boolean

isWhiteSpace

  • isWhiteSpace(codePoint: number): boolean

Generated using TypeDoc