renodino has asked for the wisdom of the Perl Monks concerning the following question:
1. Takes font family, weight, etc., (as from a pTk font object)
2. Forms a Win32 font name (e.g., capitalize the fontname pieces, append Bold and/or Italic if the weight/slant indicate it)
3. Use that result as a key to lookup and return the font file via Win32::TieRegistry
Obviously its not too complicated, but it seems like something that might be generally useful.
If anyone knows of a module that already does this, please advise. Otherwise, if anyone can suggest a namespace for this, that'd be great as well. I'm thinking it should be under Win32, not Tk or GD; maybe Win32::Font::NameToFile ?
Update:
Done. Uploaded to CPAN as Win32-Font-NameToFile-0.10.tar.gz. Also available here.
I ran some quick tests with the demo app from GD::Text and it behaves as desired (at least for my configuration). Given the vagueries of Win32 fonts, YMMV.
|
|---|
| Replies are listed 'Best First'. | |
|---|---|
|
Re: Win32 Module to return font filename from full font name/weight/slant ?
by planetscape (Chancellor) on Jan 04, 2006 at 14:09 UTC | |
|
Re: Win32 Module to return font filename from full font name/weight/slant ?
by hsmyers (Canon) on Jan 04, 2006 at 16:26 UTC | |
by renodino (Curate) on Jan 04, 2006 at 17:07 UTC | |
by hsmyers (Canon) on Jan 04, 2006 at 20:29 UTC |