flamaros
31st December 2009, 14:29
Hi,
I am doing an exporter of ttf files to our internal engine format. I am using a QFontComboBox to let the graphics choose the font he want convert and do a simple preview with a QTextEdit.
I am using Freetype to do the conversion, that why I try to use the QFont::freetypeFace method, but it doesn't work on Windows.
For the moment I build the file name with the font family name, but it doesn't work for all fonts.
It might possible to load all fonts of the C:/Windows/Fonts with freetype and check if one have the same family name, but this solution is dirty and slow.
Edit :
Some ttf files contains only one face, that why some font are in many tff files (i.e. arial.ttf for "Arial Regular", ariali.ttf for "Arial Italic", etc.).
The problem is ttf files don't have any convention on the file name format.
I also need to be able to get the right file with font style (bold, italic,...).
Can I find some information in the register base of Windows for making the relation between the font and the file name?
I am doing an exporter of ttf files to our internal engine format. I am using a QFontComboBox to let the graphics choose the font he want convert and do a simple preview with a QTextEdit.
I am using Freetype to do the conversion, that why I try to use the QFont::freetypeFace method, but it doesn't work on Windows.
For the moment I build the file name with the font family name, but it doesn't work for all fonts.
It might possible to load all fonts of the C:/Windows/Fonts with freetype and check if one have the same family name, but this solution is dirty and slow.
Edit :
Some ttf files contains only one face, that why some font are in many tff files (i.e. arial.ttf for "Arial Regular", ariali.ttf for "Arial Italic", etc.).
The problem is ttf files don't have any convention on the file name format.
I also need to be able to get the right file with font style (bold, italic,...).
Can I find some information in the register base of Windows for making the relation between the font and the file name?