freetype-devel
[Top][All Lists]
Advanced

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

[Devel] Examining Windows fonts with FT


From: Steven Johnson
Subject: [Devel] Examining Windows fonts with FT
Date: Tue, 13 Jul 2004 15:27:37 -0700

Hi all. I'm new to FreeType usage, so my apologies if this has been covered before, but I looked thru all the old archives and never saw this addressed directly.
 
I'm trying to use FreeType to examine all the installed fonts on a Windows system, and haven't yet found a way that's entirely satisfactory; perhaps someone here can share a better technique.
 
I've tried two approaches:
 
(1) Enumerate the logical fonts installed, using EnumFontFamiliesEx(), read the font into memory using GetFontData, then use FT_New_Memory_Face(). This works in most cases, but some fonts fail with a "bad format" error. On my system, these are mainly asian TTCs (eg, MSGOTHIC.TTC) but I haven't yet determined if the problem is exclusive to non-Western fonts or to TTCs. (This same file loads correctly using method 2, below.) I'm currently using FT2.18; I pullsed down the current 2.19 source but didn't see any changes or fixes that seemed obviously related.
 
(2) Enumerate the files in the fonts directory and open each file with FT_New_Face(). This works fine, but I haven't yet found a reliable way to associate a given face returned by FT into a LOGFONT as expected by various Win32 API calls, and my application will eventually require this. (Secondarily, I'm concerned this might be a more fragile approach that method 1, above, that might be more prone to breakage on unusual systems.)
 
Anyway... I realize this is more of a Windows question that a FreeType question, but it does seem relevant to FreeType usage, and perhaps someone on this list has encountered this sort of thing. Thanks in advance for any advice.
 

reply via email to

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