#41 Font directory not found on Win2k/WinNT

closed
nobody
None
5
2007-03-15
2007-02-25
Anonymous
No

Plplot v. 5.6.1 with freetype support fails on initialization when run on Win2K/WinNT; everything is ok on Win95 & WinXP.
The cause seems that plfreetype.c, when compiled on MS platforms, searches for fonts only in c:\windows\fonts and c:\windows\system\fonts. By default, WinNT and Win2K installs the operating system in the c:\WinNT folder, so the "search-for-fonts" algoirithm fails.
Adding the following code in plfreetype.c, starting at line 526 (before prompting the "Could not find font path") should solve the problem (at least, for me it worked!)

else if ((a = getenv("WINDIR")) != NULL)
{
strcpy(font_dir,a);
for (a = font_dir; *a; a++)
if (*a == '\\')
*a = '/';
strcat(font_dir,"/fonts/");
}

Best regards,
Gianfranco Zuliani

gianfranco_zuliani@yahoo.it

Discussion

  • Andrew Roach
    Andrew Roach
    2007-03-15

    • status: open --> closed