PDA

View Full Version : Fonts Fonts Fonts....



azrael11
30-05-2011, 07:38 PM
Can someone tell me how can i get the Typeface name of a font...
And how can i take the windows name of the font having the Typeface name...?

Thanks....

azrael11
10-06-2011, 06:51 AM
Can someone tell me how can i get the Typeface name of a font...
And how can i take the windows name of the font having the Typeface name...?

Thanks....

so I think is really hard that i am asking ... Hmmm...

Any thouthgs ... Some direction ...

User137
10-06-2011, 07:58 PM
I don't really know what a Typeface name is. In general there could be more answers if you explained what the whole problem is. Why do you need to know that name and what graphics library etc would use it?

czar
10-06-2011, 09:26 PM
If you double click the ttf then you get the name of the font, just refer to that name in your program. However, I have a feeling that that is not exactly what you are wanting to do.

azrael11
11-06-2011, 04:09 AM
If you double click the ttf then you get the name of the font, just refer to that name in your program. However, I have a feeling that that is not exactly what you are wanting to do.

No is not what i am asking for... ;)

With pascal code... i am asking for...

LP
11-06-2011, 06:45 PM
You will probably need to call Win32 API EnumFontFamilies (http://msdn.microsoft.com/en-us/library/aa911445.aspx), which will enumerate all fonts. You can check it against the font you are looking for and then extract the desired typeface name from the enumeration function.

code_glitch
11-06-2011, 08:13 PM
Heyheyhey, I can post again which means I can reply to this at last! yay!

I remember reading through the Sdl_Ttf library for my own libs and came accross a page which relates to TTF info calls. I'll see if I can dig it up. I also believe the same can be done with freetype, but not entirely sure since it was on one of those FCL examples...

For the potential sdl solution check here: http://jcatki.no-ip.org/SDL_ttf/SDL_ttf_35.html#SEC35 - although I have not tried it, the description fits the bill ;)