Hi ChrisW67 thank you for replying. I have installed fontconfig 2.6.0 on my system and using Qt 4.6.2. I am able to fetch the font(TrueType font (application/x-font-ttf)) form the resource, but QFontDatabase::addApplicationFontFromData return -1. Even though data.size() return non-zero value.
qDebug()<<"handle::"<<res.handle()<<"Size::"<<res.size()<<"\n";
qDebug()<<"handle::"<<res.handle()<<"Size::"<<res.size()<<"\n";
To copy to clipboard, switch view to plain text mode
Output::
handle::8 Size:: 81228
qDebug()<<"data size::"<<data.size();
QByteArray data =res.readAll();
qDebug()<<"data size::"<<data.size();
To copy to clipboard, switch view to plain text mode
Output::
data size:: 81228
int fontID
= QFontDatabase::addApplicationFontFromData( data
);
// returns -1 if (fontID == -1 ) {
qDebug()<<"error";
}
else
qDebug()<<fontID;
int fontID = QFontDatabase::addApplicationFontFromData( data ); // returns -1
if (fontID == -1 ) {
qDebug()<<"error";
}
else
qDebug()<<fontID;
To copy to clipboard, switch view to plain text mode
Bookmarks