Thuộc tính phản chiếu
Các ký tự mà glyph của chúng nên được phản chiếu ngang trong ngữ cảnh RTL. Ví dụ: ( → ), [ → ], { → }, « → ».
What Is the Bidi_Mirrored Property?
The Bidi_Mirrored property is a Boolean property that marks characters whose glyph should be horizontally reflected when appearing in a right-to-left (RTL) context. In an RTL paragraph, an opening parenthesis ( should visually appear as ) and vice versa, because the semantic role (open vs. close) is independent of whether the text flows left-to-right or right-to-left.
The Unicode Bidirectional Algorithm (UAX #9) applies mirroring automatically during text rendering for characters with Bidi_Mirrored=Yes. A rendering engine does not swap code points; instead it selects the mirrored glyph from the font, or uses the Bidi_Mirroring_Glyph property to find the corresponding code point when a dedicated glyph is not available.
Characters with Bidi_Mirrored=Yes
The most familiar mirrored characters are paired delimiters, but the property covers a wider range:
import unicodedata
# Check Bidi_Mirrored flag (1 = mirrored, 0 = not mirrored)
candidates = [
("(", "LEFT PARENTHESIS"),
(")", "RIGHT PARENTHESIS"),
("[", "LEFT SQUARE BRACKET"),
("{", "LEFT CURLY BRACKET"),
("<", "LESS-THAN SIGN"),
(">", "GREATER-THAN SIGN"),
("⟨", "MATHEMATICAL LEFT ANGLE BRACKET"),
("∈", "ELEMENT OF"),
("A", "LATIN CAPITAL LETTER A"),
]
for char, name in candidates:
m = unicodedata.mirrored(char)
print(f" {char} mirrored={m} {name}")
# ( mirrored=1 LEFT PARENTHESIS
# ) mirrored=1 RIGHT PARENTHESIS
# [ mirrored=1 LEFT SQUARE BRACKET
# { mirrored=1 LEFT CURLY BRACKET
# < mirrored=1 LESS-THAN SIGN
# > mirrored=1 GREATER-THAN SIGN
# ⟨ mirrored=1 MATHEMATICAL LEFT ANGLE BRACKET
# ∈ mirrored=1 ELEMENT OF
# A mirrored=0 LATIN CAPITAL LETTER A
Bidi_Mirroring_Glyph vs. Bidi_Mirrored
Bidi_Mirrored=Yes says this character needs mirroring. The companion Bidi_Mirroring_Glyph property gives the code point of the character whose glyph should be used as the mirrored form—for example, ( → ). For mathematical symbols like ∈ (ELEMENT OF), the mirroring glyph is ∋ (CONTAINS AS MEMBER). If a font contains both glyphs, the renderer selects the appropriate one automatically.
When no mirroring glyph exists (the value is <none> in the data), the renderer must synthesize a mirrored glyph, typically by applying a horizontal flip transformation.
Quick Facts
| Property | Value |
|---|---|
| Unicode property name | Bidi_Mirrored |
| Short alias | Bidi_M |
| Type | Boolean |
| Python function | unicodedata.mirrored(char) → 1 or 0 |
| Characters with value Yes (Unicode 15.1) | ~570 |
| Companion property | Bidi_Mirroring_Glyph |
| Spec reference | Unicode Standard Annex #9 (UAX #9) |
Thuật ngữ liên quan
Thêm trong Thuộc tính
Tên thay thế cho các ký tự, vì tên Unicode không thể …
Các ký tự không có hiệu ứng hiển thị và có thể …
Ký tự mà người dùng cảm nhận được — điều cảm giác …
Phân loại mọi điểm mã vào một trong 30 danh mục (Lu, …
Thuộc tính xác định cách một ký tự hoạt động trong văn …
Các ký tự dùng để tổ chức và làm rõ ngôn ngữ …
Unicode property (UAX#11) classifying characters as Narrow, Wide, Fullwidth, Halfwidth, Ambiguous, or …
Cách diễn giải số của một ký tự, nếu có: giá trị …
Hệ thống chữ viết mà một ký tự thuộc về (ví dụ: …
Unicode property controlling how Arabic and Syriac characters connect to adjacent characters. …