Home All Groups Group Topic Archive Search About

Retrieving a list of available fonts on system.

Author
20 Apr 2006 9:05 PM
Jonesgj
Hi,


How would I return a list of available fonts. I'm writing a simple word
processor, and have got the font dialog working, but wanted to create a
toolbar dropdown with a list of fonts in, instead.

I'm not a 'hardened programmer'   ;-)    so any simple examples out there??

Thanks in antipation

jonesG

Author
20 Apr 2006 9:35 PM
james
Show quote Hide quote
"Jonesgj" <a@b.com> wrote in message news:YeednZhQhY9ga9rZRVny1g@bt.com...
> Hi,
>
>
> How would I return a list of available fonts. I'm writing a simple word
> processor, and have got the font dialog working, but wanted to create a
> toolbar dropdown with a list of fonts in, instead.
>
> I'm not a 'hardened programmer'   ;-)    so any simple examples out
> there??
>
> Thanks in antipation
>
> jonesG
>

VB2005 code:


For Each FNT In FontFamily.Families

ComboBox1.Items.Add(FNT.Name)

Next



This will loop thru and display all of the Fonts on your system.  But, not
True Type Fonts.

james
Author
20 Apr 2006 10:38 PM
Herfried K. Wagner [MVP]
"Jonesgj" <a@b.com> schrieb:
> How would I return a list of available fonts. I'm writing a simple word
> processor, and have got the font dialog working, but wanted to create a
> toolbar dropdown with a list of fonts in, instead.

\\\
Imports System.Drawing
..
..
..
For Each fntfam As FontFamily In FontFamily.Families
    Console.WriteLine(fntfam.Name)
Next fntfam
///

<URL:http://dotnet.mvps.org/dotnet/samples/controls/#FontList>

--
M S   Herfried K. Wagner
M V P  <URL:http://dotnet.mvps.org/>
V B   <URL:http://classicvb.org/petition/>
Author
21 Apr 2006 9:05 AM
Jonesgj
Thanks James and Hefried.

Best wishes

Jonesgj


Show quoteHide quote
"Herfried K. Wagner [MVP]" <hirf-spam-me-here@gmx.at> wrote in message
news:eL5$nsMZGHA.4144@TK2MSFTNGP04.phx.gbl...
> "Jonesgj" <a@b.com> schrieb:
>> How would I return a list of available fonts. I'm writing a simple word
>> processor, and have got the font dialog working, but wanted to create a
>> toolbar dropdown with a list of fonts in, instead.
>
> \\\
> Imports System.Drawing
> .
> .
> .
> For Each fntfam As FontFamily In FontFamily.Families
>    Console.WriteLine(fntfam.Name)
> Next fntfam
> ///
>
> <URL:http://dotnet.mvps.org/dotnet/samples/controls/#FontList>
>
> --
> M S   Herfried K. Wagner
> M V P  <URL:http://dotnet.mvps.org/>
> V B   <URL:http://classicvb.org/petition/>