• Status: Solved
  • Priority: Medium
  • Security: Public
  • Views: 213
  • Last Modified:

A question about fonts (500 points)

Does Visual Studio 2008 (VB) provide any methods for extracting font details and properties?

I know that I can use fontstyle to get "Regular", "Italis" etc.

What I am looking for is any methods for extracting such details as font family, font metrics, description, trademarks etc
0
jindalee
Asked:
jindalee
  • 2
  • 2
1 Solution
 
UnifiedISCommented:
The font class exposes some details
0
 
wht1986Commented:
to get a list of all installed fonts on the system you can use:
System.Drawing.Text.InstalledFontCollection c = new System.Drawing.Text.InstalledFontCollection();
foreach( System.Drawing.FontFamily f in c.Families)
{
   // query about each here
}

Open in new window

0
 
jindaleeAuthor Commented:
Thank you wht1986.

I can use the InstalledFontCollection to get some of the detail I have t get such as family and metrics. However, for the project upon whic I am working, these details are of less importance than details such as embedded descriptions, licences, trademarks, copyright etc.

Microsoft provides a tool that shows the sort of stuff I have to collect for the project. The tool is at http://www.microsoft.com/typography/PropertiesEditor.mspx. Unfortunately I cannot find anything on the MS sites that describe how to get at the information embedded in the font file.

The attached images show examples of the sort of stuff you can extract extract. (They are snapshots of the MS tool to which I refer.)
fontproperties.jpg
fontproperties2.jpg
fontproperties3.jpg
0
 
wht1986Commented:
Hmm I dont know of any libraries that read the font extensions, but here is a few links that might help

Font Specification
http://www.microsoft.com/typography/AboutFontsOverview.mspx

some C code that can read TTF header data
http://www.codeproject.com/KB/GDI/fontnamefromfile.aspx
0
 
jindaleeAuthor Commented:
Thank you. The link yp coderproject does the trick. The author of that article nor only explains ttfs fonts but provides code, albeit in C that I'll need to translate.
0

Featured Post

Free Tool: ZipGrep

ZipGrep is a utility that can list and search zip (.war, .ear, .jar, etc) archives for text patterns, without the need to extract the archive's contents.

One of a set of tools we're offering as a way to say thank you for being a part of the community.

  • 2
  • 2
Tackle projects and never again get stuck behind a technical roadblock.
Join Now