QSettings settings("HKEY_LOCAL_MACHINE\\Software\\Microsoft\\Windows NT\\CurrentVersion\\Fonts",
QSettings::NativeFormat);
QStringList list = settings.allKeys();
for(int i=0;i<list.size();i++)
{
QString key = list.at(i);
QString text = settings.value(key).toString();
QStringList keys = key.split(" & ");
QString last = keys.last();
keys[keys.size()-1] = last.left(last.indexOf(" ("));
for(int j=0;j<keys.size();j++)
{
index.insert(keys[j], j);
name.insert(keys[j], text);
}
}
轉換成FT_Face
QString family = ui->fontComboBox->currentText();
QString path("C:/WINDOWS/Fonts/");
path.append(name[family]);
int in = index[family];
FT_New_Face(library, path.toUtf8(), in, &face))
沒有留言:
張貼留言