freetype
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: [Freetype] Loading fonts under Windows


From: Ulrich Knappe
Subject: Re: [Freetype] Loading fonts under Windows
Date: Fri, 03 May 2002 11:09:06 +0200


Garrick Meeker schrieb:

> If I want to load a font by name and style, such as "Times Bold", how would I
> do this under Windows?  I'm currently scanning the Windows font directory,
> opening each font, and checking the info.  I guess I'm looking for something
> like the Mac function FT_New_Face_From_FOND.  I know this isn't built into
> freetype, but does anyone have example code that does this?
>

Windows (NT) stores the relation between font names and file names in
its

registry key "HKEY_LOCAL_MACHINE", 

subkey 
"SOFTWARE\Microsoft\Windows NT\CurrentVersion\Fonts" 

(for other versions than Win NT, the subkey name is a
little bit different).

You can use the Registry Enumeration functions of the Win32 API (you
need the Win
SDK for this) to get the file names:

1.) Open the subkey with RegOpenKeyEx().

2.) Poll the installed font names with RegEnumValue(), until you find
your font.
This function returns you the file name als the key's value.

3.) Close the subkey with RegCloseKey().

Hope this helps,

Uli

>
> _______________________________________________
> Freetype mailing list
> address@hidden
> http://www.freetype.org/mailman/listinfo/freetype

Attachment: apris.vcf
Description: Visitenkarte für Ulrich Knappe


reply via email to

[Prev in Thread] Current Thread [Next in Thread]