For Programmers: Free Programming Magazines  


Home > Archive > Visual Basic > May 2005 > Finding out font's file name









You are viewing an archived Text-only version of the thread. To view this thread in it's original format and/or if you want to reply to this thread please [click here]

 

Author Finding out font's file name
Faraz Azhar

2005-05-20, 8:55 pm

Hello

Im filling a listbox with all the fonts installed using Screen.Fonts &
Screen.FontCount. Now all the names are listed in the listbox. I want to
create a function that when I click on the font name in the listbox it would
display its actual file name.

How do I find out the actual file name of the font by its face name?

Faraz Azhar



Dan Barclay

2005-05-20, 8:55 pm

Check the samples on Karl Peterson's web site. I seem to remember he wrote
a font inspector and I'm sure it has the code you're looking for.

http://www.vb.mvps.org

Dan


"Faraz Azhar" <itz_farazSPAM@hotSPAMmail.com> wrote in message
news:udQwPnXXFHA.712@TK2MSFTNGP14.phx.gbl...
> Hello
>
> Im filling a listbox with all the fonts installed using Screen.Fonts &
> Screen.FontCount. Now all the names are listed in the listbox. I want to
> create a function that when I click on the font name in the listbox it
> would
> display its actual file name.
>
> How do I find out the actual file name of the font by its face name?
>
> Faraz Azhar
>
>
>



Karl E. Peterson

2005-05-20, 8:55 pm

Faraz Azhar wrote:
> Im filling a listbox with all the fonts installed using Screen.Fonts &
> Screen.FontCount. Now all the names are listed in the listbox. I want
> to create a function that when I click on the font name in the
> listbox it would display its actual file name.
>
> How do I find out the actual file name of the font by its face name?


I think Dan's suggesting you look at this:

http://vb.mvps.org/samples/FontPre

This sample shows you how to pick apart a TTF file, to find out what characteristics
it may exhibit if installed, and actually install the font temporarily so that you
can get a preview of it. Going the other way isn't very straight forward. In fact,
*any* correlationg between font name and font file seems fraught with difficulty.
Easiest way, in general, may be to enumerate this key:

HKLM\Software\Microsoft\Windows NT\CurrentVersion\Fonts
--
Working Without a .NET?
http://classicvb.org/petition


Faraz Azhar

2005-05-21, 3:55 pm

That seems good info Karl.. thanks!

Faraz Azhar

"Karl E. Peterson" <karl@mvps.org> wrote in message
news:ev81bvYXFHA.3464@TK2MSFTNGP10.phx.gbl...
> Faraz Azhar wrote:
>
> I think Dan's suggesting you look at this:
>
> http://vb.mvps.org/samples/FontPre
>
> This sample shows you how to pick apart a TTF file, to find out what

characteristics
> it may exhibit if installed, and actually install the font temporarily so

that you
> can get a preview of it. Going the other way isn't very straight forward.

In fact,
> *any* correlationg between font name and font file seems fraught with

difficulty.
> Easiest way, in general, may be to enumerate this key:
>
> HKLM\Software\Microsoft\Windows NT\CurrentVersion\Fonts
> --
> Working Without a .NET?
> http://classicvb.org/petition
>
>



Randy Birch

2005-05-24, 3:55 am

Marlett is the font that contains various shapes used by Windows (e.g. the
minimize/maximize boxes, the resizing gripper, etc. See
http://vbnet.mvps.org/code/forms/fakesizegrip.htm). If you delete Marlett
or it becomes corrupt, Windows will barf.

No idea why you've got BankGothic listed if it's not in your fonts folder.
Perhaps something installed in and failed to remove the entry.
--

Randy Birch
MS MVP Visual Basic
http://vbnet.mvps.org/
----------------------------------------------------------------------------
Read. Decide. Sign the petition to Microsoft.
http://classicvb.org/petition/
----------------------------------------------------------------------------



"Faraz Azhar" <itz_farazSPAM@hotSPAMmail.com> wrote in message
news:O2Wjvb%23XFHA.4036@tk2msftngp13.phx.gbl...
:
: > Easiest way, in general, may be to enumerate this key:
: >
: > HKLM\Software\Microsoft\Windows NT\CurrentVersion\Fonts
: >
:
: After performing a little test Ive come to know that some font names which
: exists in Screen.Fonts do not appear in that registry key.
:
: Examples:
: Courier New Baltic
: Courier New CE
: (.. and a few other types of Courier New)
: Marlet
: BankGothic
:
: Ok lets skip the Courier New variations.. the other two fonts named above:
: what does it mean? They are not installed? Howcome they are listed in
: Screen.Fonts ?
:
:
: > --
: > Working Without a .NET?
: > http://classicvb.org/petition
: >
: >
:
: I havent been able to update myself for the past 3 months.. how is this
: petition coming along? Any success?
: Keep it up!
:
: --
:
: Faraz Azhar
:
:
:

Faraz Azhar

2005-05-28, 8:55 pm

>
> No idea why you've got BankGothic listed if it's not in your fonts folder.
> Perhaps something installed in and failed to remove the entry.
> --


No you have it all wrong. It IS in the fonts folder, it also exists in
Screen.Fonts but it is not listed in that registry key.


Sponsored Links







Also available: Server administration forum archive | Web Design forum archive | Software forum archive | Hardware reviews archive

Copyright 2008 codecomments.com