bidi overrides

bidi

[90] bidi左横書き右横書きの混合や、 上縦書き下縦書きの混合です。

仕様書

日本語

[55] 自動車側面の文字の向きは - トラパシ鉄道模型掲示板5, , https://web.archive.org/web/20160817112220/http://b5.spline.tv/tprr5/?message=101

同じ右横書き中に左横書きが混在する bidi の事例あり。

[64] 「爪哇」第162号 現地邦人企業商店広告多数入 ジャワスラバヤ市・爪哇日報社 昭和8年 : 古書 古群洞 kogundou@jcom.zaq.ne.jp, kogundou, https://kogundou.exblog.jp/240733547/

南洋倉庫株式会社広告: 日本語会社名、 英語会社名は左横書き。 その次の日本語文は右横書き。 その次の日本語詳細事項は右上縦書き

[65] 大満洲國詳図 二百万分一 9色刷 訂正十版 小林又七編纂 兵用図書 昭和8年 : 古書 古群洞 kogundou@jcom.zaq.ne.jp, kogundou, https://kogundou.exblog.jp/240710607/

題字は右横書き、その直下の縮尺を表す直線は左から右へ進み、添えられているのは左横書き算用数字

凡例は右側に記号、左側に右横書きの説明文。 標高の色の意味を表す「高度表」は左側に例示、右側に数値 (グラフの縦軸に当たる部分が左側例示の右辺、その右側に算用数字左横書きのメートル数)。

地名は右横書き上縦書き斜め書きもあるが少ない。 右横書き上ルビ下ルビ右横書き。 「HAR-BIN」 だけラテン文字併記で左横書き

[66] 満蒙紹介(満蒙略図/大連市パノラマ写真/大連港図/他折込附図附表多)非売 大正10年 : 古書 古群洞 kogundou@jcom.zaq.ne.jp, kogundou, https://kogundou.exblog.jp/240629341/

全体的に右横書き右上縦書き

鉄道車両の紹介ページだけ左横書き日本語で、 左横書き算用数字西暦年や記号とともに、 車両の変遷が左から右へと新しく並べられている。

無題 Name 名無し 18/01/07(日)18:33:53 No.1233602

戦中の日本の広告なんですが、「敵機」の名前が左書き表記で「大日本飛行協会」は右書き

[80] 戦前~戦後のレトロ写真さんはTwitterを使っています 「1935年(昭和10年)の週刊朝日の新漫画派集団特集より、「お前100まで」という漫画です(再掲)。日向ぼっこしたい季節になってきましたね。 https://t.co/0sGBvlEFJM」 / Twitter, , https://twitter.com/oldpicture1900/status/1452800949483814914/photo/1

作品名見出し (手書き) 「お前100まで

(作品本体は漫画でコマは右上縦書き (コマ番号付き)、 吹き出し内の台詞は右上縦書き近代日本語平仮名漢字混じり (歴史的仮名遣, 手書き))

[93] >>91 新聞広告 電話番号 (手書き) 「電話京橋(56)六〇一二・三七三六

京橋日本国東京府京橋区にあった京橋電話局。 「56」はその市内局番で五十六。 欧州数字市内局番左横書きで、 漢数字加入者番号右横書き。 当時の電話帳に 56-6012 が掲載されていて >>92 この読み方で正しいことが確かめられる。

[94] 戦前~戦後のレトロ写真さんはTwitterを使っています: 「昭和9年(1934年)の吉本興業の広告。この頃はエンタツアチャコの大活躍もあり、まさに同社戦前の黄金期で、所属していた芸人さんは1300人にも上ったそうです。 女性芸人も多く、そんな彼女たちのために吉本は女子寮を用意していたそうです(2枚目 昭和11年)。 https://t.co/c1oxDW3Sn1」 / Twitter, 午後4:19 · 2022年8月21日 , https://twitter.com/oldpicture1900/status/1561251738581028865/photo/1

広告。基本は右上縦書き右横書き上縦書きから右横書きへのL字書きが混じっている。

一番目立つ見出しだけなぜか左横書き

[97] >>99 >>95 御神体の船 (の模型) に書かれた進行方向書き(?)の右横書き側 「38につぽんぐんかん」。

38」は左横書き

[102] ktkk009_0001.pdf, , https://repository.kulib.kyoto-u.ac.jp/dspace/bitstream/2433/181618/1/ktkk009_0001.pdf#page=19

右上縦書き日本語論文図題 (明朝体) 「(Fig. 3) 第三圖

