[Fontconfig] how to read config file from current dir (relative to a binary using the lib)

Raimund Steger rs at mytum.de
Sun Sep 2 03:14:04 PDT 2012

Raimund Steger wrote:
> Helmut Tessarek wrote:
>> [...]
>> Don't you think, it might be a good idea to give fontconfig the option to
>> search in ./fontconfig/ first, before looking in PREFIX/etc or
>> --sysconfdir?
> Having objects make any assumptions about the location in the file
> system they're stored in would be very uncommon on Unix. I. e. there is
> no POSIX equivalent of Win32's GetModuleFileName.

I should add, as I believe Akira already mentioned there is a way to 
have fontconfig look in the current working directory (as opposed to the 
binary's directory) by redefining the FONTCONFIG_PATH macro during 
compilation, i. e. CFLAGS="-DFONTCONFIG_PATH='\".\"'".
But this won't usually do the job, as the current working directory 
might be set to anything when an executable is called.


Worringer Str 31, Duesseldorf 40211 Germany   home: <rs at mytum.de>
+49-179-2981632 icq 16845346                  work: <rs at interface-ag.de>

More information about the Fontconfig mailing list