Delphi 取得 iOS 辅助使用里的字型大小

说明:在 iOS 里有一个人性化的辅助设定,可以将字体放大,但这个设定对 Delphi 是不起作用的,还好 Delphi 提供了这个 iOS API 可以取得。

开发环境:Delphi 10 Seattle

运行系统:iOS 7.0 以上

参考资料:Apple 官网

源码:

function iOSFontSize: Single;
var f: UIFontDescriptor;
begin
     f := TUIFontDescriptor.OCClass.preferredFontDescriptorWithTextStyle(UIFontTextStyleBody);
     Result := f.pointSize;
end;

Android 请参考:

[函數] Firemonkey Android 取得系统参数设定的字型大小

原文地址:https://www.cnblogs.com/onechen/p/4979655.html