473,406 Members | 2,769 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,406 software developers and data experts.

Packaging fonts into a windows exe

hi there,

can anyone tell me whether it is possible to pack a font into a .net
2.0 windows application (resource)? i need to use the font within the
application, but i don't want to distribute it as a ttf file. i've read
on msdn that this is possible through wpf in .net 3.0 but can't find
any information on how to do it in 2.0.

any help is highly appreciated. kind regards,

matthias
--

Mar 26 '08 #1
4 2110
On Mar 26, 1:06*pm, "Matthias S."
<matthias.st_SP_AM_TR_...@googlemail.comwrote:
hi there,

can anyone tell me whether it is possible to pack a font into a .net
2.0 windows application (resource)? i need to use the font within the
application, but i don't want to distribute it as a ttf file. i've read
on msdn that this is possible through wpf in .net 3.0 but can't find
any information on how to do it in 2.0.

any help is highly appreciated. kind regards,

matthias
--
Hi,

You can always pack it as a resource in the .EXE and then @ runtime
create a temp file with the form and use it like that.
Note that you would have to pack it as just another file though.
Mar 26 '08 #2
i don't fully understand your answer. do you mean i should pack the
font into another file and then extract it from there? like for
example, encrypt the font, decrypt it and use it, and on application
exit encrypt it again? could you please provide some more detailed
information?

all i need is to use a font in my applikation (it doesn't have to be
necessarily stored in the resource file) but i don't want to install
the font on the users machine. i don't even want, that the user can
install the font himself.

kind regards,

matthias
--

Ignacio Machin ( .NET/ C# MVP ) wrote:
On Mar 26, 1:06*pm, "Matthias S."
<matthias.st_SP_AM_TR_...@googlemail.comwrote:
hi there,

can anyone tell me whether it is possible to pack a font into a .net
2.0 windows application (resource)? i need to use the font within
the application, but i don't want to distribute it as a ttf file.
i've read on msdn that this is possible through wpf in .net 3.0 but
can't find any information on how to do it in 2.0.

any help is highly appreciated. kind regards,

matthias
--

Hi,

You can always pack it as a resource in the .EXE and then @ runtime
create a temp file with the form and use it like that.
Note that you would have to pack it as just another file though.
Mar 26 '08 #3
Matthias S. wrote:
hi there,

can anyone tell me whether it is possible to pack a font into a .net
2.0 windows application (resource)? i need to use the font within the
application, but i don't want to distribute it as a ttf file. i've
read on msdn that this is possible through wpf in .net 3.0 but can't
find any information on how to do it in 2.0.
p/invoke AddFontMemResourceEx before calling InitializeComponent (which sets
the fonts for .NET controls).
>
any help is highly appreciated. kind regards,

matthias

Mar 26 '08 #4
On Mar 26, 3:42*pm, "Matthias S."
<matthias.st_SP_AM_TR_...@googlemail.comwrote:
i don't fully understand your answer. do you mean i should pack the
font into another file and then extract it from there? like for
example, encrypt the font, decrypt it and use it, and on application
exit encrypt it again? could you please provide some more detailed
information?
No,
What I mean is that you can embedd ANY file of any kind as a resource
in your EXE (or DLL) and later extract it (take a look at this post of
mine from a time ago
http://groups.google.com/group/micro...6130995d18d4e5
)

So after you extract the file you can try to install the font.
Mar 26 '08 #5

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

66
by: Alan Illeman | last post by:
Is there a listing of serif fonts and san-serif fonts somewhere? Regards, Alan -- A: Because it messes up the order in which people normally read text. Q: Why is it such a bad thing? A:...
4
by: Leora Wenger | last post by:
We moved some pages of Japanese, Korean and Chinese from one server to another. In doing so, the users with Windows XP could still see the Asian fonts. However, a user with Windows 2000 could no...
4
by: L | last post by:
Hi there, Does C# support OpenType fonts? My c# application is not recognizing OpenType fonts. Thanks, Lalasa.
4
by: Aaron Gray | last post by:
Is there anyway to get a list of all the availiable fonts in Javascript ? Aaron
2
by: Luc | last post by:
I saw a few posts on this newsgroup about it but nothing to help me resolve this problem: We designed a window in .NET on a platform using small fonts (120 ppp). But this window will run on...
70
by: axlq | last post by:
I'm trying to design my style sheets such that my pages have similar-looking fonts different platforms (Linux, Mac, Adobe, X-Windows, MS Windows, etc). The problem is, a font on one platform...
15
by: John Nagle | last post by:
I've been installing Python and its supporting packages on a dedicated server with Fedora Core 6 for about a day now. This is a standard dedicated rackmount server in a colocation facility,...
24
by: Donn Ingle | last post by:
Hello, I hope someone can illuminate this situation for me. Here's the nutshell: 1. On start I call locale.setlocale(locale.LC_ALL,''), the getlocale. 2. If this returns "C" or anything...
8
by: andreas | last post by:
How can I choose some fonts in programs so that they are always avalable for the program at other computers, can I put them in some resources? Thanks for any response
0
by: emmanuelkatto | last post by:
Hi All, I am Emmanuel katto from Uganda. I want to ask what challenges you've faced while migrating a website to cloud. Please let me know. Thanks! Emmanuel
1
by: Sonnysonu | last post by:
This is the data of csv file 1 2 3 1 2 3 1 2 3 1 2 3 2 3 2 3 3 the lengths should be different i have to store the data by column-wise with in the specific length. suppose the i have to...
0
by: Hystou | last post by:
There are some requirements for setting up RAID: 1. The motherboard and BIOS support RAID configuration. 2. The motherboard has 2 or more available SATA protocol SSD/HDD slots (including MSATA, M.2...
0
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However,...
0
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers,...
0
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven...
0
by: Hystou | last post by:
Overview: Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows...
0
tracyyun
by: tracyyun | last post by:
Dear forum friends, With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each...
0
agi2029
by: agi2029 | last post by:
Let's talk about the concept of autonomous AI software engineers and no-code agents. These AIs are designed to manage the entire lifecycle of a software development project—planning, coding, testing,...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.