Unicode text
Submitted by eLenka on 4 August, 2010 - 14:44

The example of using Unicode text. Arial Unicode MS font is used in this sample.
Source archive: unicode.zip (327 KB)
Sample works
Some sample source:
procedure TForm2.Button1Click(Sender: TObject); var Movie: TFlashMovie; Font: TFlashFont; Txt: TFlashText; i: integer; R: TRect; WS: WideString; FS: TMemoryStream; PB:PByte; begin Screen.Cursor := crHourGlass; AddFontResourceEx('Arialuni.ttf', FR_PRIVATE, 0); Movie := TFlashMovie.Create(0, 0, 500 * twips, 250 * twips, 12); Movie.SystemCoord := scPix; Movie.Compressed := true; Font := Movie.AddFont; Font.Name := 'Arial Unicode MS'; Font.Size := 300; Font.AsDevice:= false; Font.Layout:= true; R := Rect(10, 10, 490, 240); FS := TMemoryStream.Create; FS.LoadFromFile('UnicodeInput.txt'); SetLength(WS, (FS.Size - 2) div 2); PB := FS.Memory; Inc(PB, 2); Move(PB^, WS[1], FS.Size - 2); Txt:= Movie.AddDynamicText('textedit', WS, cswfBlack, Font, R); Txt.Multiline := true; Txt.Border:= true; Txt.WordWrap:= true; Movie.PlaceObject(Txt, 1); Movie.ShowFrame(1); Movie.MakeStream; Movie.SaveToFile('UnicodeDemo.swf'); Movie.Free; FS.Free; FlashPlayer.BackgroundColor:= clWindow; FlashPlayer.Movie := ExtractFilePath(ParamStr(0)) + 'UnicodeDemo.swf'; RemoveFontResourceEx('Arialuni.ttf', FR_PRIVATE, 0); Screen.Cursor := crDefault; end;