Skip to content
  • Categories
  • Recent
  • Tags
  • Popular
  • World
  • Users
  • Groups
Skins
  • Light
  • Cerulean
  • Cosmo
  • Flatly
  • Journal
  • Litera
  • Lumen
  • Lux
  • Materia
  • Minty
  • Morph
  • Pulse
  • Sandstone
  • Simplex
  • Sketchy
  • Spacelab
  • United
  • Yeti
  • Zephyr
  • Dark
  • Cyborg
  • Darkly
  • Quartz
  • Slate
  • Solar
  • Superhero
  • Vapor

  • Default (No Skin)
  • No Skin
Collapse
Code Project
  1. Home
  2. General Programming
  3. C#
  4. Using Open-Type font in C#

Using Open-Type font in C#

Scheduled Pinned Locked Moved C#
c++csharpphpcsswinforms
1 Posts 1 Posters 0 Views 1 Watching
  • Oldest to Newest
  • Newest to Oldest
  • Most Votes
Reply
  • Reply as topic
Log in to reply
This topic has been deleted. Only users with topic management privileges can see it.
  • A Offline
    A Offline
    Alan Balkany
    wrote on last edited by
    #1

    Hi all, My application lets a user select a True Type font from the FontFamily.Families enumeration:

            foreach (FontFamily ff in FontFamily.Families)
            {
                if(ff.IsStyleAvailable(FontStyle.Regular))
                    fontCombo.Items.Add(ff.Name);                                             
            }
    

    This doesn't work for Open Type fonts, e.g. I just installed Costura Light, and it's now available in MS Word, but invisible to my enumeration above. Googling doesn't reveal any solution to this; all the sites just assume the font is there after you install it. What do I have to do to make Open-Type fonts available? Thanks! ========================= EDIT -- THERE'S NO SIMPLE WAY TO DO THIS: GDI+ ONLY SUPPORTS TRUE TYPE. THERE'S A CONVOLUTED WAY TO USE GDI FOR OPEN-TYPE FONTS FROM MANAGED C++ DESCRIBED HERE: http://www.codeguru.com/cpp/g-m/gdi/fonthandlinganddetection/article.php/c10621/Make-GDI-Less-Finicky-About-Fonts.htm[^]

    "Microsoft -- Adding unnecessary complexity to your work since 1987!"

    1 Reply Last reply
    0
    Reply
    • Reply as topic
    Log in to reply
    • Oldest to Newest
    • Newest to Oldest
    • Most Votes


    • Login

    • Don't have an account? Register

    • Login or register to search.
    • First post
      Last post
    0
    • Categories
    • Recent
    • Tags
    • Popular
    • World
    • Users
    • Groups