Would be useful I guess to add a sha256 or similar hash of the font file to the pattern. Applications can use it as some kind of a "unique id" across processes for caching and other purposes. I personally would happily consider two fonts with the same sha256 hash to be the same file... Also, may not need to specify what hashing algorithm is used, just that it's "strong". Then we can upgrade to sha384, sha512, ... over time as we see fit.
Right, the important part is that which hashing algorithm is used can be changed over time, which may mean including the algorithm name in the data with the hash value.
proposed implementation for this feature: http://cgit.freedesktop.org/~tagoh/fontconfig/commit/?h=bz50733 In this proposal, I just added the hash value as string. wondering if I should add it as the array of Integer or kind of FcHash?
sample output... $ ./fc-query/fc-query /usr/share/fonts/vlgothic/VL-Gothic-Regular.ttf | grep hash hash: "26f470356f6130e802bafea3b23805cf59b83cb60c566bb982792c6ad3d73306"(s) $ sha256sum /usr/share/fonts/vlgothic/VL-Gothic-Regular.ttf 26f470356f6130e802bafea3b23805cf59b83cb60c566bb982792c6ad3d73306 /usr/share/fonts/vlgothic/VL-Gothic-Regular.ttf
String is adequate. Perhaps prepend the string with "sha256:"?
I think you can also get rid of some of the internal API. Just have a function that returns a string that has the hash type and the hash itself. No need for differentiating the type in the library really.
Thanks for the comment. cleaned up and improved.
looks like this: $ ./fc-query/fc-query /usr/share/fonts/vlgothic/VL-Gothic-Regular.ttf | grep hash hash: "sha256:26f470356f6130e802bafea3b23805cf59b83cb60c566bb982792c6ad3d73306"(s)
Looks good to me. Lets get in.
Thanks for the review. merged into master.
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.