Arkadaşlar ek dosyada ekran görüntüsü attım böyle bir sorun ile karşılaştınızmı hiç ?
Fontların renklerini boyutlarını ayarlıyorum ama telefonda kafasına göre çıkıyor bu nasıl iştir.
ekte kırmızı oval içine aldıklarım ayarladıklarım ama 1 tanesi bile telefonda istediğim gibi çıkmıyor.
Enteresan bir durum.
Ek dosya
Bunuda yaptım faydası olmadı
procedure TForm1.fontduzelt;
var i:Integer;
begin
for i:=0 to Self.ComponentCount-1 do
begin
if Self.Components[i] is TLabel then
begin
if (Self.Components[i] as TLabel).Tag.ToString='1' then
begin
(Self.Components[i] as TLabel).TextSettings.Font.Family := 'Arial';
(Self.Components[i] as TLabel).TextSettings.Font.Size:=13;
(Self.Components[i] as TLabel).TextSettings.Font.Style:=[TFontStyle.fsBold];
(Self.Components[i] as TLabel).TextSettings.FontColor:=TAlphaColorRec.Red;
end;
if (Self.Components[i] as TLabel).Tag.ToString='2' then
begin
(Self.Components[i] as TLabel).Margins.Top:=5;
(Self.Components[i] as TLabel).TextSettings.Font.Family := 'Arial';
(Self.Components[i] as TLabel).TextSettings.Font.Size:=11;
(Self.Components[i] as TLabel).TextSettings.Font.Style:=[TFontStyle.fsBold];
(Self.Components[i] as TLabel).TextSettings.FontColor:=TAlphaColorRec.Black;
end;
if (Self.Components[i] as TLabel).Tag.ToString='3' then
begin
(Self.Components[i] as TLabel).Margins.Top:=5;
(Self.Components[i] as TLabel).TextSettings.Font.Family := 'Arial';
(Self.Components[i] as TLabel).TextSettings.Font.Size:=11;
(Self.Components[i] as TLabel).TextSettings.Font.Style:=[TFontStyle.fsBold];
(Self.Components[i] as TLabel).TextSettings.FontColor:=TAlphaColorRec.Darkgray;
end;
//(Self.Components[i] as TLabel).Repaint;
end;
end;
end;
Merhaba,
TPresentedTextControl sınıfına ait tüm bileşenler varsayılan olarak sabit Family, Size, Style, FontColor değerlerine sahiptir. Bileşenin sahip olduğu varsayılan font stilinin değiştirilebilmesi için
TStyledSettings özelliklerinin serbest bırakılması (False olması) gerekiyor.
Örnek:
procedure TForm1.Button1Click(Sender: TObject);
begin
Label1.StyledSettings := Button1.StyledSettings - [TStyledSetting.FontColor, TStyledSetting.Style, TStyledSetting.Size];
Label1.TextSettings.Font.Size := 25;
Label1.TextSettings.Font.Style := [TFontStyle.fsBold];
Label1.TextSettings.FontColor := ColorPanel1.Color;
end;
