Intel® Fortran Compiler
Build applications that can scale for the future with optimized code designed for Intel® Xeon® and compatible processors.

Name of the font file

rase
New Contributor I
1,382 Views
I have to get the name of the font file (Truetype) by providing the name of the type face (font) for a Windows application under Windows 7. I tried the Quickwin example in HELP by calling GETFONTINFO. The type structure (definition FONTINFO) is supposed to contain the font file name, but the name field is empty after return from GETFONTINFO. I suppose I have misunderstood something. Has one of the esteemed colleagues an idea how to get the name of the font file from the name of the type face?
0 Kudos
1 Solution
ZlamalJakub
New Contributor III
1,382 Views

Or you can list all *.ttf file in c:\windows\Fonts directory and get their names from font file

I have found description

http://developer.apple.com/textfonts/TTRefMan/RM06/Chap6.html#Overview

But it seems little bit complicated and you will spend a lot of time to read ttf file information you need. I have found some code

http://www.codeguru.com/cpp/g-m/gdi/fonthandlinganddetection/article.php/c3659

Jakub

View solution in original post

0 Kudos
5 Replies
ZlamalJakub
New Contributor III
1,382 Views

I do not think it is possible (I do not know win32 api function which provides it). I do not use QuickWin.

Why you need font file name?

Jakub

0 Kudos
rase
New Contributor I
1,382 Views
Quoting Quba
Why you need font file name?

Jakub, I need the font file name to construct a text object for the raytracing software POY-Ray where the type face name does not suffice. Appending a ".ttf" helps in some cases (font "Arial" for example), but not for every type face. I tried to use the export file which some type face administration programs provide, but I had to find out that the type face names used by Windows are not identical to the names given by the type face originators. For example in Windows a certain type face is called "RotisSansSerif" whereas the offical name is "Rotis Sans Serif 55", with additional blanks and characters. There are type faces where the differences in naming are even more odd. Selecting a type face file name from a common dialog is difficult because Windows handles font directories in a deviant manner. I suspected from the structure necessary for GETFONTINFO that the file name of the type face is stored somewhere in Windows and can be accessed by a function. If my suspicion is wrong I have to find another workaround until the POV-Ray programmers decide to allow plain type face names instead of the type face file names.

0 Kudos
ZlamalJakub
New Contributor III
1,382 Views

Try to ask in C forum or google info about fonts in windows, I think that it is very specific. I use win32 api but I never care about font file names.

Jakub

0 Kudos
ZlamalJakub
New Contributor III
1,383 Views

Or you can list all *.ttf file in c:\windows\Fonts directory and get their names from font file

I have found description

http://developer.apple.com/textfonts/TTRefMan/RM06/Chap6.html#Overview

But it seems little bit complicated and you will spend a lot of time to read ttf file information you need. I have found some code

http://www.codeguru.com/cpp/g-m/gdi/fonthandlinganddetection/article.php/c3659

Jakub

0 Kudos
rase
New Contributor I
1,382 Views

Thanks for your efforts, Jakub. I have a printed version of your first reference, and will have a look at the second one. But I suspect that the font names in the ttf files are not identical to the ones used in Windows. Anyway, I will have a look.

0 Kudos
Reply