Article View: borland.public.cppbuilder.nativeapi
Article #7987Re: Install a Font
From: Remy Lebeau (TeamB)
Date: Fri, 03 Dec 2004 18:36
Date: Fri, 03 Dec 2004 18:36
35 lines
2404 bytes
2404 bytes
"David Pedley" <david@pedley.ws> wrote in message news:41b08adc$1@newsgroups.borland.com... > Is it really as easy as checking to see whether it already > exists and then just calling AddFontResource()? Almost. The font is temporary to the current user session only. When your application is no longer using the font, particularly when being shut down, you need to call RemoveFontResource() to remove the font. Even if you do not do that, though, as soon as the user restarts Windows, the font will be gone anyway, so you have to call AddFontResource() again. AddFontResource() is meant to be used when your application uses custom fonts that may not be installed on the user's machine. You can distribute the font with your application, and then load the font at program startup and unload it at program shutdown. IF you want the font to be permanant, it must be installed into Windows' Fonts folder and into the Registry. > Does this automatically load the font file to the correct directory No. You have to do that yourself. AddFontResource() only loads the font data into memory from whereever you tell it the file resides. > or does one have to copy it there and then call the function Yes. > If the latter, how does one determine the correct folder to load the file into? Use SHGetSpecialFolderLocation() with the CSIDL_FONTS flg. Gambit
Technical Details
Message-ID:
<41b0b244@newsgroups.borland.com>Path:
arc1-ca.pugleaf.net!g2news1.google.com!news3.google.com!news4.google.com!news.glorb.com!newsgate.cistron.nl!feeder1.cambrium.nl!feed.tweaknews.nl!npeer.de.kpn-eurorings.net!feed.news.schlund.de!schlund.de!newsfeed01.sul.t-online.de!t-online.de!newsgroups.borland.com!not-for-mailReferences:
<41b041ec$1@newsgroups.borland.com> <41b04dfd@newsgroups.borland.com> <41b08adc$1@newsgroups.borland.com>Show Full Headers
Complete Article Headers
X-Google-Thread: 10cc67,5a75833e83dd607 X-Google-Attributes: gid10cc67,public X-Google-Language: ENGLISH,ASCII-7-bit From: "Remy Lebeau \(TeamB\)" <no.spam@no.spam.com> Newsgroups: borland.public.cppbuilder.nativeapi References: <41b041ec$1@newsgroups.borland.com> <41b04dfd@newsgroups.borland.com> <41b08adc$1@newsgroups.borland.com> Subject: Re: Install a Font Date: Fri, 3 Dec 2004 10:36:51 -0800 Lines: 37 X-Priority: 3 X-MSMail-Priority: Normal X-Newsreader: Microsoft Outlook Express 6.00.2800.1409 X-MimeOLE: Produced By Microsoft MimeOLE V6.00.2800.1409 NNTP-Posting-Host: 68.69.17.41 Message-ID: <41b0b244@newsgroups.borland.com> X-Trace: newsgroups.borland.com 1102099012 68.69.17.41 (3 Dec 2004 10:36:52 -0700) Path: arc1-ca.pugleaf.net!g2news1.google.com!news3.google.com!news4.google.com!news.glorb.com!newsgate.cistron.nl!feeder1.cambrium.nl!feed.tweaknews.nl!npeer.de.kpn-eurorings.net!feed.news.schlund.de!schlund.de!newsfeed01.sul.t-online.de!t-online.de!newsgroups.borland.com!not-for-mail