Huang Peng
2007-Oct-24 07:49 UTC
[Fontconfig] fc-cache is not always caching newly installed fonts.
Dears fontconfig developers, I found a problem in fontconfig. When system have been installed, and we adjust the system time to past, and then install some new fonts in system fonts dir (/usr/share/fonts). Applications can not find new installed fonts. So what can we do to fix this problem? Regards, Huang Peng
Donn
2007-Oct-24 07:57 UTC
[Fontconfig] fc-cache is not always caching newly installed fonts.
> When system have been installed, and we adjust the system time to past, > and then install some new fonts in system fonts dir (/usr/share/fonts). > Applications can not find new installed fonts. So what can we do to fix > this problem?I''m nobody, but it seems to me: a) Don''t mess with system time, b) run fc-cache ? /d
Huang Peng
2007-Oct-24 08:02 UTC
[Fontconfig] fc-cache is not always caching newly installed fonts.
On Wed, 2007-10-24 at 09:57 +0200, Donn wrote:> > When system have been installed, and we adjust the system time to past, > > and then install some new fonts in system fonts dir (/usr/share/fonts). > > Applications can not find new installed fonts. So what can we do to fix > > this problem? > > I''m nobody, but it seems to me: a) Don''t mess with system time, b) run > fc-cache ?For a). In many Linux distributions, users can not adjust the system time before installing system (Except the BIOS). They have to adjust system time in firstboot. For b). fc-cache can not find new installed fonts too. :( Thanks Huang Peng
Donn
2007-Oct-24 08:45 UTC
[Fontconfig] fc-cache is not always caching newly installed fonts.
> For a). In many Linux distributions, users can not adjust the system > time before installing system (Except the BIOS). They have to adjust > system time in firstboot.I don''t understand properly. It seems to me that if time must be set on every single boot, something''s wrong (battery). If time has to be set only once on first install, then that''s okay--it''s before any fonts get installed anyway (I think). Either way, setting the time into the past is going to mess-up all kinds of things. Why do it?> For b). fc-cache can not find new installed fonts too. :(I guess it''s the time-stamp on the files, although this seems odd. Is there no way to locate/grep/touch through all fonts and update their timestamps? or just set the time correctly and re-install the fonts. Just wondering aloud. I didn''t mean to down-play your problem :) /d
Huang Peng
2007-Oct-24 09:22 UTC
[Fontconfig] fc-cache is not always caching newly installed fonts.
On Wed, 2007-10-24 at 10:45 +0200, Donn wrote:> > For a). In many Linux distributions, users can not adjust the system > > time before installing system (Except the BIOS). They have to adjust > > system time in firstboot. > I don''t understand properly. It seems to me that if time must be set on every > single boot, something''s wrong (battery). > If time has to be set only once on first install, then that''s okay--it''s > before any fonts get installed anyway (I think). > Either way, setting the time into the past is going to mess-up all kinds of > things. Why do it?In some cases, the BIOS''s time is in the future. Users can not adjust system time and most of them did not know the time is incorrect, before installing the first OS. So they have to install the first OS with wrong system time. When they first boot the system, they will adjust the time. It''s no problem. All fonts have been installed correctly. But after some days, he want to add some new fonts for other languages (Japanese, Chinese, and etc) which were not installed. And then the problem happened. :(> > > For b). fc-cache can not find new installed fonts too. :( > I guess it''s the time-stamp on the files, although this seems odd. Is there no > way to locate/grep/touch through all fonts and update their timestamps? or > just set the time correctly and re-install the fonts.I can use ''fc-cahce -f'' to re-create all caches. It''s easy for me and most of Linux hackers.:) But it''s difficult for ordinary desktop users. And I can not add ''fc-cache -f'' in POST-INSTALL script of a font package, because it is too slow. Especially, when users install many font packages at the same time (like installing a OS, many font packages will be installed). It will invoke ''fc-cache -f'' many times. It waste much time. That is the problem. Hope can find an acceptable solution. Thanks Huang Peng
Nguyen Vu Hung
2007-Oct-24 10:10 UTC
[Fontconfig] fc-cache is not always caching newly installed fonts.
2007/10/24, Huang Peng <shawn.p.huang at gmail.com>:> > > For b). fc-cache can not find new installed fonts too. :( > > I guess it''s the time-stamp on the files, although this seems odd. Is there no > > way to locate/grep/touch through all fonts and update their timestamps? or > > just set the time correctly and re-install the fonts. > > I can use ''fc-cahce -f'' to re-create all caches. It''s easy for me and > most of Linux hackers.:) But it''s difficult for ordinary desktop users. > And I can not add ''fc-cache -f'' in POST-INSTALL script of a font > package, because it is too slow. Especially, when users install many > font packages at the same time (like installing a OS, many font packages > will be installed). It will invoke ''fc-cache -f'' many times. It waste > much time. > That is the problem. Hope can find an acceptable solution.FYI, Under a quite "fast" system, fc-cache -f takes 13 seconds with 155 fonts. So if a Linux installer has to run that command one by one every time a font is being installed, it will be a huge time. Ref: [root@ ~]# time fc-cache -f real 0m13.280s user 0m8.751s sys 0m0.486s [root@ ~]# fc-list | wc -l 155 [root@ ~]# cat /proc/cpuinfo | grep model | grep name model name : Intel(R) Xeon(TM) CPU 3.20GHz model name : Intel(R) Xeon(TM) CPU 3.20GHz [root@ ~]# cat /proc/cpuinfo | grep processor | wc -l 2 [root@ ~]# cat /proc/meminfo | grep MemTotal MemTotal: 1034616 kB -- Best Regards, Nguyen Hung Vu vuhung16plus{remove}@gmail.dot.com An inquisitive look at Harajuku http://www.flickr.com/photos/vuhung/sets/72157600109218238/
Keith Packard
2007-Oct-25 00:14 UTC
[Fontconfig] fc-cache is not always caching newly installed fonts.
On Wed, 2007-10-24 at 15:49 +0800, Huang Peng wrote:> Dears fontconfig developers, > > I found a problem in fontconfig. > > When system have been installed, and we adjust the system time to past, > and then install some new fonts in system fonts dir (/usr/share/fonts). > Applications can not find new installed fonts. So what can we do to fix > this problem?I''ve got some changes pending for fontconfig which place the directory timestamp right in the cache file; when that timestamp changes, the cache is invalidated. As it no longer cares what timestamp the cache file has, and uses simple equality (instead of ''earlier''), it should be much more resistent to system time changes (and other sources of clock weirdness). You might try the current ''master'' version of fontconfig and see if that works for you. -- keith.packard at intel.com -------------- 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/20071024/71d3135d/attachment.pgp
Jan Claeys
2007-Oct-26 13:27 UTC
[Fontconfig] fc-cache is not always caching newly installed fonts.
Op woensdag 24-10-2007 om 17:22 uur [tijdzone +0800], schreef Huang Peng:> I can use ''fc-cahce -f'' to re-create all caches. It''s easy for me and > most of Linux hackers.:) But it''s difficult for ordinary desktop > users. And I can not add ''fc-cache -f'' in POST-INSTALL script of a > font package, because it is too slow. Especially, when users install > many font packages at the same time (like installing a OS, many font > packages will be installed). It will invoke ''fc-cache -f'' many times. > It waste much time. That is the problem. Hope can find an acceptable > solution.I think Debian & Ubuntu do (something like) this at the moment, and it''s really slow indeed. But recently apt/dpkg has grown a "hooks" system that allows for running such commands only once after installing all selected packages. That should make the wait-times acceptable. -- Jan Claeys
Keith Packard
2007-Oct-30 17:48 UTC
[Fontconfig] fc-cache is not always caching newly installed fonts.
On Fri, 2007-10-26 at 15:27 +0200, Jan Claeys wrote:> Op woensdag 24-10-2007 om 17:22 uur [tijdzone +0800], schreef Huang > Peng: > > I can use ''fc-cahce -f'' to re-create all caches. It''s easy for me and > > most of Linux hackers.:) But it''s difficult for ordinary desktop > > users. And I can not add ''fc-cache -f'' in POST-INSTALL script of a > > font package, because it is too slow. Especially, when users install > > many font packages at the same time (like installing a OS, many font > > packages will be installed). It will invoke ''fc-cache -f'' many times. > > It waste much time. That is the problem. Hope can find an acceptable > > solution. > > I think Debian & Ubuntu do (something like) this at the moment, and it''s > really slow indeed. But recently apt/dpkg has grown a "hooks" system > that allows for running such commands only once after installing all > selected packages. That should make the wait-times acceptable.I''ve just rewritten the debian fontconfig hook that runs when fonts are installed -- it runs ''fc-cache -f'' only on the directory receiving the fonts (to make sure updates are re-cached). Then it runs ''fc-cache -s'' to make sure any directories leading to the new fonts are cached as well. All of these are run after all fonts are installed, so each directory is only cached once (well, twice currently, but I think that''s a bug somewhere). Performance is quite reasonable now. -- keith.packard at intel.com -------------- 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/20071030/6432a51e/attachment.pgp
Jan Claeys
2007-Oct-30 19:37 UTC
[Fontconfig] fc-cache is not always caching newly installed fonts.
Op dinsdag 30-10-2007 om 10:48 uur [tijdzone -0700], schreef Keith Packard:> On Fri, 2007-10-26 at 15:27 +0200, Jan Claeys wrote: > > I think Debian & Ubuntu do (something like) this at the moment, and it''s > > really slow indeed. But recently apt/dpkg has grown a "hooks" system > > that allows for running such commands only once after installing all > > selected packages. That should make the wait-times acceptable. > > I''ve just rewritten the debian fontconfig hook that runs when fonts > are installed -- it runs ''fc-cache -f'' only on the directory receiving > the fonts (to make sure updates are re-cached). Then it runs ''fc-cache > -s'' to make sure any directories leading to the new fonts are cached > as well. All of these are run after all fonts are installed, so each > directory is only cached once (well, twice currently, but I think > that''s a bug somewhere). > > Performance is quite reasonable now.That sounds great, and this should get imported in the next Ubuntu release too then. Thanks! -- Jan Claeys