473,749 Members | 2,660 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

installing a font by using code

Hi,
i tried to install a font by using code like:

res = CreateScalableF ontResource(0, Fontlst.Item(i) , Fontlst.Item(i) ,
String.Empty)
res = AddFontResource (Fontlst.Item(i ))

That works fine when the pc does not reboot,
however after a reboot these added fonts disappear.

Is there a way to keep them installed also after a reboot?
There was a doc saying to find the fonts in the registry under the local
machine\microso ft\software\cur rentversion\fon ts, but under xp this key does
not exist.

Thanks for your help.

Willie.
Nov 21 '05 #1
1 1318
Hi,

Here is an example that installs a barcode font and displays a
sample.

www.onteorasoftware.com/downloads/barcode.zip

Ken
------------------------------
"Willie jan" <un*****@unkown .com> wrote in message
news:41******** *************** @news.euronet.n l...
Hi,
i tried to install a font by using code like:

res = CreateScalableF ontResource(0, Fontlst.Item(i) , Fontlst.Item(i) ,
String.Empty)
res = AddFontResource (Fontlst.Item(i ))

That works fine when the pc does not reboot,
however after a reboot these added fonts disappear.

Is there a way to keep them installed also after a reboot?
There was a doc saying to find the fonts in the registry under the local
machine\microso ft\software\cur rentversion\fon ts, but under xp this key does
not exist.

Thanks for your help.

Willie.

Nov 21 '05 #2

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

Similar topics

3
7218
by: Barry Anderberg | last post by:
I'm using the .NET Memory Profiler by Sci Tech and I wrote a little test application to verify something odd I observed and it appears that System.Drawing.Font fails to dispose of its FontFamily. I run the following code: // BEGIN while( true ) { System.Drawing.Graphics dc=lblClock.CreateGraphics();
4
4945
by: Eric Eggermann | last post by:
Hello all, I'm building an app that lays out and prints flash cards. Now the card might be any size, but when the user is working on the card, I draw the preview isotropically, as large as possible. The user specifies a font size for the document, but I need to scale this for the preview. The scaling code I have is very close but not right. I can only notice that it's wrong occasionally when I have a piece of text that wraps, and the...
0
2616
by: Martin Streller | last post by:
Hello, The code below represents a simple ownerdrawn, Listview class in C#. Its purpose is to avoid the flicker of the MS ListView. So I can't fall back to their one. Does anybody know why I cannot change the size of the ListView's font (ListView.Font) from e.g.
2
9494
by: Johan Mårtensson | last post by:
Hi I was wondering if anyone knows how to install a system font using C#? I know it doesn´t do the trick to simply copy the font to the font directory, it just doesn´t become active. Any ideas? /Johan
0
1074
by: VMI | last post by:
How can I install a font through my program? I'm currently using AddFontResource(sPath) and it works as long as I open the Windows\Fonts folder after I execute AddFontResource. If I never open it, it won't install. I tried to use "SendMessage( HWND_BROADCAST, WM_FONTCHANGE, 0, 0 );" but I don't know what values HWND_BROADCAST, WM_FONTCHANGE have. The font I'm trying to install is BC_POST.TTF . Any help is appreciated. Thanks.
4
6926
by: Johan | last post by:
Hi How would I go about installing a font file on WinXP? I have tried this and it won't get installed properly, private void installFont() { File.Copy( Application.StartupPath+"\\Lucon1.ttf", this.fontDir+"\\Lucon1.ttf", true );
7
2918
by: Adam | last post by:
Im trying to add an httphandler for all *.sgf file extensions. I have developed the handler, 1. installed it into the gac 2. added it to the machine.config: <httpHandlers> <add verb="*" path="*.sgf" type="CustomExtensionHandler, Extenders.CustomExtensionHandler, Version=1.0.0.0, Culture=neutral, PublicKeyToken=d831d925597c1031" validate="True"/> </httpHandlers>
11
20224
by: Don | last post by:
QUESTIONS: 1. Has anyone figured out how to successfully install the Office 97 Pro Service Release 2 patch in Vista? 2. Has anyone successfully installed an Office 97 Pro CD (SR2 version) in Vista? DETAILS: My setup: Dell Inspiron notebook with Vista Business edition My CD: Office 97 Professional (Service Release 1) Upgrade
4
7948
by: ganesh | last post by:
I have a piece of C# code using ShellExecute API to install a TrueType font on Windows XP. The font is installed correctly and is visible with programs like WinWord. However, the font file seems to be locked down and cannot be deleted by administrators, unless the machine is rebooted. The code is as below: class Program {
0
8997
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, people are often confused as to whether an ONU can Work As a Router. In this blog post, we’ll explore What is ONU, What Is Router, ONU & Router’s main usage, and What is the difference between ONU and Router. Let’s take a closer look ! Part I. Meaning of...
0
8833
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can effortlessly switch the default language on Windows 10 without reinstalling. I'll walk you through it. First, let's disable language synchronization. With a Microsoft account, language settings sync across devices. To prevent any complications,...
0
9568
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, it seems that the internal comparison operator "<=>" tries to promote arguments from unsigned to signed. This is as boiled down as I can make it. Here is my compilation command: g++-12 -std=c++20 -Wnarrowing bit_field.cpp Here is the code in...
0
9389
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 tapestry of website design and digital marketing. It's not merely about having a website; it's about crafting an immersive digital experience that captivates audiences and drives business growth. The Art of Business Website Design Your website is...
0
8257
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, and deployment—without human intervention. Imagine an AI that can take a project description, break it down, write the code, debug it, and then launch it, all on its own.... Now, this would greatly impact the work of software developers. The idea...
0
4709
by: TSSRALBI | last post by:
Hello I'm a network technician in training and I need your help. I am currently learning how to create and manage the different types of VPNs and I have a question about LAN-to-LAN VPNs. The last exercise I practiced was to create a LAN-to-LAN VPN between two Pfsense firewalls, by using IPSEC protocols. I succeeded, with both firewalls in the same network. But I'm wondering if it's possible to do the same thing, with 2 Pfsense firewalls...
0
4881
by: adsilva | last post by:
A Windows Forms form does not have the event Unload, like VB6. What one acts like?
1
3320
by: 6302768590 | last post by:
Hai team i want code for transfer the data from one system to another through IP address by using C# our system has to for every 5mins then we have to update the data what the data is updated we have to send another system
2
2794
muto222
by: muto222 | last post by:
How can i add a mobile payment intergratation into php mysql website.

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.