-
Notifications
You must be signed in to change notification settings - Fork 119
/
xep-0457.xml
162 lines (162 loc) · 6.89 KB
/
xep-0457.xml
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
<?xml version='1.0' encoding='UTF-8'?>
<!DOCTYPE xep SYSTEM 'xep.dtd' [
<!ENTITY % ents SYSTEM 'xep.ent'>
%ents;
]>
<?xml-stylesheet type='text/xsl' href='xep.xsl'?>
<xep>
<header>
<title>Message Fancying</title>
<abstract>This specification defines a Unicode-formatted fancy text syntax for use in instant messages.</abstract>
&LEGALNOTICE;
<number>0457</number>
<status>Active</status>
<type>Humorous</type>
<sig>None</sig>
<approver>Editor</approver>
<dependencies>
<spec>XMPP Core</spec>
<spec>XMPP IM</spec>
</dependencies>
<supersedes>
<spec>XEP-0071</spec>
<spec>XEP-0393</spec>
<spec>XEP-0394</spec>
</supersedes>
<supersededby/>
<shortname>fancying</shortname>
<author>
<firstname>Georg</firstname>
<surname>Lukas</surname>
<email>georg@op-co.de</email>
<jid>georg@yax.im</jid>
</author>
<revision>
<version>1.0.0</version>
<date>2021-04-01</date>
<initials>XEP Editor (jsc)</initials>
<remark>Initial published version.</remark>
</revision>
<revision>
<version>0.0.1</version>
<date>2021-04-01</date>
<initials>gl</initials>
<remark><p>First draft.</p></remark>
</revision>
</header>
<section1 topic='Introduction' anchor='intro'>
<p>
XMPP-based Instant Messages has suffered from a lack of proper message
styling mechanisms. After abandoning &xep0071; for its horrible security
track record, &xep0393; and &xep0394; were proposed as replacements, but
neither was able to gain sufficient traction to become the default styling
mechanism.
</p>
<p>
This specification fills the gap by formally specifying the Unicode-based
formatting that is currently fancied on Social Media and micro-blogging as
an XMPP standard for Instant Messaging. As XMPP is based on UTF-8, messages
formatted with this mechanism are immediately visible on all receiving
clients. Simple third-party tools can be used for writing messages until
this specification is integrated into the IM message input boxes.
</p>
</section1>
<section1 topic='Requirements' anchor='reqs'>
<p>This specification relies on Unicode features introduced in the 3.1
specification. As XMPP implementations are required to support Unicode 3.2
for StringPrep during SASL authentication, no new requirements arise.</p>
</section1>
<section1 topic='Use Cases' anchor='usecases'>
<ul>
<li>
As a user sending an instant message to a friend, I want to be able to
emphasize an important part of my message.
</li>
<li>
As a software developer, I want to be able to send code as pre-formatted,
monospace, block or inline text to another developer.
</li>
<li>
As a user of non-Latin script, I want to be surprised by inconsistent
transitions and missing range checks resulting in characters from random
Unicode planes.
</li>
<li>
As a visually impaired user, I want my screen reader to emit long
sequences of technical names of Unicode special characters to really
convey the point of the intended emphasis, character by character!
</li>
<li>
As a multi-user chat user I want to add context to my reply by quoting an
earlier message in the chat.
</li>
</ul>
</section1>
<section1 topic='Business Rules' anchor='rules'>
<section2 topic='Preformatted Text' anchor='pre'>
<p>To format a string as Preformatted Text, the individual code-points need
to be converted to their integer representation, then increased by
<tt>0x1D62F</tt> (capital letters) or <tt>0x1D629</tt> (lowercase letters)
and then converted back to characters.</p>
<div class='example'>Preformatted text → 𝙿𝚛𝚎𝚏𝚘𝚛𝚖𝚊𝚝𝚝𝚎𝚍 𝚝𝚎𝚡𝚝</div>
</section2>
<section2 topic='Emphasis' anchor='emphasis'>
<p>To format a string with Emphasis, the individual code-points need
to be converted to their integer representation, then increased by
<tt>0x1D3F3</tt> (capital letters) or <tt>0x1D3ED</tt> (lowercase letters)
and then converted back to characters.</p>
<div class='example'>Emphasis → 𝐸𝑚𝑝ℎ𝑎𝑠𝑖𝑠</div>
</section2>
<section2 topic='Strong Emphasis' anchor='strong'>
<p>To format a string with Strong Emphasis, the individual code-points need
to be converted to their integer representation, then increased by
<tt>0x1D3BF</tt> (capital letters) or <tt>0x1D3B9</tt> (lowercase letters)
and then converted back to characters.</p>
<div class='example'>Strong Emphasis → 𝐒𝐭𝐫𝐨𝐧𝐠 𝐄𝐦𝐩𝐡𝐚𝐬𝐢𝐬</div>
</section2>
<section2 topic='Very Strong Emphasis' anchor='strong-emphasis'>
<p>To format a string with Very Very Strong Emphasis, the individual code-points need
to be converted to their integer representation, then increased by
<tt>0x1D427</tt> (capital letters) or <tt>0x1D421</tt> (lowercase letters)
and then converted back to characters.</p>
<div class='example'>Very Strong Emphasis → 𝑽𝒆𝒓𝒚 𝑺𝒕𝒓𝒐𝒏𝒈 𝑬𝒎𝒑𝒉𝒂𝒔𝒊𝒔</div>
</section2>
<section2 topic='Strike through' anchor='strike'>
<p>To format a string as struck through, each code-point needs to be
extended with a U-0336 COMBINING LONG STROKE OVERLAY postfix.</p>
<div class='example'>Strike through → S̶t̶r̶i̶k̶e̶ ̶t̶h̶r̶o̶u̶g̶h̶</div>
</section2>
</section1>
<section1 topic='Implementation Notes' anchor='impl'>
<p>Some clients will use a serif-less font instead of a serif font to display
instant messages, or even allow the user to choose an arbitrary font. The
formatting defined in this document assumes the use of serif fonts, however.
If a formatted text is to be displayed in a context that is not supposed to
render serifs, the displaying implementation MUST add <tt>0x1D4</tt> to the
respective integer representations of the fancy code-points.
</p>
<p>On the wire, the serif representation always MUST be used.</p>
<p>Determining whether a given display font is serif or sans-serif is out of
scope of this specification.</p>
</section1>
<section1 topic='Accessibility Considerations' anchor='access'>
<p>𝞜𝞸𝞰𝞮</p>
</section1>
<section1 topic='Internationalization Considerations' anchor='i18n'>
<p>🇳🇴🇳🇪</p>
</section1>
<section1 topic='Security Considerations' anchor='security'>
<p>The rendering of fonts is a complex task performed in the most inner guts
of the operating system. Over the last decades, various exploits have been
discovered in all major operating systems. Unfortunately, fixing those
issues is far beyond the abilities of a simple XMPP client.</p>
</section1>
<section1 topic='IANA Considerations' anchor='iana'>
<p>
This document requires no interaction with &IANA;.
</p>
</section1>
<section1 topic='XMPP Registrar Considerations' anchor='registrar'>
<p>None.</p>
</section1>
</xep>