hedgewars/uUtils.pas
changeset 4737 ca03ce7e0c3f
parent 4665 fa7ad5f3725f
child 4900 8ad0e23e6d63
equal deleted inserted replaced
4735:08749f5127b9 4737:ca03ce7e0c3f
   252 {$ENDIF}
   252 {$ENDIF}
   253     exit(font);
   253     exit(font);
   254 
   254 
   255 l:= Utf8ToUnicode(@tmpstr, Str2PChar(s), length(s))-1;
   255 l:= Utf8ToUnicode(@tmpstr, Str2PChar(s), length(s))-1;
   256 i:= 0;
   256 i:= 0;
       
   257 
   257 while i < l do
   258 while i < l do
   258     begin
   259     begin
   259     u:= tmpstr[i];
   260     u:= tmpstr[i];
   260     if (#$2E80  <= u) and  (
   261     if (#$1100  <= u) and  (
   261                            (u <= #$2FDF )  or // CJK Radicals Supplement / Kangxi Radicals
   262                            (u <= #$11FF )  or // Hangul Jamo
       
   263        ((#$2E80  <= u) and (u <= #$2FDF))  or // CJK Radicals Supplement / Kangxi Radicals
   262        ((#$2FF0  <= u) and (u <= #$303F))  or // Ideographic Description Characters / CJK Radicals Supplement
   264        ((#$2FF0  <= u) and (u <= #$303F))  or // Ideographic Description Characters / CJK Radicals Supplement
       
   265        ((#$3130  <= u) and (u <= #$318F))  or // Hangul Compatibility Jamo
   263        ((#$31C0  <= u) and (u <= #$31EF))  or // CJK Strokes
   266        ((#$31C0  <= u) and (u <= #$31EF))  or // CJK Strokes
   264        ((#$3200  <= u) and (u <= #$4DBF))  or // Enclosed CJK Letters and Months / CJK Compatibility / CJK Unified Ideographs Extension A
   267        ((#$3200  <= u) and (u <= #$4DBF))  or // Enclosed CJK Letters and Months / CJK Compatibility / CJK Unified Ideographs Extension A
   265        ((#$4E00  <= u) and (u <= #$9FFF))  or // CJK Unified Ideographs
   268        ((#$4E00  <= u) and (u <= #$9FFF))  or // CJK Unified Ideographs
       
   269        ((#$AC00  <= u) and (u <= #$D7AF))  or // Hangul Syllables
   266        ((#$F900  <= u) and (u <= #$FAFF))  or // CJK Compatibility Ideographs
   270        ((#$F900  <= u) and (u <= #$FAFF))  or // CJK Compatibility Ideographs
   267        ((#$FE30  <= u) and (u <= #$FE4F)))    // CJK Compatibility Forms
   271        ((#$FE30  <= u) and (u <= #$FE4F)))    // CJK Compatibility Forms
   268        then exit(THWFont( ord(font) + ((ord(High(THWFont))+1) div 2) ));
   272        then exit(THWFont( ord(font) + ((ord(High(THWFont))+1) div 2) ));
   269     inc(i)
   273     inc(i)
   270     end;
   274     end;