Summary: | Include TTF_NAME table fields in fontconfig's cache | ||
---|---|---|---|
Product: | fontconfig | Reporter: | Nicolas Spalinger <nicolas.spalinger> |
Component: | library | Assignee: | fontconfig-bugs |
Status: | RESOLVED MOVED | QA Contact: | Behdad Esfahbod <freedesktop> |
Severity: | normal | ||
Priority: | medium | CC: | akira, freedesktop, mpsuzuki |
Version: | 2.6 | ||
Hardware: | All | ||
OS: | All | ||
Whiteboard: | |||
i915 platform: | i915 features: | ||
Attachments: | A preliminary patch to cache more name entries in TTF |
Description
Nicolas Spalinger
2008-11-01 12:08:54 UTC
Nicolas, if you want to hack on this, I'm interested in reviewing a patch. Here's the fields I think can be added: #define TT_NAME_ID_COPYRIGHT 0 #define TT_NAME_ID_VERSION_STRING 5 #define TT_NAME_ID_TRADEMARK 7 #define TT_NAME_ID_MANUFACTURER 8 #define TT_NAME_ID_DESIGNER 9 #define TT_NAME_ID_DESCRIPTION 10 #define TT_NAME_ID_VENDOR_URL 11 #define TT_NAME_ID_DESIGNER_URL 12 #define TT_NAME_ID_LICENSE 13 #define TT_NAME_ID_LICENSE_URL 14 #define TT_NAME_ID_SAMPLE_TEXT 19 For each, a language field is also desired. For example, FC_COPYRIGHT and FC_COPYRIGHTLANG. To add these, you need to modify fontconfig.h, fcname.c, and finally fcfreetype.c to collect them. That should be all. Although I'm not sure if Nicolas is still interested in, I will try to write a patch for this feature. Hi Susuki-san. I'm still interested but haven't found the time to move forward on this. This is also beyond my current programming abilities. Your help much appreciated. This will be incredibly useful. Thanks. Created attachment 38746 [details] [review] A preliminary patch to cache more name entries in TTF Here is a preliminary patch to store more name entries into cache file. Yet I've not written the tools like fc-license etc. BTW, some fonts have long texts for license (e.g. Vera by Bitstream, including 2.3K byte text) and increases the size of cache file. Some people may propose to compress them. Dear Nicolas, Please find recent discussion in 29497: https://bugs.freedesktop.org/show_bug.cgi?id=29497 Behdad thinks it is not good idea to use fontconfig cache as a storage of arbitrary data copied from font files - the cached data should be related with a query method to lookup a font by using the data as an attribute. Thus, the long texts like license, sample text do not fit to the criteria. For such data, fontconfig would be used just as a storage, they don't help the font lookup. Please describe what kind of features of fc-license you expected, in detail. It can be a counter evidence to show the advantage to cache license text. I think it is NOT so unreasonable request to have a storage of some selected metadata copied from the font files, but it seems that fontconfig maintainer(s) think fontconfig is not for such purpose. Putting the long text fields in the cache enlarges the cache files considerably and unnecessarily. We can add fontconfig API for looking up various name-table fields from an FT_Face, but don't have to put them in the cache. (In reply to comment #6) > Putting the long text fields in the cache enlarges the cache files considerably > and unnecessarily. OK, I understand that a lot a text is too much for the cache but I really think that we need at the very least TT_NAME_ID_COPYRIGHT, TT_NAME_ID_VENDOR_URL, TT_NAME_ID_DESIGNER_URL and TT_NAME_ID_LICENSE_URL which are short. The general use case would be to allow for better classification of the fonts available to the system: who are the author(s) and the supporting foundry, under what terms the fonts can be used, etc by exposing the dedicated short text field and the URLs. > We can add fontconfig API for looking up various name-table fields from an > FT_Face, but don't have to put them in the cache. I agree that for the bigger name-table fields this makes sense. Thanks for the efforts towards this. -- 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/24. |
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.