[103] (1) 治田 洗礫さんはTwitterを使っています: 「@trainsgo そうですね! 当時も、数字・数式・英単語などを混ぜ書きする必要があるときは左書きだったようですが、和文も左書きなのに地図の日本語地名だけ右書きというのは珍しいかもですね。ややこしいです😄」 / Twitter, , https://twitter.com/Harita_arayshi/status/1638074182696325121

中文

左下広告のパッケージの絵。中文右横書き英語左横書きごとに方向が違う。

[89] 英領香港時代の官報 (をもとにデザインされた画像) >>109。 全体として英文ながら、 題名と日付に中文が併記されている。 英文左上横書き西暦年 + グレゴリオ暦中文右横書き西暦年 + グレゴリオ暦 (1月も「正月」表記) と干支年 + 農暦の組み合わせ。 (英文日付にだけ「VICTORIA,」とあるが、年数がないのでビクトリア女王ではなく英領香港首都ビクトリアハーバーの意だろう。)

越南語

[88] 越南民主共和紙幣, , http://www.for.aichi-pu.ac.jp/museum/l2yfol/lz2k01.html

漢字表記は右横書きラテン文字表記 (国語) や欧州数字左横書き

鏡像化

[57] 左横書き右横書きで、 グリフが変化する文字もあります。 鏡像化

複数行に分断された双方向性

[81] 方向性の異なる句が含まれ、その部分で改行が発生する時、 文字の順序と行の順序が完全に一致する㋐:

abcdefgh DCBA
HGFE abcdefgh

... タイプと、文字の順序と行の順序が逆転する㋑:

abcdefgh HGFE
DCBA abcdefgh

... タイプがあり得ます。

[82] 中東方面では㋐タイプが使われているようです。Webブラウザーもそのように実装されています。

[79] Mongul-un sonin bicig(1909-1918)という モンゴル語定期刊行物 -モンゴル語定期刊行物史における位置づけと所蔵状況1-, フフバートル, , https://swu.repo.nii.ac.jp/?action=pages_view_main&active_action=repository_view_main_item_detail&item_id=5875&item_no=1&page_id=30&block_id=97

しかし,現在確認できるところでは,
新聞のNo.16 (1913.5.27) には右から左へ「報日
賓爾哈」と書かれた中国語の表記が現れ, No.27 
(1913.8.22) も書き順は右から左へであったが,内
容が「報日文蒙賓爾哈」となっていた。その下
に中国語で「哈爾賓蒙文報」と記され, 漢字表記は
左から右へと変わっている。

[83] 近代日本語ではこのような事例は㋐型も㋑型も未発見です。 近代日本語で右書き、左書きが混在することがあっても、 そこそこ長く途中で改行可能な文字列が混在する事例があまりありません。 (あるとしたら右上横書きの日本語文中に複数語連続した英語か何かが引かれている感じのものでしょうか。)

ルビ

書字方向混在とルビ

楽譜

右横書き楽譜

MIME charset

RFC 1555, RFC 1556

ECMA モデル

ECMA Technical Report TR/53

ISIRI 3342

ISIRI 3342

bidi 文字

[60] JIS X 0221-1:2001 附属書F (参考) 代替書式文字 F.1.3

[68] Bidi_Control

Unicode bidi アルゴリズム

[58] Unicode Consortium仕様書 UAX #9bidi 処理のアルゴリズムが規定されています。

[69] bidi overrides, bidi embeddings, bidi isolates は、 paired stateful controls です。 >>70

[71] bidi overrides, bidi embeddings, bidi isolates は、 Default_Ignorable_Code_Point です。 未対応の場合でも、 可視的なグリフを表示するべき (should) ではありません。 >>70

Unicode ルビ文字との関係

interlinear annotation

自動決定の失敗事例

[104] イスラーム的箴言さんはTwitterを使っています: 「قال ﷺ: "إذا نسي أحدكم فأكل أو شرب، فليتم صومه. فإنما أطعمه الله وسقاه." متفق عليه⁩ ⁧預言者は言った 「(斎戒しているのを)忘れて、食べたり飲んだりしてしまっても、斎戒を完遂しなさい。アッラーがその者に食べさせ、飲ませて下さったのだから。」 二大真正集の伝承 #ラマダーン」 / Twitter, , https://twitter.com/apislamjp/status/1643846001554513921

歴史

[105] Microsoft Word - bidi5.doc - Davis-Bidi-draft5-1990.pdf, , https://www.unicode.org/L2/Historical/Davis-Bidi-draft5-1990.pdf

bidi 検査

[46] Stringprep には bidi 文字の検査があります。

[45] IDNA2008 と一部の PRECIS プロファイルでは Bidi Rule が使われます。

Bidi Rule 参照。

