【发布时间】:2021-07-31 12:38:37
【问题描述】:
【问题讨论】:
标签: lazarus freepascal
【问题讨论】:
标签: lazarus freepascal
此代码似乎有效:
procedure TForm1.GetFormFontName;
var
S : String;
begin
S := GetFontData(Self.Font.Handle).Name;
Caption := S;
end;
procedure TForm1.Button1Click(Sender: TObject);
begin
GetFormFontName;
end;
GetFontData 返回一条 TFontData 记录
TFontData = record
Handle: HFont;
Height: Integer;
Pitch: TFontPitch;
Style: TFontStylesBase;
CharSet: TFontCharSet;
Quality: TFontQuality;
Name: TFontDataName;
Orientation: Integer;
end;
这不包括字体的Size,这是字体的显式发布属性。
上面的代码来自这个线程:https://forum.lazarus.freepascal.org/index.php?topic=16697.0,我发现这是这个谷歌查询返回的第一个命中
字体名称默认站点:freepascal.org
【讨论】: