Click here to Skip to main content
11,928,732 members (55,127 online)
Click here to Skip to main content
Add your own
alternative version


11 bookmarked

Finding a Font file from a Font name (VB.Net version)

, 20 Nov 2005 CPOL
Rate this:
Please Sign up or sign in to vote.
how to get the Font File Name from the Font Name

Sample Image - Finding_a_Font_file.jpg

Finding a Font file from a Font name (VB.NET version)

Someone asked me to help him getting the "font file's name" from the "font name" (e.g. the file of "Arial" is "ARIAL.TTF" and located in %systemroot%\fonts folder); I found a nice solution on CodeProject site: It was written using VisualC++ 6; I converted the code into VB.NET

What it Does

Retrieve font file name from a font's display name (which is name you will see in MS Word font combobox, for example). All Win32 versions of Windows, going back to original Win95, have a directory called "Fonts" under Windows directory. This directory is mirrored in registry under key HKLM\Software\Microsoft\Windows\CurrentVersion\Fonts. Except, of course, under NT, where "Windows" is replaced with "Windows NT".
I am searching the registery for the font name if not found I append "(True Type)" if not found I append "(All Res)".

How to Use It

There are 2 main functions in a VB.NET module

  1. getOSVer to get the OS version (to detrmine which registry key will be used)
  2. RegValue to read a value from the registry


Special Thanks to Hans Dietrich for his nice article.


This software is released into the public domain. You are free to use it in any way you like. If you modify it or extend it, please to consider posting new code here for everyone to share. This software is provided "as is" with no expressed or implied warranty. I accept no liability for any damage or loss of business that this software may cause.


This article, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)


About the Author

No Biography provided

You may also be interested in...

Comments and Discussions

GeneralMy vote of 1 Pin
Mario Majcica22-Sep-11 0:38
memberMario Majcica22-Sep-11 0:38 
GeneralOSVersion Pin
chriha18-Mar-08 23:42
memberchriha18-Mar-08 23:42 

General General    News News    Suggestion Suggestion    Question Question    Bug Bug    Answer Answer    Joke Joke    Praise Praise    Rant Rant    Admin Admin   

Use Ctrl+Left/Right to switch messages, Ctrl+Up/Down to switch threads, Ctrl+Shift+Left/Right to switch pages.

| Advertise | Privacy | Terms of Use | Mobile
Web04 | 2.8.151126.1 | Last Updated 20 Nov 2005
Article Copyright 2005 by Mohamed Elzahaby
Everything else Copyright © CodeProject, 1999-2015
Layout: fixed | fluid