Created attachment 38742 [details] [review] A preliminary patch to cache OS/2.sFamilyClass & OS/2.Panose As posted in mailing list http://lists.freedesktop.org/archives/fontconfig/2010-September/003472.html I propose to store OS/2.sFamilyClass and OS/2.Panose data in fontconfig cache file. Some office documents (ODF, OOXML), page description languages (PDF, PCL) and CSS may lookup the font resource by using Panose values. ================================================================== PDF --- PDF Reference 6th edition (for PDF version 1.7) 5.7.2 Font Descriptors for CIDFonts see the description for "Style" entry which includes 2 bytes from OS/2.sFamilyClass, 10 bytes from OS/2.Panose. SVG --- http://www.w3.org/TR/2003/REC-SVG11-20030114/fonts.html 20.8.3 The `font-face' element there are many elements inherited from CSS2, including Panose. ODF --- http://docs.oasis-open.org/office/v1.1/OS/OpenDocument-v1.1.pdf 14.6.1 CSS2/SVG Font Descriptors ODF adopted the elements for the fonts from CSS2 and SVG, so even the font is for the text (not for embedded scalable graphics), it may have Panose value in the svg:panose-1 attribute. OOXML ----- ISO/IEC 29500-1:2008 17.8.3.13 panose1 (Panose-1 Typeface Classification Number) OOXML have several font properties (GDI parameters, Panose, and supported unicode range). In 17.8.2 Font Substitution, there is a list of properties to be used in the font substitution, and panose is described as the highest priority. PCL --- "PCL 5e Technical Quick Reference Guide" http://h20000.www2.hp.com/bc/docs/support/SupportManual/bpl13205/bpl13205.pdf "PCL5 Comparison Guide" http://h20000.www2.hp.com/bc/docs/support/SupportManual/bpl13206/bpl13206.pdf PCL5 selects the font by giving Panose parameters sequentially and narrowing down the candidates, see PCL 5e Technical Quick Reference Guide p 11-15. See table 1-1 "PCL5 Feature Support Matrix" in page 1-12 PCL5 Comparison Guide, many PCL5 implementations support the feature to narrow down by Panose parameters. Also PCL6 (PCL XL) supports the feature by giving a string of PCL5 commands to PCLSelectFont attribute. ================================================================== In addition, current fontconfig does not have easy element to be related with CSS's 5 family classification (serif, sans- serif, cursive, fantasy). I think getting FamilyClass & Panose values from fontconfig cache may be helpful, because the application don't have to open a face, load OS/2 table, check FamilyClass/Panose values, close a face. The font selection by the matching of familynames & charsets leaves a room for an improvement, because severeal documents formats (and CSS) have these properties in the documents. -- FreeType2 provides the interface to access them from FT_Face object, so they can do Panose value checking out of fontconfig library. But if fontconfig can cache these values, the application programs can reduce the cost to open/check/close font files by themselves. I attached preliminary patch to cache them.
Link to existing request of feature, bug #29497, which asks for serif/sans-serif distinction by IBM sFamilyClass and Panose.
*** This bug has been marked as a duplicate of bug 29497 ***
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.