Unit1.cpp
上传用户:daoqigc
上传日期:2021-04-20
资源大小:2795k
文件大小:2k
- /*=============================================================================
- This demo shows working with Unicode composite characters.
- Special processing for these characters is available only in WinNT/2000/XP.
- (and depends on Windows version...)
- ==============================================================================*/
- #include <vclvcl.h>
- #pragma hdrstop
- #include "Unit1.h"
- //---------------------------------------------------------------------------
- #pragma link "RVEdit"
- #pragma link "RichView"
- #pragma link "RVScroll"
- #pragma link "RVStyle"
- #pragma resource "*.dfm"
- TForm1 *Form1;
- //---------------------------------------------------------------------------
- __fastcall TForm1::TForm1(TComponent* Owner)
- : TForm(Owner)
- {
- }
- //---------------------------------------------------------------------------
- void __fastcall TForm1::FormCreate(TObject *Sender)
- {
- for (int i=0; i<RVStyle1->TextStyles->Count; i++)
- RVStyle1->TextStyles->Items[i]->Unicode = true;
- RichViewEdit1->Clear();
- RichViewEdit1->LoadRVF(ExtractFilePath(Application->ExeName)+"test.rvf");
- // May be your computer does not have 'Arial Unicode MS' font
- if (Screen->Fonts->IndexOf("Arial Unicode MS")<0)
- {
- for (int i=0; i<RVStyle1->TextStyles->Count; i++)
- if (AnsiString(RVStyle1->TextStyles->Items[i]->FontName) == "Arial Unicode MS")
- RVStyle1->TextStyles->Items[i]->FontName = "Lucida Sans Unicode";
- }
- RichViewEdit1->Format();
- }
- //---------------------------------------------------------------------------