Article View: be.comp.os.windows
Article #33996Re: HELP !! Hoe een nieuw font in Windows SE?
From: Tim Froidcoeur
Date: Fri, 04 Aug 2000 00:00
Date: Fri, 04 Aug 2000 00:00
92 lines
4937 bytes
4937 bytes
En wat is er mis met naar de fonts directory te gaan (via control panel of c:\windows\fonts) en dan File -> Install new font? Ik weet het, het is niet echt cool... Als ge echter op zoek zijt naar een programatotische en coolere manier om uw fonts te installeren, dan is blijkbaar de enige methode te foefelen met de registry. Het volgende citaat uit MSDN zou moeten helpen om dat te doen. 't komt erop neer AddFontResource te gebruiken. greetz Tim Froidcoeur tim.froidcoeur@philips.com Installing Fonts By carrying out these steps, you can write a single font installation routine that works for both Windows NT/Windows 2000 and Windows 95/98: If you use the installer, fonts are registered automatically. Determine whether the platform is Windows 95/98 or Windows NT/Windows 2000. This distinction is important because Windows 95/98 allows a shared network installation where most system files, including fonts, are stored on a centrally managed server. To determine the platform, look in the following registry location for a "SharedDir" value. HKeyLocalMachine\Software\Microsoft\Windows\CurrentVersion\Setup The data value of "SharedDir" is the UNC name of the server and sharepoint of the shared directory. In most cases, a shared directory is marked as read-only by the system administrator, so your installation program should also check to see if it can write to this location. If it cannot, it should let the user install the fonts in a different location, or stop the setup process. Check whether the TrueType� font being installed is already present on the system by using the EnumFontFamilies function. If that font is present, the program should check to see if its version is newer by matching the installed font name with the filename on the disk. For Windows 95/98, the font name is stored in the following registry location. HKeyLocalMachine\Software\Microsoft\Windows\CurrentVersion\Fonts For Windows NT/Windows 2000, the font name is stored in the following registry location. HKeyLocalMachine\Software\Microsoft\Windows NT\CurrentVersion\Fonts The subkeys in this registry location contain the full name of the font file as the value key, followed by the filename of the .TTF file as the key data. If the filename in the registry is just a filename with no path information, the font is installed in the \WINDOWS\FONTS directory for Windows 95/98 or the \WINDOWS\SYSTEM directory for Windows NT/Windows 2000. Because TrueType font files do not carry a version resource, your program will need to retrieve the version string from the 'name' table in the .TTF file. Before copying the .TTF file to the appropriate directory, the installation program should check to see if the filename already exists in that directory. If it does, the program should rename your .TTF file to some other name, perhaps by appending a number to the end of the basename. After copying the .TTF file to the user's disk, the installation program should inform the system that it wants the font to be available. The program should pass it the .TTF filename directly by using the AddFontResource function. Windows 95/98 and Windows NT/Windows 2000 do not require the creation of .FOT files. To make the font installation permanent, the installation program should add the font name and filename to the registry by writing both of the values to the following registry location. HKeyLocalMachine\Software\Microsoft\Windows\CurrentVersion\Fonts Built on Friday, November 12, 1999 "AmNeStY" <jorisbeckers@wanadoo.be> wrote in message news:8lu5eo$1toq$1@buty.wanadoo.nl... > Het enige dat ik moet doen is de font kopieeren en dan een keer openen > > > Marty Le Roy <martin.hugo@planet.nl> schreef in berichtnieuws > 8lsml6$7vog4$1@reader4.wxs.nl... > > Hallo, > > > > Hoe kan ik een font installeren (lettertype) bij Windows SE? Alleen het > > kopieeren van het TTF bestand is bij de SE versie niet voldoende, > aangezien > > het de fontlijst nu in het register zet. Heb geprobeerd maar krijg het > niet > > voor elkaar. > > Is hier een programma voor te vinden? > > > > Graag spoedig > > Marty. > > > > > > >
Technical Details
Message-ID:
<8mefu6$cel$1@porthos.nl.uu.net>Path:
arc1-ca.pugleaf.net!unknown!not-for-mailReferences:
<8lsml6$7vog4$1@reader4.wxs.nl> <8lu5eo$1toq$1@buty.wanadoo.nl>Show Full Headers
Complete Article Headers
X-Google-Language: ENGLISH,ASCII X-Google-Thread: 10b37c,cce79255c4220018 X-Google-Attributes: gid10b37c,public From: "Tim Froidcoeur" <tim.froidcoeur@philips.com> Subject: Re: HELP !! Hoe een nieuw font in Windows SE? Date: 2000/08/04 Message-ID: <8mefu6$cel$1@porthos.nl.uu.net> X-Deja-AN: 654414339 References: <8lsml6$7vog4$1@reader4.wxs.nl> <8lu5eo$1toq$1@buty.wanadoo.nl> X-Priority: 3 X-MimeOLE: Produced By Microsoft MimeOLE V5.00.2919.6600 X-Complaints-To: abuse@nl.uu.net X-Trace: porthos.nl.uu.net 965395206 12757 212.153.190.2 (4 Aug 2000 13:20:06 GMT) Organization: UUNET-NL (http://www.nl.uu.net) X-MSMail-Priority: Normal NNTP-Posting-Date: 4 Aug 2000 13:20:06 GMT Newsgroups: be.comp.os.windows