bidi 編集

[106] Yudit HOWTO, https://www.yudit.org/en/howto/bidi/

The current Yudit Bidi implementation is trying to reverse an 
irreversible algorithm when resolving explicit levels.
This is text embedded within LRE-PDF, RLE-PDF, LRO-PDF and RLO-PDF
pairs. The algorithm can re-create the text from the
view. This also means that superfluous embedding tags
will be dropped when saving alien (non-Yudit) texts.
These tags will be dropped from portions of the document
that were at least once viewed. I will not give you an
exhaustive list of such cases.

1. While alien Unicode stream

    <RLO>text1<PDF>text2<RLO>text3<RLO>

 will be saved the same way,

    <RLO>text1<PDF><RLO>text2<PDF>

 will be saved as

    <RLO>text1text2<PDF>

 as they are equivalent, and the latter is shorter.

2. Empty pairs of

    <RLO><PDF>

 or

    <LRO><RLE><PDF><PDF>

 will be deleted from the text, as they have no effect.

3. Spurious 

    <PDF>

 with no matching embedding marks will be deleted 
 from the document.

4. To keep the text editable, LRM and RLM zero with marks are
 displayed in the editing window, but they will not appear when
 printing or when used in non-editable places, like labels.

CSS における bidi

[19] CSS では 'unicode-bidi''direction' の2つの特性bidi に関わります。 Unicodebidi に関する文字と合わせて、 Unicodebidi アルゴリズムに従ってレンダリングされます。

[54] CSS Writing Modes Level 4, , https://drafts.csswg.org/css-writing-modes/#text-direction

HTML における bidi

[75] RFC 2070, SI 4281

双方向アルゴリズム書式付け文字

[21] HTML でいう双方向アルゴリズム書式付け文字 (bidirectional-algorithm formatting characters) は、 UnicodeBidi_Char のうち Implicit Directional Formatting Characters 3文字を除いた9文字とされています >>11。いずれも Unicodebidi アルゴリズムで動作が定義されている文字です。

双方向アルゴリズム書式付け文字範囲

[22] 双方向アルゴリズム書式付け文字範囲 (bidirectional-algorithm formatting character ranges) とは、次の各範囲です >>11

著者に対する要件

[27] 双方向アルゴリズム書式付け文字範囲においては、双方向アルゴリズム書式付け文字は次のように対になっていなければなりません >>11

[34] つまり CSS によって要素ごとに適用される規定 (>>18) と矛盾する形でこれらの文字を使うとレンダリング結果が予測しづらくなってしまいますから、 要素の入れ子関係とこれらの文字の入れ子関係が整合的でなければならないのです。

[31] しかしこれらの文字を直接使うよりは、 dir 属性bdi 要素bdo 要素を使うことが勧められています (encouraged) >>11

[39] とはいえ属性値では文字を使うしかありません。

処理モデル

[13] HTMLレンダリングにおける bidi の扱いに関しては、 'unicode-bidi', 'direction', 'content' といった CSS特性を介して Unicodebidi アルゴリズムに従うものとして定義されています >>11

[14] 利用者エージェントは、

... のいずれかの形で実装することを求められています >>11

[18] HTML の中では、 dir 属性bdi 要素bdo 要素br 要素pre 要素textarea 要素wbr 要素について bidi に関わるレンダリングの規定があります。

[35] CSS 以外でレンダリングされる場面についても規定があります。

歴史

[59] JIS X 0211 1. 6.1.1 8.3.138 SRS F.6 F.7

[1] Authoring HTML for Middle Eastern Content http://www.microsoft.com/globaldev/handson/dev/Mideast.mspx (名無しさん [sage])

[2] Exploring Better Source Editing for Bidirectional XHTML and XML http://www.sw.it.aoyama.ac.jp/2005/pub/IUC28-bidi/IUC28.html (名無しさん [sage])

[3] Hebrew characters in XML and XHTML http://www.nirdagan.com/hebrew/characters/#test (名無しさん)

[4] Authoring HTML for Middle Eastern Content http://www.microsoft.com/globaldev/handson/dev/Mideast.mspx (名無しさん 2006-12-20 23:31:24 +00:00)

