CGI/Perl Guide | Learning Center | Forums | Advertise | Login
Site Search: in

  Main Index MAIN
Search Posts SEARCH
Who's Online WHO'S
Log in LOG

Home: Perl Programming Help: Win32 Programming Help:
Reading font name from file


New User

Feb 28, 2003, 9:54 AM

Post #1 of 3 (6485 views)
Reading font name from file Can't Post

Given a filename (let's say "ARIBLK.TTF"), is there some way to return the name of the font itself ("Arial Black")? I'm trying to dynamically produce an HTML page containing samples of all the fonts on my machine. There may well be a better way of viewing the fonts on my machine, but I'm really interested in seeing if it's doable in Perl for my own amusement. I'm looking for the READ_FONT_NAME_FROM_FILE() below:

use strict; 
my $dir = 'C:/WINNT/Fonts';
my @fontfiles = glob("$dir/*.ttf $dir/*.fon");

map {
print qq|<font face="$ff">This text is using the $ff font.</font><br>\n|;



Feb 28, 2003, 10:38 AM

Post #2 of 3 (6482 views)
Re: [jdb] Reading font name from file [In reply to] Can't Post

Try [url=""]Font::TTF from CPAN.
"...there's some good in this world, Mr. Frodo, and it's worth fighting for." - Samwise Gamgee, The Two Towers

New User

Feb 28, 2003, 11:35 AM

Post #3 of 3 (6480 views)
Re: [Melvosh] Reading font name from file [In reply to] Can't Post

I've looked into that Font::TTF mod in the past with no joy; I still don't really understand it as I know just about nothing about font tables, but I checked it out again just now for kicks, and I did find an example of reading names of installed fonts out of the Registry (using Win32::Registry) in one of the Font::TTF .pm files. So I've managed to produce the file I was going for - Tanks, Melvosh!


Search for (options) Powered by Gossamer Forum v.1.2.0

Web Applications & Managed Hosting Powered by Gossamer Threads
Visit our Mailing List Archives