summaryrefslogtreecommitdiff
path: root/src/fchash.c
Commit message (Collapse)AuthorAgeFilesLines
* Drop unnecessary line to include uuid.hAkira TAGOH2019-04-031-3/+0
|
* Replace UUID file mechanism with per-directory 'map' attribute [v2]Keith Packard2019-04-031-17/+0
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | The UUID files would be placed in each font directory to provide the unique cache name, independent of path, for that directory. The UUID files are undesireable for a couple of reasons: 1) They must be placed in the font directories to be useful. This requires modifying the font directories themselves, introducing potential visible timestamp changes when running multiple applications, and makes the cache processing inconsistent between applications with permission to write to the font directories and applications without such permission. 2) The UUID contents were generated randomly, which makes the font cache not reproducible across multiple runs. One proposed fix for 2) is to make the UUID dependent on the font directory path, but once we do that, we can simply use the font directory path itself as the key as the original MD5-based font cache naming mechanism did. The goal of the UUID file mechanism was to fix startup time of flatpaks; as the font path names inside the flatpak did not match the font path names in the base system, the font cache would need to be reconstructed the first time the flatpak was launched. The new mechanism for doing this is to allow each '<dir>' element in the configuration include a 'map' attribute. When looking for a cache file for a particular directory, if the directory name starts with the contents of the <dir> element, that portion of the name will be replaced with the value of the 'map' attribute. Outside of the flatpak, nothing need change -- fontconfig will build cache files using real directory names. Inside the flatpak, the custom fonts.conf file will now include mappings such as this: <dir map="/usr/share/fonts">/run/host/fonts</dir> When scanning the directory /run/host/fonts/ttf, fontconfig will use the name /usr/share/fonts/ttf as the source for building the cache file name. The existing FC_FILE replacement code used for the UUID-based implementation continues to correctly adapt font path names seen by applications. v2: Leave FcDirCacheCreateUUID stub around to avoid removing public API function. Document 'map' attribute of <dir> element in fontconfig-user.sgml Suggested-by: Akira TAGOH <akira@tagoh.org> Signed-off-by: Keith Packard <keithp@keithp.com>
* Remove .uuid when no font files exists on a directoryAkira TAGOH2018-06-111-0/+29
| | | | https://bugs.freedesktop.org/show_bug.cgi?id=106632
* FcHashTableAddInternal: Compare against the right keyAlexander Larsson2018-01-141-1/+1
| | | | | | | | We were comparing the passed in key with the ready-to-insert key rather than the key in the hashtable, so if you ever had a hash conflicts we'll never insert the new item. https://bugs.freedesktop.org/show_bug.cgi?id=101889
* fchash: Fix replaceAlexander Larsson2017-12-191-0/+2
| | | | | | When we replace a bucket in the hashtable we have to update the next pointer too, or we lose all the other elements that hashed to this key.
* Disable uuid related code on Win32Akira TAGOH2017-12-181-0/+4
|
* Replace uuid in the table properly when -rAkira TAGOH2017-12-181-5/+32
|
* Returns false if key is already available in the tableAkira TAGOH2017-12-181-1/+1
|
* thread-safe functions in fchash.cAkira TAGOH2017-11-241-2/+4
|
* Use smaller prime for hash sizeAkira TAGOH2017-11-201-1/+1
|
* Fix a typoAkira TAGOH2017-11-201-1/+1
|
* abstract hash table functionsAkira TAGOH2017-11-201-0/+181
|
* Remove unused FcHash code now that FC_HASH is deprecatedBehdad Esfahbod2014-06-121-189/+0
|
* Rewrite hashing to use FT_Stream directlyBehdad Esfahbod2014-05-161-71/+4
| | | | | | | | | This is more robust but introduces a small change in behavior: For .pcf.gz fonts, the new code calculates the hash of the uncompressed font data whereas the original code was calculating the hash of the compressed data. No big deal IMO.
* Further simplify hash codeBehdad Esfahbod2014-05-161-50/+38
|
* Simplify hash codeBehdad Esfahbod2014-05-161-51/+43
|
* Remove unused codeBehdad Esfahbod2014-05-161-41/+0
|
* avoid reading config.h twiceAkira TAGOH2013-09-261-3/+0
| | | | | | | config.h is read from fcint.h now so having a line of the sort of #include "config.h" is duplicate. Bug 69833 - Incorrect SIZEOF_VOID_P and ALIGNOF_DOUBLE definitions causes nasty warnings on MacOSX when building fat libraries
* Fix a shift count overflow on 32bit boxAkira TAGOH2013-06-271-10/+10
|
* Bug 63329 - make check fails: .. contents:: :depth: 2Akira TAGOH2013-04-101-0/+62
| | | | | | Add back FcHashGetSHA256DigestFromFile() and fall back to it when font isn't SFNT-based font because FT_Load_Sfnt_Table fails with FT_Err_Invalid_Face_Handle.
* Revert the previous change and rework to not export freetype API outside ↵Akira TAGOH2013-04-091-35/+12
| | | | fcfreetype.c
* Obtain fonts data via FT_Face instead of opening a file directlyAkira TAGOH2013-04-091-17/+33
|
* Ensure closing fp on errorAkira TAGOH2013-04-091-1/+1
|
* Bug 50733 - Add font-file hash?Akira TAGOH2013-02-051-0/+265
Add "hash" object which contains SHA256 hash value (so far) computed from the font file.