<?xml version="1.0" encoding="utf-8"?>
<!---
TLFSample09
@see http://w3.kcua.ac.jp/~fujiwara/jis2000/jis2004/jisx0213-2004-surro.html
-->
<s:Application
xmlns:fx="http://ns.adobe.com/mxml/2009"
xmlns:s="library://ns.adobe.com/flex/spark"
xmlns:mx="library://ns.adobe.com/flex/mx"
viewSourceURL="srcview/index.html">
<fx:Style>
@namespace s "library://ns.adobe.com/flex/spark";
@namespace mx "library://ns.adobe.com/flex/mx";
s|Panel {
font-size : 20;
}
s|TextArea {
font-size : 30;
}
mx|TextArea {
font-size : 30;
}
</fx:Style>
<fx:Script>
<![CDATA[
import flashx.textLayout.utils.CharacterUtil;
private function init():void {
const SURROGATE_PAIRS:String = "𠀋𡈽𡌛𡑮𡢽𠮟𡚴𡸴𣇄𣗄𣜿𣝣𣳾𤟱𥒎𥔎𥝱𥧄𥶡𦫿𦹀𧃴𧚄𨉷𨏍𪆐𠂉𠂢𠂤𠆢𠈓𠌫𠎁𠍱𠏹𠑊𠔉𠗖𠘨𠝏𠠇𠠺𠢹𠥼𠦝𠫓𠬝𠵅𠷡𠺕𠹭𠹤𠽟𡈁𡉕𡉻𡉴𡋤𡋗𡋽𡌶𡍄𡏄𡑭𡗗𦰩𡙇𡜆𡝂𡧃𡱖𡴭𡵅𡵸𡵢𡶡𡶜𡶒𡶷𡷠𡸳𡼞𡽶𡿺𢅻𢌞𢎭𢛳𢡛𢢫𢦏𢪸𢭏𢭐𢭆𢰝𢮦𢰤𢷡𣇃𣇵𣆶𣍲𣏓𣏒𣏐𣏤𣏕𣏚𣏟𣑊𣑑𣑋𣑥𣓤𣕚𣖔𣘹𣙇𣘸𣘺𣜜𣜌𣝤𣟿𣟧𣠤𣠽𣪘𣱿𣴀𣵀𣷺𣷹𣷓𣽾𤂖𤄃𤇆𤇾𤎼𤘩𤚥𤢖𤩍𤭖𤭯𤰖𤴔𤸎𤸷𤹪𤺋𥁊𥁕𥄢𥆩𥇥𥇍𥈞𥉌𥐮𥓙𥖧𥞩𥞴𥧔𥫤𥫣𥫱𥮲𥱋𥱤𥸮𥹖𥹥𥹢𥻘𥻂𥻨𥼣𥽜𥿠𥿔𦀌𥿻𦀗𦁠𦃭𦉰𦊆𦍌𣴎𦐂𦙾𦚰𦜝𦣝𦣪𦥑𦥯𦧝𦨞𦩘𦪌𦪷𦱳𦳝𦹥𦾔𦿸𦿶𦿷𧄍𧄹𧏛𧏚𧏾𧐐𧑉𧘕𧘔𧘱𧚓𧜎𧜣𧝒𧦅𧪄𧮳𧮾𧯇𧲸𧶠𧸐𧾷𨂊𨂻𨊂𨋳𨐌𨑕𨕫𨗈𨗉𨛗𨛺𨥉𨥆𨥫𨦇𨦈𨦺𨦻𨨞𨨩𨩱𨩃𨪙𨫍𨫤𨫝𨯁𨯯𨴐𨵱𨷻𨸟𨸶𨺉𨻫𨼲𨿸𩊠𩊱𩒐𩗏𩙿𩛰𩜙𩝐𩣆𩩲𩷛𩸽𩸕𩺊𩹉𩻄𩻩𩻛𩿎𪀯𪀚𪃹𪂂𢈘𪎌𪐷𪗱𪘂𪘚𪚲";
ta1.text = SURROGATE_PAIRS;
ta2.text = SURROGATE_PAIRS;
trace( hasSurrogatePair( SURROGATE_PAIRS.substr(0, 2) ) ); trace( hasSurrogatePair( SURROGATE_PAIRS.substr(1, 2) ) ); trace( hasSurrogatePair( SURROGATE_PAIRS.substr(2, 2) ) ); trace( hasSurrogatePair( SURROGATE_PAIRS.substr(3, 2) ) ); }
private function hasSurrogatePair(s:String):Boolean {
return CharacterUtil.isHighSurrogate( s.charCodeAt(0) ) &&
CharacterUtil.isLowSurrogate( s.charCodeAt(1) );
}
]]>
</fx:Script>
<s:applicationComplete>
<![CDATA[
init();
]]>
</s:applicationComplete>
<s:layout>
<s:HorizontalLayout paddingLeft="10" paddingRight="10" paddingBottom="10" paddingTop="10" />
</s:layout>
<s:Panel title="SPARK TextArea (TLF)" width="100%" height="100%">
<s:TextArea id="ta1" width="100%" height="100%" />
</s:Panel>
<s:Panel title="MX TextArea" width="100%" height="100%">
<mx:TextArea id="ta2" width="100%" height="100%" />
</s:Panel>
</s:Application>