there are some cases I feel an urge to cleanup/redesign fontconfig API though, let me add a note here for a chance to do so in the future. 1. the API prefix isn't intuitive to find out where it's included in. e.g. FcDirCache* in fccache.c but some is in fcdir.c. and some can see in fcfs.c, fslist.c and fcmatch.c. for FcFontSet as well. 2. some APIs is hard to imagine the functionality from the name e.g. FcDirCacheRead() vs FcDirCacheLoad() 3. FcCacheDir() vs FcConfigGetCacheDirs() it implies from the name it may behaves similarly but FcCacheDir() returns the font directory at this moment. 4. function doesn't take any structure as its prefix implies e.g. FcConfigFilename() etc 5. FcConfigAppFontAddFile() and FcConfigAppFontAddDir() that could be integrated into one and branch if it's a file or a directory? 6. In doc, FcConfigSubstitute() and FcDefaultSubstitute() are required to get FcFontMatch() and FcFontSort() working though, it's actually optional to do in the program. guess there may be a reason to do so but that looks to me like an error of API design. may update more later...
Another thing is FcConfigGetConfigDirs() and FcConfigGetFontDirs(). From the name of FcConfigGetConfigDirs() implies the list of the configuration directories. but it: Returns the list of font directories specified in the configuration files for config. Does not include any subdirectories. and in the man page of FcConfigGetFontDirs(): Returns the list of font directories in config. This includes the configured font directories along with any directories below those in the filesystem. That looks like a duplicate or can be merged into one API perhaps and we may want to have the new FcConfigGetConfigDirs() that returns the configuration directories specified with <include> in the config file
In general, API cleanup belongs to fontconfig 3 in my opinion.
That, and the Cache API really is mostly an implementation detail of fc-cache. Perhaps it should become completely internal and fc-cache become a special program that has access to it.
(In reply to comment #2) > In general, API cleanup belongs to fontconfig 3 in my opinion. Right. this is just a note to help the discussion coming in the future.
-- GitLab Migration Automatic Message -- This bug has been migrated to freedesktop.org's GitLab instance and has been closed from further activity. You can subscribe and participate further through the new bug through this link to our GitLab instance: https://gitlab.freedesktop.org/fontconfig/fontconfig/issues/17.
Use of freedesktop.org services, including Bugzilla, is subject to our Code of Conduct. How we collect and use information is described in our Privacy Policy.