Kerning information for Type 1 fonts is contained in a separate file from the outline information. FreeType2 supports associating an AFM file with a Type 1 font using FT_Attach_File(), but fontconfig currently doesn't provide the name of the AFM file associated with a Type 1 font, so systems using FreeType2 and fontconfig can't kern Type 1 fonts (unless the program using Fontconfig hunts for the AFM file itself). Fontconfig should find AFM files associated with Type 1 fonts and make the AFM file name available to the application in the same way as the PostScript file name is made available to the application.
Hmm. If the .afm files are located in the same directory as the .pfb files, things are easy. But if they're in different directories, then the current scheme of saving font information in each directory breaks down. And, if they're in the same directory, then it's likely you'll find them by replacing the .pfa/.pfb extension with .afm. Suggestions on how else to do this would be welcome; I've been thinking about it a bit already.
.afm files tend to be in the same directory or in a child directory. I don't expect fontconfig to search the system and match up .pfb and .afm files in random locations. For the PDFlib backend of PangoPDF, I do locate .afm files by replacing .pfa/.pfb with .afm and testing for the existence of the .afm file. Of course, only the general idea is useful for fontconfig: static void maybe_set_afm (PDF *pdf_doc, const gchar *fontname, const gchar *non_afm_filename) { GString *filename = g_string_new (non_afm_filename); int len = strlen (non_afm_filename); g_string_truncate (filename, len-3); g_string_append (filename, "afm"); if (g_file_test (filename->str, G_FILE_TEST_EXISTS)) { GString *parameter = g_string_new (NULL); g_string_printf (parameter, "%s==%s", fontname, filename->str); PDF_set_parameter (pdf_doc, "FontAFM", parameter->str); g_string_free (parameter, TRUE); } g_string_free (filename, TRUE); }
reopening all RESOLVED/{LATER,REMIND} bugs. now is later, and this is a reminder. ;)
Hi Keith, chasing old bugs, is this still an issue?
I'm going to punt this from fontconfig; applications are welcome to go looking for .afm files based on the font filename.
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.