my own fonts in app

  • Thread starter Thread starter SharpCoderMP
  • Start date Start date
S

SharpCoderMP

hi,

can someone provide me with some clues about fonts? i need to ship my
own fonts with the app i'm working on. what is the best approach for
this scenario? should i install these fonts on a target machine during
setup of my application? if so, what if the fonts are removed? do i need
to verify their existence on every startup?

the most resonable solution that i can think of is to embed these fonts
as a resource, but then can i use them in my app directly from resource
file?
 
SharpCoderMP said:
hi,

can someone provide me with some clues about fonts? i need to ship my
own fonts with the app i'm working on. what is the best approach for
this scenario? should i install these fonts on a target machine during
setup of my application? if so, what if the fonts are removed? do i need
to verify their existence on every startup?

the most resonable solution that i can think of is to embed these fonts
as a resource, but then can i use them in my app directly from resource
file?

Create batch file that will copy your fonts into target mashine.Or into
Setup Project specify target location for fonts.
 
As an alternative to installing those fonts with the application you might
like to try embedding the fonts and using them via a private font
collection.

See Windows Forms Tips and Tricks for details.

--
Bob Powell [MVP]
Visual C#, System.Drawing

Ramuseco Limited .NET consulting
http://www.ramuseco.com

Find great Windows Forms articles in Windows Forms Tips and Tricks
http://www.bobpowell.net/tipstricks.htm

Answer those GDI+ questions with the GDI+ FAQ
http://www.bobpowell.net/faqmain.htm

All new articles provide code in C# and VB.NET.
Subscribe to the RSS feeds provided and never miss a new article.
 
thanks bob, this article was helpful.

do you know anything about licensing of the standard windows fonts? like
Arial or Tahoma? these fonts are always installed, but what if user
removes this font from the system and my app needs it? can i embed a
copy of this font within my application and use it only with
PrivateFontCollection?
 
There are no licensing issues for fonts that come with Windows. There may be
for non-standard fonts.

The way to deal with the problem you cite, which is likely to be very rare,
is to check that the font exists and if not, try another one that is
similar. For example, most Sans Serif fonts are similar so Arial, Verdana,
Tahoma etc can be thought of as rough equivalents. You can also specify a
"Sans serif" name for a font by using a FontFamily constructed with the
GenericFontFamilies enumeration.

For specific fonts that you may wish to use, you can install them by copying
them to the Windows\Fonts folder (or equivalent on the target machine, see
the installer special destination folders) or use the PrivateFontCollection
as shown in the article.

--
Bob Powell [MVP]
Visual C#, System.Drawing

Ramuseco Limited .NET consulting
http://www.ramuseco.com

Find great Windows Forms articles in Windows Forms Tips and Tricks
http://www.bobpowell.net/tipstricks.htm

Answer those GDI+ questions with the GDI+ FAQ
http://www.bobpowell.net/faqmain.htm

All new articles provide code in C# and VB.NET.
Subscribe to the RSS feeds provided and never miss a new article.
 
Back
Top