home *** CD-ROM | disk | FTP | other *** search
- unit sample1u;
-
- interface
-
- uses
- Windows, Messages, SysUtils, Classes, Graphics,
- Controls, Forms, Dialogs, StdCtrls, Printers, Nihongo;
-
- type
- TForm1 = class(TForm)
- Button1: TButton;
- Button2: TButton;
- procedure Button1Click(Sender: TObject);
- procedure FormCreate(Sender: TObject);
- procedure Button2Click(Sender: TObject);
- private
- { Private declarations }
- public
- { Public declarations }
- end;
-
- const
- ERR00 = 'Error while initializing Nihongo Engine!'+#10+
- '(Remerber: ' + jJAPFNT + ' and ' + jASCFNT + ' must be in program''s folder!)';
- EUCSRC = '╞ⁿ╦▄╕∞í┌ñ╦ñ█ñ≤ñ┤í█';
-
- var
- Form1 : TForm1;
- EUC : String;
-
- implementation
-
- {$R *.DFM}
-
- // --------------------------------------------------------------------------
-
- procedure TForm1.FormCreate(Sender: TObject);
-
- begin
- if jInitialize = false then
- begin
- ShowMessage(ERR00);
- halt;
- end;
- EUC := EUCSRC;
- end;
-
- // --------------------------------------------------------------------------
-
- procedure DrawIt(_dest: HDC; _size: byte);
-
- begin
- Form1.Canvas.Brush.Color := clWhite;
- Form1.Canvas.MoveTo(0, 0);
- jWriteSJS(100, 10, _size, _size,
- 'SJS - ô·û{îΩüyé╔é┘é±é▓üz', false, _dest);
- jWriteEUC(100, 12 + _size, _size, _size,
- 'EUC - ' + EUC, true, _dest);
- end;
-
- // --------------------------------------------------------------------------
-
- procedure TForm1.Button1Click(Sender: TObject);
-
- begin
- DrawIt(Form1.Canvas.Handle, 16);
- end;
-
- // --------------------------------------------------------------------------
-
- procedure TForm1.Button2Click(Sender: TObject);
-
- begin
- Printer.BeginDoc;
- DrawIt(Printer.Canvas.Handle, (Printer.PageWidth * 16) div 640);
- Printer.EndDoc;
- end;
-
- // --------------------------------------------------------------------------
-
- end.
-