[5] Internationalization Best Practices: Handling Right-to-left Scripts in XHTML and HTML Content -- (Editors' copy) ( 版) http://www.w3.org/International/geo/html-tech/tech-bidi.html

[6] Revision of UBA for improved display of URL/IRIs - Google Docs ( ( 版)) https://docs.google.com/document/d/1c8-svx7og0qBUfGBobw7LYfOcNeDVPYbNVMNpSqYCFo/edit?hl=en (cache http://suika.fam.cx/gate/2007/schema/schema/6ab74bc21022f5cc9bfd95a62c76046a/prop.html

[7] Web Applications 1.0 r5754 Define conformance criteria around bidi formatting characters ( ( 版)) http://html5.org/tools/web-apps-tracker?from=5753&to=5754

[8] Web Applications 1.0 r7783 Update HTML in preparation for Unicode 6.3 ( ( 版)) http://html5.org/tools/web-apps-tracker?from=7782&to=7783

[9] Widget Interface ( ( 版)) http://www.w3.org/TR/widgets-apis/#getting-localizable-strings

[10] Additional Requirements for Bidi in HTML ( 版) http://www.w3.org/TR/2010/WD-html-bidi-20100304/

[12] IRC logs: freenode / #whatwg / 20101111 ( ( 版)) http://krijnhoetmer.nl/irc-logs/whatwg/20101111#l-254

[40] Notifications API Standard ( ( 版)) http://notifications.spec.whatwg.org/#direction-0

[41] Additional Requirements for Bidi in HTML & CSS ( ( 版)) http://www.w3.org/TR/2015/NOTE-html-bidi-20150721/

[42] IRIs and bidirectional formatting characters (Anne van Kesteren 著, 版) https://lists.w3.org/Archives/Public/www-international/2015JulSep/0126.html

[43] Add a section on rendering URLs with some advice around bidirectional… · whatwg/url@d1152b9 ( 版) https://github.com/whatwg/url/commit/d1152b94a16ae91e1f72d128fd5ef589635f0e7c

[44] Tweak the bidirectional rendering note and add a dependency on UTS36.… · whatwg/url@e67f9dd ( 版) https://github.com/whatwg/url/commit/e67f9dd7a1106d867862d3b5d9f044388f84909e

[47] CSV on the Web: Use Cases and Requirements ( 版) https://www.w3.org/TR/2016/NOTE-csvw-ucr-20160225/#UC-SupportingRightToLeftDirectionality

[48] Remove document conformance requirements for bidi characters (zcorpan著, ) https://github.com/whatwg/html/commit/fe9dce390338a7f8941ba504d5aab7d56f2099f4

[49] Use of ZWJ · Issue #2 · w3c/i18n-discuss () https://github.com/w3c/i18n-discuss/issues/2

[50] XLIFF Version 2.0 () http://docs.oasis-open.org/xliff/xliff-core/v2.0/os/xliff-core-v2.0-os.html#d0e9515

[51] Micropub () https://micropub.net/draft/#h-bidirectional-text

[52] Activity Streams 2.0 () https://w3c.github.io/activitystreams/core/#biditext

[53] Restructure URL rendering section and add additional guidance (estark37著, ) https://github.com/whatwg/url/commit/8809598ddfd1d935432c8a0cad53f13d70e24bc6

[61] UAX #44: Unicode Character Database (, ) https://www.unicode.org/reports/tr44/#BidiTest_txt

[62] WebVTT: The Web Video Text Tracks Format, , https://w3c.github.io/webvtt/#webvtt-cue-text-alignment

[63] 20150322「第2回アラビア語入門講座@東京」を終えての画像 () https://ameblo.jp/a-cstokyo/image-12005152382-13253675869.html

[67] Fribidi - () http://fribidi.org/

GNU FriBidi is an implementation of the Unicode Bidirectional Algorithm (bidi).

[72] Browsers ignoring Bidi Embedding Controls is probably not web-compatible · Issue #20 · w3c/unicode-xml · GitHub, https://github.com/w3c/unicode-xml/issues/20

[73] 日本の心・さいき(佐伯) : アラビア語・・・ () http://blog.livedoor.jp/mt221414/archives/52184053.html

[74] 単位をたずねて三千粁?~青梅編 - ことばマガジン:朝日新聞デジタル (The Asahi Shimbun Company, ) http://www.asahi.com/special/kotoba/archive2015/photo/photo.html%3Fphoto=%252FS2007%252Fupload%252F2012110500008_18.JPG.html

[76] Middle Eastern Language Issues, , https://web.archive.org/web/20010413175141/http://www.microsoft.com/globaldev/mideast/meissues.asp

[86] Security advisory for rustc (CVE-2021-42574) | Rust Blog (, ) https://blog.rust-lang.org/2021/11/01/cve-2021-42574.html

[87] Warning about bidirectional Unicode text | GitHub Changelog () https://github.blog/changelog/2021-10-31-warning-about-bidirectional-unicode-text/

[101] GitHub - fribidi/fribidi: GNU FriBidi, https://github.com/fribidi/fribidi