
jdb
New User
Feb 28, 2003, 9:54 AM
Post #1 of 3
(2008 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 { my $ff = READ_FONT_NAME_FROM_FILE($_); print qq|<font face="$ff">This text is using the $ff font.</font><br>\n|; }@fontfiles; TIA, JDB
|