StructsΒ§
ConstantsΒ§
- UNICODE_
VERSION - The version of Unicode that this version of unicode-width is based on.
- WIDTH_
LEAVES_ πLEN - WIDTH_
MIDDLE_ πLEN
StaticsΒ§
- EMOJI_
MODIFIER_ πLEAF_ 0 - EMOJI_
MODIFIER_ πLEAF_ 1 - EMOJI_
MODIFIER_ πLEAF_ 2 - EMOJI_
MODIFIER_ πLEAF_ 3 - EMOJI_
MODIFIER_ πLEAF_ 4 - EMOJI_
MODIFIER_ πLEAF_ 5 - EMOJI_
MODIFIER_ πLEAF_ 6 - EMOJI_
MODIFIER_ πLEAF_ 7 - EMOJI_
PRESENTATION_ πLEAVES - Array of 1024-bit bitmaps. Index into the correct bitmap with the 10 LSB of your codepoint to get whether it can start an emoji presentation sequence.
- NON_
TRANSPARENT_ πZERO_ WIDTHS - Sorted list of codepoint ranges (inclusive)
that are zero-width but not
Joining_Type=Transparent
FIXME: can we get better compression? - SOLIDUS_
TRANSPARENT π - Sorted list of codepoint ranges (inclusive) that donβt affect how the combining solidus applies (mostly ccc > 1). FIXME: can we get better compression?
- TEXT_
PRESENTATION_ πLEAF_ 0 - TEXT_
PRESENTATION_ πLEAF_ 1 - TEXT_
PRESENTATION_ πLEAF_ 2 - TEXT_
PRESENTATION_ πLEAF_ 3 - TEXT_
PRESENTATION_ πLEAF_ 4 - TEXT_
PRESENTATION_ πLEAF_ 5 - TEXT_
PRESENTATION_ πLEAF_ 6 - TEXT_
PRESENTATION_ πLEAF_ 7 - TEXT_
PRESENTATION_ πLEAF_ 8 - TEXT_
PRESENTATION_ πLEAF_ 9 - WIDTH_
LEAVES π - Autogenerated. 180 sub-table(s). Consult
lookup_width
for layout info. - WIDTH_
MIDDLE π - Autogenerated. 4 sub-table(s). Consult
lookup_width
for layout info. - WIDTH_
ROOT π - Autogenerated. 1 sub-table(s). Consult
lookup_width
for layout info.) - WIDTH_
ROOT_ πCJK - Autogenerated. 17 sub-table(s). Consult
lookup_width
for layout info.)
FunctionsΒ§
- is_
emoji_ modifier_ base - Returns
true
ifc
is anEmoji_Modifier_Base
. - is_
ligature_ πtransparent - Whether this character is a default-ignorable combining mark or ZWJ. These characters wonβt interrupt non-Arabic ligatures.
- is_
solidus_ πtransparent - Whether this character is transparent wrt the effect of U+0338 COMBINING LONG SOLIDUS OVERLAY on its base character.
- is_
transparent_ πzero_ width - Whether this character is a zero-width character with
Joining_Type=Transparent
. Used by the Alef-Lamed ligatures. See alsois_ligature_transparent
, a near-subset of this (only ZWJ is excepted) which is transparent for non-Arabic ligatures. - lookup_
width π - Returns the UAX #11 based width of
c
by consulting a multi-level lookup table. - lookup_
width_ πcjk - Returns the UAX #11 based width of
c
by consulting a multi-level lookup table. - single_
char_ width - Returns the UAX #11 based width of
c
, orNone
ifc
is a control character. Ambiguous width characters are treated as narrow. - single_
char_ width_ cjk - Returns the UAX #11 based width of
c
, orNone
ifc
is a control character. Ambiguous width characters are treated as wide. - starts_
emoji_ presentation_ seq - Whether this character forms an [emoji presentation sequence]
(https://www.unicode.org/reports/tr51/#def_emoji_presentation_sequence)
when followed by
'\u{FEOF}'
. Emoji presentation sequences are considered to have width 2. - starts_
non_ ideographic_ text_ presentation_ seq - Returns
true
ifc
has default emoji presentation, but forms a [text presentation sequence] (https://www.unicode.org/reports/tr51/#def_text_presentation_sequence) when followed by'\u{FEOE}'
, and is not ideographic. Such sequences are considered to have width 1. - str_
width - str_
width_ cjk - width_
in_ πstr - Returns the UAX #11 based width of
c
. Ambiguous width characters are treated as narrow. - width_
in_ πstr_ cjk - Returns the UAX #11 based width of
c
. Ambiguous width characters are treated as wide.