main.cpp 1.3 KB

1234567891011121314151617181920212223242526272829303132333435363738394041
  1. //---------------------------------------------------------------------------
  2. #include <vcl.h>
  3. #pragma hdrstop
  4. #include "main.h"
  5. //---------------------------------------------------------------------------
  6. #pragma package(smart_init)
  7. #pragma link "GLS.WindowsFont"
  8. #pragma resource "*.dfm"
  9. TfrmMain *frmMain;
  10. //---------------------------------------------------------------------------
  11. __fastcall TfrmMain::TfrmMain(TComponent* Owner)
  12. : TForm(Owner)
  13. {
  14. }
  15. //---------------------------------------------------------------------------
  16. void __fastcall TfrmMain::Button1Click(TObject *Sender)
  17. {
  18. FontDialog1->Font = Panel1->Font;
  19. if (FontDialog1->Execute())
  20. {
  21. Panel1->Font = FontDialog1->Font;
  22. FFont->Font = FontDialog1->Font;
  23. Image1->Picture->Assign(FFont->Glyphs);
  24. }
  25. }
  26. //---------------------------------------------------------------------------
  27. void __fastcall TfrmMain::FormCreate(TObject *Sender)
  28. {
  29. FFont = new TGLWindowsBitmapFont(this);
  30. }
  31. //---------------------------------------------------------------------------
  32. void __fastcall TfrmMain::Button2Click(TObject *Sender)
  33. {
  34. if (SaveDialog1->Execute())
  35. {
  36. FFont->Glyphs->SaveToFile(SaveDialog1->FileName);
  37. }
  38. }
  39. //---------------------------------------------------------------------------