jQuery键盘:如何制作上标字符?
我有一个朋友一直在使用jQuery键盘插件。他现在需要几个字符的上标(和/或下标)。有人知道如何在UTF-8中制作或查找(复制/粘贴)以下上标字符吗 所需上标字符:nd th rd[]() nd、th、st、rd代表22、7、1、3(但上标) [……()也需要 jQuery键盘插件目前正与一些额外的BBCode功能一起使用 ]) 我正在考虑使用BBCode,但我更喜欢用UTF-8写出字符。我找到了下面的列表,但它不包括上标“t”或“h”jQuery键盘:如何制作上标字符?,jquery,utf-8,character-encoding,bbcode,keypad,Jquery,Utf 8,Character Encoding,Bbcode,Keypad,我有一个朋友一直在使用jQuery键盘插件。他现在需要几个字符的上标(和/或下标)。有人知道如何在UTF-8中制作或查找(复制/粘贴)以下上标字符吗 所需上标字符:nd th rd[]() nd、th、st、rd代表22、7、1、3(但上标) [……()也需要 jQuery键盘插件目前正与一些额外的BBCode功能一起使用 ]) 我正在考虑使用BBCode,但我更喜欢用UTF-8写出字符。我找到了下面的列表,但它不包括上标“t”或“h” 有人知道如何在UTF-8中创建或查找(复制/粘贴)所需
有人知道如何在UTF-8中创建或查找(复制/粘贴)所需的上标字符吗?某些字符的上标和下标在U+2070–U+209C Unicode范围内:
- 上标:
0456789+-=()在
- 下标:
0123456789+-=aeoxhklmnpst
- U+2C7C处的下标
j
- U+1D62–U+1D65处的下标
iruv
- 上标
您已经找到123
U+1D43–U+1D5B处的abdegkmoptuv
U+1D9C时c
在U+1DA0处f
在U+1DBB处z
位于U+02B0–U+02B8hjrwy
位于U+02E1–U+02E3lsx
- 上标:所有数字、所有小写ASCII字母和一些其他符号
- 下标:所有数字、字母
,以及一些其他符号AEHIJKLMPRSTUVX
- 以下是我最终在PHP中想到的。然而,“nd”的基线并不在一个水平上
// Testing: Superscript characters needed: nd th st rd [ ] ( )
// nd ⁿᵈ
echo "nd: ".html_entity_decode('ⁿ', ENT_COMPAT, 'UTF-8').html_entity_decode('ᵈ', ENT_COMPAT, 'UTF-8')."<br>";
// th ᵗʰ (t-x1D57) ᵗʰ (H-x2b0)
echo "th: ".html_entity_decode('ᵗ', ENT_COMPAT, 'UTF-8').html_entity_decode('ʰ', ENT_COMPAT, 'UTF-8')."<br>";
// st ˢᵗ
echo "st: ".html_entity_decode('ˢ', ENT_COMPAT, 'UTF-8').html_entity_decode('ᵗ', ENT_COMPAT, 'UTF-8')."<br>";
// rd ʳᵈ
echo "rd: ".html_entity_decode('ʳ', ENT_COMPAT, 'UTF-8').html_entity_decode('ᵈ', ENT_COMPAT, 'UTF-8')."<br>";
echo "<br><br><br>";
echo "n-".html_entity_decode('ⁿ', ENT_COMPAT, 'UTF-8');
echo "d-".html_entity_decode('ᵈ', ENT_COMPAT, 'UTF-8');
echo "h-".html_entity_decode('ʰ', ENT_COMPAT, 'UTF-8');
echo "r-".html_entity_decode('ʳ', ENT_COMPAT, 'UTF-8');
echo "s-".html_entity_decode('ˢ', ENT_COMPAT, 'UTF-8');
echo "t-".html_entity_decode('ᵗ', ENT_COMPAT, 'UTF-8');
//测试:需要上标字符:nd th rd[]()
//钕ⁿᵈ
echo“nd:.html_entity_decode('ⁿ;',ENT_COMPAT,'UTF-8')。html_entity_decode('ᵈ;',ENT#u COMPAT,'UTF-8')。“
”;
//thᵗʰ(t-x1D57)ᵗʰ(H-x2b0)
echo“th:.html_entity_decode('ᵗ;',ENT#u COMPAT,'UTF-8')。html_entity_decode('ʰ;',ENT#u COMPAT,'UTF-8')。
;
//圣卢西亚ᵗ
echo“st:.html_entity_decode('ˢ;',ENT_COMPAT,'UTF-8')。html_entity_decode('ᵗ;',ENT#u COMPAT,'UTF-8')。“
”;
//rdʳᵈ
echo“rd:.html_entity_decode('ʳ;',ENT_COMPAT,'UTF-8')。html_entity_decode('ᵈ;',ENT_COMPAT,'UTF-8')。
“;
回声“
”;
echo“n-”.html_entity_decode('ⁿ;',ENT#u COMPAT,'UTF-8');
echo“d-”.html_entity_decode(“ᵈ;”,ENT#u COMPAT,'UTF-8');
echo“h-”.html_entity_decode('ʰ;',ENT#u COMPAT,'UTF-8');
echo“r-”.html_entity_decode('ʳ;'),ENT_COMPAT,'UTF-8');
echo“s-”.html_entity_decode('ˢ;',ENT#u COMPAT,'UTF-8');
echo“t-”.html_entity_decode(“ᵗ;”,ENT#u COMPAT,'UTF-8');
是否使用jQuery键盘?@acbabis-如果要将其添加到键盘中,必须使用|分隔符字符。我已经设法使用$.keypad.addKeyDef()添加了一些BBCode逻辑,好吧,那么您关心的只是使代码更干净?不,这与代码无关。修订问题:有人知道如何在UTF-8中制作或查找(复制/粘贴)以下上标字符吗?需要上标字符:nd th rd[])我试图用unicode字符x207F(n)和x1D48(d)创建上标“nd”,但由于字母类型不同,结果没有相同的基线。有什么建议吗?你可以试着找另一种字体。也许事实上它们是排成一行的,但是你看到的两个字母实际上是来自不同的字体,一个只支持一个字符,另一个是第二个?
// Testing: Superscript characters needed: nd th st rd [ ] ( )
// nd ⁿᵈ
echo "nd: ".html_entity_decode('ⁿ', ENT_COMPAT, 'UTF-8').html_entity_decode('ᵈ', ENT_COMPAT, 'UTF-8')."<br>";
// th ᵗʰ (t-x1D57) ᵗʰ (H-x2b0)
echo "th: ".html_entity_decode('ᵗ', ENT_COMPAT, 'UTF-8').html_entity_decode('ʰ', ENT_COMPAT, 'UTF-8')."<br>";
// st ˢᵗ
echo "st: ".html_entity_decode('ˢ', ENT_COMPAT, 'UTF-8').html_entity_decode('ᵗ', ENT_COMPAT, 'UTF-8')."<br>";
// rd ʳᵈ
echo "rd: ".html_entity_decode('ʳ', ENT_COMPAT, 'UTF-8').html_entity_decode('ᵈ', ENT_COMPAT, 'UTF-8')."<br>";
echo "<br><br><br>";
echo "n-".html_entity_decode('ⁿ', ENT_COMPAT, 'UTF-8');
echo "d-".html_entity_decode('ᵈ', ENT_COMPAT, 'UTF-8');
echo "h-".html_entity_decode('ʰ', ENT_COMPAT, 'UTF-8');
echo "r-".html_entity_decode('ʳ', ENT_COMPAT, 'UTF-8');
echo "s-".html_entity_decode('ˢ', ENT_COMPAT, 'UTF-8');
echo "t-".html_entity_decode('ᵗ', ENT_COMPAT, 'UTF-8');