Writing font details to a txt file

L

Lee

Hi,

How do you write out a Font's details to a txt file? So you can eventually
read it back in a select the font!

thanks in advance
 
J

jeff

General you don't have a system default font, but in general the default is
times new roman. Event for default web pages.

What do you mean by write font details to a text file? Where are you
getting the details from?

Please be more specific.
 
L

Lee

I have sorted the font saving thing.... thanks,

times new roman? I am creating an app that loads and saves the currently
used font, but... when first run on a system it will have to get a font from
somewhere! using times new roman is fine, but what happens if some idiot
deletes that font from their system, and then my app tries to load it? I
had assumed that there may be a default system font!

thanks again
 
P

Paul E Collins

Lee said:
I am creating an app that loads and saves the currently used
font, but... when first run on a system it will have to get a font
from somewhere! using times new roman is fine, but what
happens if some idiot deletes that font from their system,
and then my app tries to load it?

Well, it won't work. Try not to rely on fonts. They're changeable. The
user is certainly not an "idiot" for adding or removing fonts. It's
more idiotic for a program to complain and fail if it can't find a
font. It's only text, after all.
I had assumed that there may be a default system font!

You can use "MS Shell Dlg" to get the default Windows font used for
user interface controls, but it's not a real font, just a "pointer" to
the one that is being used on that system.

Eq.
 
J

Jon Skeet [C# MVP]

Lee said:
I have sorted the font saving thing.... thanks,

times new roman? I am creating an app that loads and saves the currently
used font, but... when first run on a system it will have to get a font from
somewhere! using times new roman is fine, but what happens if some idiot
deletes that font from their system, and then my app tries to load it? I
had assumed that there may be a default system font!

Have a look at SystemFonts.DefaultFont.
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top