Hi, I do not know the exact answer to your question, but the per-user ~/.fonts.cache-1 file is there for something along the same lines. behdad On Thu, 16 Jun 2005, Han-Wen Nienhuys wrote:> > hi there, > > I''ve hit on a nasty problem with fontconfig within the MacOS X port of > LilyPond. This program is delivered as a app-bundle, and can be > installed by ordinary users, simply by drag & dropping the bundle > somewhere. > > The problem is that MacOS ships with a bunch of fonts in > /System/Library/Fonts. Whenever our application starts > it scans this directory. This takes several minutes due to the oriental > fonts. fc-cache cannot cache this directory, since it is not writable by > ordinary users. > > I hope I''m missing an obvious solution, but a cursory glace at the FC > sources indicate that cache files are always written in the font > directory itself. > > Of course, I can kludge around this, > > - mirror /System/Library/Fonts with symlinks in a writable directory > (I will probably use this kludge.) > - ask the user for their password, and run fc-cache with sudo > - write an installer that runs fc-cache. > > however, none of these strike me as elegant. It would be better if the > cache could be stored separately from the directory, under control of > the process-owner. This also makes more sense if -for some reason- > applications decide to add system-wide read-only font directories that > are normally not part of a fontconfig installation > (/usr/share/texmf/fonts/type1 springs to mind). > > >--behdad http://behdad.org/
Behdad Esfahbod wrote:> I do not know the exact answer to your question, but the per-user > ~/.fonts.cache-1 file is there for something along the same > lines.> Great. How do I get it to work, though? I have <cache>/Users/hanwen/src/maclily/BUILD/image/ Applications/LilyPond.app//Contents/Resources/font-cache</cache> (without linebreak, of course) in my fonts.conf, but running LilyPond (the FC application) doesn''t create the font-cache file, and fc-cache says fc-cache: "/System/Library/Fonts": skipping, no write access Am I missing something? -- Han-Wen Nienhuys - hanwen@xs4all.nl - http://www.xs4all.nl/~hanwen
On Fri, 2005-06-17 at 01:17 +0200, Han-Wen Nienhuys wrote:> hi there, > > I''ve hit on a nasty problem with fontconfig within the MacOS X port of > LilyPond. This program is delivered as a app-bundle, and can be > installed by ordinary users, simply by drag & dropping the bundle > somewhere. > > The problem is that MacOS ships with a bunch of fonts in > /System/Library/Fonts. Whenever our application starts > it scans this directory. This takes several minutes due to the oriental > fonts. fc-cache cannot cache this directory, since it is not writable by > ordinary users.fontconfig should be caching information about those fonts in ~/.fonts.cache-1.> I hope I''m missing an obvious solution, but a cursory glace at the FC > sources indicate that cache files are always written in the font > directory itself.Right, per-directory caches are always placed right in the directory with the files. Owen Taylor asked a while ago if this couldn''t be fixed somehow, but I haven''t ever bothered to try and implement anything. One obvious kludge would be to construct a parallel hierarchy in some writable partition and place the cache files there, similar to how CVS manages out-of-tree lock files. I think this would be fairly easy -- just prefixing the cache file names with a path string. -keith -------------- next part -------------- A non-text attachment was scrubbed... Name: not available Type: application/pgp-signature Size: 189 bytes Desc: This is a digitally signed message part Url : http://lists.freedesktop.org/archives/fontconfig/attachments/20050616/f687e317/attachment.pgp
Keith Packard wrote:>>The problem is that MacOS ships with a bunch of fonts in >>/System/Library/Fonts. Whenever our application starts >>it scans this directory. This takes several minutes due to the oriental >>fonts. fc-cache cannot cache this directory, since it is not writable by >>ordinary users. > > > fontconfig should be caching information about those fonts in > ~/.fonts.cache-1.For some reason, this is not happening on my MacOS X box. Any clue why? [debugging..] It seems that fontconfig defaults to the compile time paths, which is why my local.conf isn''t seen. From the source code, I can see I can override this with the FONTCONFIG_PATH environment variable. Could this information be added to the documentation? This is crucial for Windows and macos applications, since they need to be relocatable. I now notice that FONTCONFIG_FILE and FC_DEBUG are not documented either, BTW. Also, it would be nice if there a way to detect whether the cache rebuild is happening. Right now we can''t give the user any feedback on what is happening, and why the startup is taking so long. Of course, for the first run, we can kludge around it by detecting whether .fonts.cache-1 exists.> One obvious kludge would be to construct a parallel hierarchy in some > writable partition and place the cache files there, similar to how CVS > manages out-of-tree lock files. > > I think this would be fairly easy -- just prefixing the cache file names > with a path string.Indeed. Then .fonts.cache-1 would become a directory tree instead of a single file. -- Han-Wen Nienhuys - hanwen@xs4all.nl - http://www.xs4all.nl/~hanwen
hi there, I''ve hit on a nasty problem with fontconfig within the MacOS X port of LilyPond. This program is delivered as a app-bundle, and can be installed by ordinary users, simply by drag & dropping the bundle somewhere. The problem is that MacOS ships with a bunch of fonts in /System/Library/Fonts. Whenever our application starts it scans this directory. This takes several minutes due to the oriental fonts. fc-cache cannot cache this directory, since it is not writable by ordinary users. I hope I''m missing an obvious solution, but a cursory glace at the FC sources indicate that cache files are always written in the font directory itself. Of course, I can kludge around this, - mirror /System/Library/Fonts with symlinks in a writable directory (I will probably use this kludge.) - ask the user for their password, and run fc-cache with sudo - write an installer that runs fc-cache. however, none of these strike me as elegant. It would be better if the cache could be stored separately from the directory, under control of the process-owner. This also makes more sense if -for some reason- applications decide to add system-wide read-only font directories that are normally not part of a fontconfig installation (/usr/share/texmf/fonts/type1 springs to mind). -- Han-Wen Nienhuys - hanwen@xs4all.nl - http://www.xs4all.nl/~hanwen