[Dev-luatex] Build failure of 0.71 and EnumFonts

Graham Douglas graham.douglas at readytext.co.uk
Fri Feb 17 19:30:41 CET 2012


Hi

I just tried to build the latest LuaTeX and experienced the
same build failure reported by Paul Isambert:

http://tug.org/pipermail/luatex/2011-October/003250.html

I checked the Windows API documentation and it says about
"EnumFonts"

int EnumFonts(
   __in  HDC hdc,
   __in  LPCTSTR lpFaceName,
   __in  FONTENUMPROC lpFontFunc,
   __in  LPARAM lParam
);

"This function is provided only for compatibility with 16-bit versions 
of Windows. Applications should use the EnumFontFamiliesEx function."

int EnumFontFamiliesEx(
   __in  HDC hdc,
   __in  LPLOGFONT lpLogfont,
   __in  FONTENUMPROC lpEnumFontFamExProc,
   __in  LPARAM lParam,
   DWORD dwFlags
);

Note, MS docs say: "dwFlags
This parameter is not used and must be zero."

Indeed, in GlobalParams.cc contains a couple of calls to EnumFonts

WinFontList::WinFontList(char *winFontDirA) {
   OSVERSIONINFO version;
   char *path;

   fonts = new GooList();
   dc = GetDC(NULL);
   winFontDir = winFontDirA;
   version.dwOSVersionInfoSize = sizeof(version);
   GetVersionEx(&version);
   if (version.dwPlatformId == VER_PLATFORM_WIN32_NT) {
     path = "SOFTWARE\\Microsoft\\Windows NT\\CurrentVersion\\Fonts\\";
   } else {
     path = "SOFTWARE\\Microsoft\\Windows\\CurrentVersion\\Fonts\\";
   }
   if (RegOpenKeyEx(HKEY_LOCAL_MACHINE, path, 0,
		   KEY_QUERY_VALUE | KEY_ENUMERATE_SUB_KEYS,
		   &regKey) == ERROR_SUCCESS) {

		
	EnumFonts(dc, NULL, &WinFontList::enumFunc1, (LPARAM)this);


     RegCloseKey(regKey);
   }
   ReleaseDC(NULL, dc);
}


And later  EnumFonts(fl->dc, font->lfFaceName, &WinFontList::enumFunc2, 
(LPARAM)fl);


As a first approach, perhaps a simple replacement of

EnumFonts(.....)

with

EnumFontFamiliesEx(...,0);

Might work?

I'll try this to see if it builds....


Cheers

Graham







More information about the dev-luatex mailing list