Re: Using uninstalled true type fonts

"Peter W." <[email protected]>
Newsgroups gmane.comp.lang.delphi.programming
Message-ID <[email protected]>
Hi Tom & All,

   After doing an AddFontResource will my font be available to ONLY 
my application or all Windows applications?

Regards,
--- Peter W. :-)))
Canberra, Australia

--- In [email protected], "Tom Hahn" <thahn@h...> 
wrote:
> > -----Original Message-----
> > From: Peter W. [mailto:pew@d...]
> > Sent: Thursday, July 24, 2003 9:26 PM
> > To: [email protected]
> > Subject: [Delphi] Using uninstalled true type fonts
> >
> >
> >    I remember hearing some time ago that it is possible to use
> > Windows true type fonts without them being installed if you have
> > the .ttf file. That is what I want to do. The reason is that the 
pc I
> > use at work does not permit installing fonts. I want to write an
> > application which uses a richedit to display different fonts and 
font
> > sizes including fonts which are not installed but I have on 
disk. I
> > will need to be able to print these out.
> >
> >    How can I do this. Does anyone have some sample code?
> >
> Peter:
> 
> I think this will do what you want.
> 
> 
> //Using a font in an application when it is not installed in 
Windows.
> / Load it in the OnCreate event of a form
> 
> procedure TForm1.FormCreate(Sender: TObject);
> begin
>   AddFontResource('c:\FONTS\MyFont.TTF');
>   SendMessage(HWND_BROADCAST, WM_FONTCHANGE, 0, 0);
> end;
> 
> //Free it before application terminates
> 
> procedure TForm1.FormClose (Sender: TObject; var Action: 
TCloseAction);
> begin
>   RemoveFontResource('C:\FONTS\MyFont.TTF');
>   SendMessage(HWND_BROADCAST, WM_FONTCHANGE, 0, 0);
> end;
> 
> 
> HTH,
> Regards,
> Tom


------------------------ Yahoo! Groups Sponsor ---------------------~-->
Buy Toner for Your Printer or Fax at LaserTonerSuperstore.com-Save 55%!
We have your brand: HP, IBM, Canon, Xerox, Apple and many more for less!
http://www.LaserTonerSuperstore.com
http://us.click.yahoo.com/YmQqWC/qicGAA/ySSFAA/i7folB/TM
---------------------------------------------------------------------~->

CodeCoffer - new Delphi code protection Tool!
http://www.delphicollection.com/public/CodeCoffer.htm
---------------------------------------------------------------
Unsubscribe:[email protected]
List owner:[email protected]
--------------------------------------------------------------- 

Your use of Yahoo! Groups is subject to http://docs.yahoo.com/info/terms/
lmpx.com only provides a reader for public news (NNTP) servers. It is not affiliated with the servers or forums shown here and is not responsible for the content of articles, which is written by their respective authors.