Robot Framework Integrated Development Environment (RIDE)
robotide.lib.robot.utils.charwidth Namespace Reference

Functions

def _char_in_map (char, map)
 
def get_char_width (char)
 A module to handle different character widths on the console. More...
 

Variables

list _COMBINING_CHARS
 
list _EAST_ASIAN_WILD_CHARS
 

Function Documentation

◆ _char_in_map()

def robotide.lib.robot.utils.charwidth._char_in_map (   char,
  map 
)
private

Definition at line 41 of file charwidth.py.

◆ get_char_width()

def robotide.lib.robot.utils.charwidth.get_char_width (   char)

A module to handle different character widths on the console.

Some East Asian characters have width of two on console, and combining characters themselves take no extra space.

See issue 604 [1] for more details about East Asian characters. The issue also contains generate_wild_chars.py script that was originally used to create _EAST_ASIAN_WILD_CHARS mapping. An updated version of the script is attached to issue 1096. Big thanks for xieyanbo for the script and the original patch.

Note that Python's unicodedata module is not used here because importing it takes several seconds on Jython.

[1] https://github.com/robotframework/robotframework/issues/604 [2] https://github.com/robotframework/robotframework/issues/1096

Definition at line 33 of file charwidth.py.

Variable Documentation

◆ _COMBINING_CHARS

robotide.lib.robot.utils.charwidth._COMBINING_CHARS
private

Definition at line 53 of file charwidth.py.

◆ _EAST_ASIAN_WILD_CHARS

robotide.lib.robot.utils.charwidth._EAST_ASIAN_WILD_CHARS
private

Definition at line 58 of file charwidth.py.