我想检索其扩展名的字体文件路径(例如"arial.ttf").
该QFont :: rawname()方法总是返回" 未知 ".
有没有其他方法来获取字体的名称和扩展名?
这是我们使用的代码:
bool ok = true;
QFont font = QFontDialog::getFont(&ok, this);
if(ok)
{
QString fontpath = "/Library/Fonts/" + font.family()+".ttf";//Using font file path in the application
}
Run Code Online (Sandbox Code Playgroud)