Jump to content

uligerhardt

Members
  • Content Count

    83
  • Joined

  • Last visited

Posts posted by uligerhardt


  1. 9 hours ago, Remy Lebeau said:

    And yet, it CAN be done with plain/static functions.  I do it all the time when writing test apps that have no UIs.  It is just a matter of adding an explicit Self parameter to the function, populating a TMethod record with the address of the function in the Code field and an arbitrary value in the Data field, and then assigning that TMethod to the target event via a type-cast.

    FWIW: If I have to adapt the interface of the routine anyway I would make it into a (non-static) class method of a dummy class and stay completely inside of the type system.


  2. What does "doesn't work" mean for you? Computer exploding? Hard drive formatted?

     

    I just created a FMX app with this:

    procedure TForm1.FormCreate(Sender: TObject);
    begin
      AddFontResource('C:\Users\uli\Documents\Embarcadero\Studio\Projekte\IcoMoon\IcoMoon-Free-master\Font\IcoMoon-Free.ttf');
      SendMessage(HWND_BROADCAST, WM_FONTCHANGE, 0, 0);
      Text1.Font.Family:= 'IcoMoon-Free';
      Text1.Text:= #$e900;
      Text1.TextSettings.FontColor:= TAlphaColorRec.Red;
      Text1.TextSettings.Font.Size:= 32;
      Text1.TextSettings.HorzAlign:= TTextAlign.Trailing;
    end;

    And I get a red house. I'm not sure if it matters that font file name and family are the same in my sample.

×