目的:
我想知道如何在我的SwiftUI应用程序中使用支持动态大小的自定义大小的系统字体(当用户更改设备上的文本大小时,字体大小会动态变化)。
问题:
对于系统字体,我可以使用标准的.body、.title等,但是我想使用一个稍微不同的自定义大小,但是仍然希望确保它与动态类型一起工作。
我失败的尝试:
//Font size doesn't change when the user changes his preferred text size on the device
Text("hello")
.font(.system(size: 14, weight:
我想上传WordPress仪表板中的自定义字体。当我试图上传字体文件时,它显示的是错误:
Sorry, this file type is not permitted for security reasons.
然后,通过使用以下代码,我允许使用所有文件的字体:
add_filter('upload_mimes', 'add_custom_upload_mimes');
function add_custom_upload_mimes($existing_mimes) {
$existing_mimes['otf'] = '