[Lazarus] System Font Dir for Font Manager Search Path

Graeme Geldenhuys graeme at geldenhuys.co.uk
Wed Jun 26 10:07:13 CEST 2013


On 25/06/13 19:12, Edilson Vieira wrote:
> My question is How do I get the system font directory on Windows and Linux?

I has the same problem when I wrote a font cache system for AggPas in fpGUI.

Under Windows it is easy. There is a registry entry you can query.

Under Linux and FreeBSD it is not so easy. FreeBSD is slightly easier
than Linux, because they are more standarised (no 1000's of distros
doing there own thing) in where things must be installed.

eg: Here are _some_ font paths on FreeBSD

    lPathList.Add('/usr/share/cups/fonts/');
    lPathList.Add('/usr/share/fonts/truetype/');
    lPathList.Add('/usr/local/lib/X11/fonts/');
    lPathList.Add(GetUserDir + '.fonts/');


Linux will probably be similar to the above - but no guarantees. There
are other font paths I haven't listed above. My font cache also runs
recursively through the paths I specify. I don't know if the FontMgr you
mentioned does that.

I tried to look in the fontconfig source code to see how they do it, but
couldn't find anything - though I didn't look too hard.

Regards,
  - Graeme -





More information about the Lazarus mailing list