trichview.com

trichview.support




Unicode simbols


Return to index


Author

Message

Jonas Bilinkevicius

Posted: 01/27/2004 14:07:43


Hello,


Extract from newspost:


      From: "Sergey Tkachenko" <[email protected]>

      Subject: Re: How to insert WideString and RTF code into TRichview

      Date: Sun, 27 Apr 2003 12:29:48 +0400


------------------------------

But if you want just to insert separate Unicode symbols, you just need to

ensure that current text style at the moment of insertion is Unicode

Call this procedure before inserting Unicode string:


procedure EnsureUnicode(rve: TCustomRichViewEdit);

var StyleNo: Integer;

    fs: TFontInfo;

begin

  StyleNo := rve.CurTextStyleNo;

  if rve.Style.TextStyles[StyleNo].Unicode then

    exit;

  fs := TFontInfo.Create(nil);

  fs.Assign(rve.Style.TextStyles[StyleNo]);

  fs.Unicode := True;

  StyleNo := rve.Style.TextStyles.FindSuchStyle(StyleNo, fs,

    RVAllFontInfoProperties);

  if StyleNo<0 then begin

    StyleNo := rve.Style.TextStyles.Count-1;

    rve.Style.TextStyles.Add;

    rve.Style.TextStyles[StyleNo].Assign(fs);

    rve.Style.TextStyles[StyleNo].Standard := False;

  end;

  fs.Free;

  rve.CurTextStyleNo := StyleNo;

end;

------------------------------


I want to ask in which event is better to insert this procedure? Is will be

ok, if I will insert

it in OnChanging event of TRWE,


Regards,

Jon






Powered by ABC Amber Outlook Express Converter