Link to home
Start Free TrialLog in
Avatar of derekthornton
derekthornton

asked on

Random fonts?

Alright. I'm generating Test Data for this OCR Thing, I have a program that writes random numbers and characters to a specified number of images in a sequential order. I'd like to add a bit more to it, anyone know how I can make something do Random Fonts?
ASKER CERTIFIED SOLUTION
Avatar of jj819430
jj819430

Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial
Avatar of derekthornton
derekthornton

ASKER

Is there any way I can pipe all the system fonts into an array?
you can get all the fonts asociated with a specified graphics from the static member 'Families' of the FontFamily class

A.
     foreach (FontFamily ff in FontFamily.Families)
      {
            Console.WriteLine(ff.Name);
      }

HTH
Smg.
oops, sorry, hadn't seen your post when I submitted.
I think you can load all system fonts into array this way
private void button1_Click(object sender, System.EventArgs e)
{
    string[] ArrFont;
    InstalledFontCollection ifc = new InstalledFontCollection();
    FontFamily[] ffs = ifc.Families;
    //Font f;
    foreach(FontFamily ff in ffs)
    {
       ArrFont[ff.ToString()];
    }
}
Wow.That worked very well too, TransBind.
Go Here
https://www.experts-exchange.com/questions/20823173/For-Advanced-Help-with-Number-Q-20823057.html

for some more Points, Trans.