Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • Home
  • SEARCH
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 92547
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 10, 20262026-05-10T23:12:14+00:00 2026-05-10T23:12:14+00:00

Why the FontFamily param of the Font object is a string and not an

  • 0

Why the FontFamily param of the Font object is a string and not an enum?

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. 2026-05-10T23:12:15+00:00Added an answer on May 10, 2026 at 11:12 pm

    FontFamily refers to the name of the Font. While you could use ‘monospace’ or ‘serif’ I wouldn’t think it would be supported by .Net.

    Remember, using a enum would be impossible. A enum is a static compile-time feature, which means that it can’t ‘generate’ a enum dynamically from fonts on your system. Indeed, including anything this specific in a language would probably be a poor idea. Even if this was supported, the user’s machine wouldn’t have the same fonts as yours – some fonts would be incorrectly included in the list and some excluded (because once compiled an enum becomes ‘final’).

    Enums are a convenient store of integral constants and NOTHING else. Each item in a enum has a convenient name and a value, even if you don’t specify it. The following two enums are the same.

    public enum MyEnum {   A = 1,   B = 2 }  public enum FooEnum {   A,   B } 

    And there are two other problems, enum names can not contain spaces, where font names can. Getting the fields from an enum is not a trivial task (it requires a lot of reflection code).

    The following code will get you a list of fonts (you will need to add System.Drawing as a reference):

        using System;     using System.Collections.Generic;     using System.Linq;     using System.Text;     using System.Drawing.Text;     using System.Drawing;      namespace ConsoleApplication19     {         class Program         {             static void Main(string[] args)             {                 InstalledFontCollection ifc = new InstalledFontCollection();                  foreach (FontFamily o in ifc.Families)                 {                     Console.WriteLine(o.Name);                 }                 Console.ReadLine();             }         }     } 
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Ask A Question

Stats

  • Questions 52k
  • Answers 52k
  • Best Answers 0
  • User 1
  • Popular
  • Answers
  • Editorial Team

    How to approach applying for a job at a company ...

    • 7 Answers
  • Editorial Team

    How to handle personal stress caused by utterly incompetent and ...

    • 5 Answers
  • Editorial Team

    What is a programmer’s life like?

    • 5 Answers
  • added an answer Beautiful Soup is a Python library designed for parsing web… May 11, 2026 at 6:42 am
  • added an answer Mechanize is my favorite; great high-level browsing capabilities (super-simple form… May 11, 2026 at 6:42 am
  • added an answer Clarion is a programming language. Don't know it myself. Parts… May 11, 2026 at 6:42 am

Top Members

Trending Tags

analytics british company computer developers django employee employer english facebook french google interview javascript language life php programmer programs salary

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.