Indigo Rose Software
  #1  
Old 03-14-2005
JimS's Avatar
JimS JimS is offline
Forum Member
 
Join Date: May 2003
Location: Pendleton, Oregon
Posts: 911
How to get Font Names

How do I get the Font Name from the font Filename?

i.e
Font Name = Arial, Font Filename = Menu1.ttf
Font Name = Arial Black, Font Filename = ARIBLK.TTF

I can get a list or table of the Font Filenames on a machine, but I want to convert these into a list or table of the common Font Names. Any ideas?

Thanks.
__________________
Add-ons for AMS. Toolbar Buttons Galore, System Animations, the Window Construction Kit, and more.
Visit Acme-Tek
Reply With Quote
  #2  
Old 03-14-2005
Ted Sullivan's Avatar
Ted Sullivan Ted Sullivan is offline
Indigo Rose Staff Member
 
Join Date: Oct 2003
Posts: 825
Ouch! I can tell you for sure that doing such a thing is about as convoluted a thing as can be attempted. We do it internally in AutoPlay Media Studio 5.0, Setup Factory 7.0 and TrueUpdate 2.0 for packaging up the fonts referenced in your projects. It required some pretty involved parsing of the TTF file format (which isn't documented very well either...).
__________________
Check out the new MSI Factory 2.0!
Reply With Quote
  #3  
Old 03-14-2005
Corey's Avatar
Corey Corey is offline
Registered User
 
Join Date: Aug 2002
Posts: 9,746
Another approach might be to find/create a list of the most common font/filename associations and compare against that. Two centavos anyhow...
Reply With Quote
  #4  
Old 03-15-2005
JimS's Avatar
JimS JimS is offline
Forum Member
 
Join Date: May 2003
Location: Pendleton, Oregon
Posts: 911
Thanks guys, I’ve just started my search so I’m not quite ready yet to give up and go with the list of common names. It’s a good idea Corey, and I’ll go that way if I have to, but I’m still hoping to find a DLL or something.

Ted, I’ve tried opening the font files with a text editor, to see if I can figure an easy way to parse the name, but so far I can’t figure a pattern to search for, that would work with all the files.

It seems like a fairly common feature in software, so I figured that Windows would have a built in facility for it somewhere. “Convoluted” doesn’t sound too promising for a half-baked programmer like me. Still, maybe I’ll get lucky.

Either way, thanks for the replies.
__________________
Add-ons for AMS. Toolbar Buttons Galore, System Animations, the Window Construction Kit, and more.
Visit Acme-Tek
Reply With Quote
  #5  
Old 03-15-2005
JimS's Avatar
JimS JimS is offline
Forum Member
 
Join Date: May 2003
Location: Pendleton, Oregon
Posts: 911
Looks like it might be possible to get them from the registry

This works on XP machines

Code:
all_keys = Registry.GetValueNames(HKEY_LOCAL_MACHINE, "SOFTWARE\\Microsoft\\Windows NT\\CurrentVersion\\Fonts");
TextFile.WriteFromTable("AutoPlay\\Docs\\fonts.txt", all_keys, false);
__________________
Add-ons for AMS. Toolbar Buttons Galore, System Animations, the Window Construction Kit, and more.
Visit Acme-Tek
Reply With Quote
  #6  
Old 03-16-2005
Worm Worm is offline
Indigo Rose Customer
 
Join Date: Jul 2002
Location: USA
Posts: 3,937
Maybe something like this:
Attached Files
File Type: apz ChooseFont.apz (18.5 KB, 126 views)
Reply With Quote
  #7  
Old 03-17-2005
JimS's Avatar
JimS JimS is offline
Forum Member
 
Join Date: May 2003
Location: Pendleton, Oregon
Posts: 911
Worm, what can I say? Thank you doesn’t seem to be nearly enough. You are incredible my friend. Your on fire too, what is that three or four new DLL’s this week? How do you ever find the time? I checked out your function on this, and your code is so tight that it is a beautiful thing to look at. It’s always a pleasurable learning experience for a fellow like me to have the chance to learn code from a master like you. Now if I could just be smart enough to retain it for the next time I’m writing a similar chunk of code.

As good as this forum is, it just wouldn’t be the same without your amazing skill, generosity, and unequivocal mastery. All that, and your incredible under spoken, and nonchalant attitude to boot. I’m telling you that if I had one-tenth the talent you have, I’d be stopping strangers on the street, just to brag about it.

Thanks Brad, you’ve come to my rescue again.
__________________
Add-ons for AMS. Toolbar Buttons Galore, System Animations, the Window Construction Kit, and more.
Visit Acme-Tek
Reply With Quote
  #8  
Old 03-17-2005
Corey's Avatar
Corey Corey is offline
Registered User
 
Join Date: Aug 2002
Posts: 9,746
Quote:
As good as this forum is, it just wouldn’t be the same without your amazing skill, generosity, and unequivocal mastery.
No question about it.
Reply With Quote
  #9  
Old 03-17-2005
Intrigued's Avatar
Intrigued Intrigued is offline
Indigo Rose Customer
 
Join Date: Dec 2003
Location: Location! Location!
Posts: 6,058
Worm, I see you as the programmer-Santa of our time!

.dll Bling-Bling goes a long way with us AMS'sters!



__________________
Intrigued
www.amsuser.com
Reply With Quote
  #10  
Old 03-18-2005
yosik's Avatar
yosik yosik is offline
Indigo Rose Customer
 
Join Date: Jun 2002
Location: Israel
Posts: 1,863
Jim, what you said is on-the-dot!
Brad is one cool guy, ready to help and a MASTER at programming!
and, Brad! Don't be shy, Man! You ARE the Numero Uno!

Yossi
Reply With Quote
  #11  
Old 03-18-2005
Worm Worm is offline
Indigo Rose Customer
 
Join Date: Jul 2002
Location: USA
Posts: 3,937
Wow! You are all way too kind.

Thank you.
Reply With Quote
Reply

Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off


Similar Threads
Thread Thread Starter Forum Replies Last Post
How to reduce size of a file with custom font? atrust Setup Factory 7.0 Discussion 3 12-09-2004 08:37 PM
London Underground Font & NPS Font gbrown General Chat 0 11-12-2004 01:06 PM
Help with a font.... element78 AutoPlay Media Studio 4.0 1 08-29-2003 06:25 PM
Add folder names to List Box hermie AutoPlay Media Studio 4.0 0 07-18-2003 03:03 PM
font registration dadler Setup Factory 5.0 3 10-20-2001 12:11 AM


All times are GMT -6. The time now is 11:20 PM.


Powered by vBulletin® Version 3.8.4
Copyright ©2000 - 2009, Jelsoft Enterprises Ltd.
Copyright © 2000 - 2009 Indigo Rose Corporation. All rights reserved.
Indigo Rose Software