I'm trying Firemonkey for the first time, and I'm finding problems creating labels at runtime.
I'm drawing rectangles at runtime with description labels inside, but those labels are always drawn at the default font, ignoring the font size I set on its properties.
You can see the problem on Windows itself creating a new Blank multidevice project, and putting this code at OnCreate :
procedure TForm2.FormCreate(Sender: TObject);
var Shape: TRectangle;
Etiqueta: TLabel;
begin
Shape := TRectangle.Create(Self);
Shape.Align := Shape.Align.alClient;
Shape.Parent := Self;
Etiqueta := TLabel.Create(Shape);
Etiqueta.Position.X := 20;
Etiqueta.Position.Y := 50;
Etiqueta.Width := 200;
Etiqueta.TextSettings.Font.Size := 10;
Etiqueta.Text := 'Small Font';
Etiqueta.Parent := Shape;
Etiqueta := TLabel.Create(Shape);
Etiqueta.Position.X := 20;
Etiqueta.Position.Y := 100;
Etiqueta.Width := 200;
Etiqueta.TextSettings.Font.Size := 20;
Etiqueta.Text := 'Large Font';
Etiqueta.Parent := Shape;
end;
One label should have a font larger than the order, but both texts are drawn using the same size.
What could be the problem ?. If I put two labels at design time, with those same properties, they are shown with the correct font size.