Using a Font

  • Thread starter Thread starter Alberto
  • Start date Start date
A

Alberto

What happens if you use a font in your application and the computer where it
runs finally doesn't have this font installed?

Thank you
 
What happens if you use a font in your application and the computer where
it runs finally doesn't have this font installed?

Windows will substitute a font based on how much information you've provided
about the font you were trying to use (like whether it's proportional,
serif, etc.). It tries to make a good guess.
 
Alberto said:
What happens if you use a font in your application and the computer where
it runs finally doesn't have this font installed?

Thank you

Then the client won't see your font.

However, you can package the font up as an embedded resource and have your
program installer install the font as part of the program.

-Scott
 
Alberto said:
What happens if you use a font in your application and the computer where
it runs finally doesn't have this font installed?

Thank you
Hi Alberto,

As the others have said.

Don't know what you are programming, and probably you don't want to do
the following, but you never know.

I found this solution for a little game I am working on.
Wanted to use a custom font and didn't want it to be installed on the user's
system.

// Custom font collection
private PrivateFontCollection _PrivateFonts = new PrivateFontCollection();

// Load a custom font in the collection
PrivateFonts.AddFontFile("your_font_file.ttf");

// Select a custom font from the collection
int fontSize = 24;
Font MyFont = new System.Drawing.Font(PrivateFonts.Families[0], fontSize);
// You can also use onther Font constructors to define font styles and such.

And then you can use MyFont where you want.
Only problem with this is that you have to set the font in your code...
everywhere! :)
Maybe there are better/other tricks to use a private font, I didn't
investigate that
since I only use it as a template for directx fonts.

regards,
Marcel
 
Back
Top