mirror of
https://github.com/keymanapp/keyman.git
synced 2026-09-12 18:47:41 +00:00
Additional management for text editor selection of partial surrogate pair
This commit is contained in:
parent
afcdbc6767
commit
b9b32fc4cb
2 changed files with 11 additions and 4 deletions
|
|
@ -59,7 +59,7 @@ uses
|
|||
Dialogs, Menus, ImgList,
|
||||
MenuImgList, ExtCtrls,
|
||||
|
||||
{$IFDEF USE_PLUSMEMO}
|
||||
{IFDEF USE_PLUSMEMO}
|
||||
SyntaxHighlight,
|
||||
PlusMemo,
|
||||
PlusGutter,
|
||||
|
|
@ -67,7 +67,7 @@ uses
|
|||
HtmlHighlight,
|
||||
pmprint,
|
||||
PMSupport,
|
||||
{$ENDIF}
|
||||
{ENDIF}
|
||||
|
||||
TextFileFormat, UfrmTike,
|
||||
System.ImageList, KeymanDeveloperMemo,
|
||||
|
|
@ -925,7 +925,9 @@ begin
|
|||
if ch = '' then Exit;
|
||||
|
||||
if Uni_IsSurrogate2(ch[1]) then
|
||||
ch := memo.GetTextPart(memo.SelStart-2, memo.SelStart);
|
||||
ch := memo.GetTextPart(memo.SelStart-2, memo.SelStart)
|
||||
else if Uni_IsSurrogate1(ch[1]) then
|
||||
ch := memo.GetTextPart(memo.SelStart-1, memo.SelStart+1);
|
||||
|
||||
token := FormatUnicode(ch);
|
||||
end;
|
||||
|
|
|
|||
|
|
@ -325,7 +325,12 @@ procedure TClearTypeDrawCharacter.SelectFallbackFont(Handle: THandle; const Text
|
|||
var
|
||||
uc: DWord;
|
||||
begin
|
||||
uc := Char.ConvertToUtf32(Text, 0); // I3310
|
||||
try
|
||||
uc := Char.ConvertToUtf32(Text, 0); // I3310
|
||||
except
|
||||
on E:EArgumentOutOfRangeException do
|
||||
uc := $FFFD; // Not a character, invalid Unicode
|
||||
end;
|
||||
if uc < $10000 then SelectFont(Handle, ctfCode2000)
|
||||
else if uc < $20000 then SelectFont(Handle, ctfCode2001)
|
||||
else if uc < $30000 then SelectFont(Handle, ctfCode2002)
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue